diff --git a/.fern/metadata.json b/.fern/metadata.json new file mode 100644 index 000000000..6d288f4ab --- /dev/null +++ b/.fern/metadata.json @@ -0,0 +1,15 @@ +{ + "cliVersion": "3.39.2", + "generatorName": "fernapi/fern-java-sdk", + "generatorVersion": "3.18.5", + "generatorConfig": { + "publish-to": "central", + "generate-unknown-as-json-node": true, + "base-api-exception-class-name": "ApiError", + "base-exception-class-name": "MergeException", + "disable-required-property-builder-checks": true, + "object-query-parameters": true, + "package-layout": "flat", + "enable-forward-compatible-enums": true + } +} \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock new file mode 100644 index 000000000..08c06a77c --- /dev/null +++ b/.fern/replay.lock @@ -0,0 +1,16 @@ +# DO NOT EDIT MANUALLY - Managed by Fern Replay +version: "1.0" +generations: + - commit_sha: 3da2332dd484a33ca428e9491b563ad6c3e6eccd + tree_hash: 0418a0fa1ed2af2848561228d7124396728ec1a8 + timestamp: 2026-07-13T16:56:02.488Z + cli_version: unknown + generator_versions: {} + - commit_sha: 2d7da314a3f1a5f6890e050b4349e9a33334feec + tree_hash: 395f80fcf1989f1b52d5fc7d9e8a79ad5289d59e + timestamp: 2026-07-13T16:56:04.189Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 3.18.5 +current_generation: 2d7da314a3f1a5f6890e050b4349e9a33334feec +patches: [] diff --git a/.fernignore b/.fernignore index a54fbc537..9a237c314 100644 --- a/.fernignore +++ b/.fernignore @@ -15,3 +15,6 @@ src/main/java/com/merge/legacy src/main/java/com/merge/api/core/QueryStringMapper.java src/test/java/com/merge/api/integration/CursorPaginationIntegrationTest.java +.fern/replay.lock +.fern/replay.yml +.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..74928d6a4 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.fern/replay.lock linguist-generated=true diff --git a/.mock/accounting_v3.yml b/.mock/accounting_v3.yml deleted file mode 100644 index 455d27ce6..000000000 --- a/.mock/accounting_v3.yml +++ /dev/null @@ -1,32829 +0,0 @@ -openapi: 3.0.3 -info: - title: Merge Accounting API - version: '1.0' - description: The unified API for building rich integrations with multiple Accounting - & Finance platforms. - contact: - name: Merge Team - url: https://www.merge.dev/ - email: hello@merge.dev -paths: - /accounting/v1/account-details: - get: - operationId: account_details_retrieve - description: Get details for a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - account-details - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountDetails' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/account-token/{public_token}: - get: - operationId: account_token_retrieve - description: Returns the account token for the end user with the provided public - token. - parameters: - - in: path - name: public_token - schema: - type: string - required: true - tags: - - account-token - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/accounting-periods: - get: - operationId: accounting_periods_list - description: Returns a list of `AccountingPeriod` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - accounting-periods - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountingPeriodList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/accounting-periods/{id}: - get: - operationId: accounting_periods_retrieve - description: Returns an `AccountingPeriod` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - accounting-periods - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountingPeriod' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/accounts: - get: - operationId: accounts_list - description: Returns a list of `Account` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: account_type - schema: - type: string - description: If provided, will only return accounts with the passed in enum. - - in: query - name: classification - schema: - type: string - nullable: true - enum: - - '' - - ASSET - - EQUITY - - EXPENSE - - LIABILITY - - - - REVENUE - description: If provided, will only return accounts with this classification. - - in: query - name: company_id - schema: - type: string - description: If provided, will only return accounts for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return Accounts with this name. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - classification - - classification,status - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesClassification,Status: - value: classification,status - summary: Original Enum Values Classification, Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - classification - - classification,status - - status - description: 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) - examples: - OriginalEnumValuesClassification,Status: - value: classification,status - summary: Original Enum Values Classification, Status - - in: query - name: status - schema: - type: string - nullable: true - enum: - - '' - - ACTIVE - - INACTIVE - - - - PENDING - description: If provided, will only return accounts with this status. - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: accounts_create - description: Creates an `Account` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - accounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AccountEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/AccountEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/AccountEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/accounts/{id}: - get: - operationId: accounts_retrieve - description: Returns an `Account` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - classification - - classification,status - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesClassification,Status: - value: classification,status - summary: Original Enum Values Classification, Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - classification - - classification,status - - status - description: 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) - examples: - OriginalEnumValuesClassification,Status: - value: classification,status - summary: Original Enum Values Classification, Status - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Account' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/accounts/meta/post: - get: - operationId: accounts_meta_post_retrieve - description: Returns metadata for `Account` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/addresses/{id}: - get: - operationId: addresses_retrieve - description: Returns an `Address` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - type - description: 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) - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - tags: - - addresses - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Address' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/async-passthrough: - post: - operationId: async_passthrough_create - description: Asynchronously pull data from an endpoint not currently supported - by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - async-passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncPassthroughReciept' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/async-passthrough/{async_passthrough_receipt_id}: - get: - operationId: async_passthrough_retrieve - description: Retrieves data from earlier async-passthrough POST request - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: async_passthrough_receipt_id - schema: - type: string - format: uuid - required: true - tags: - - async-passthrough - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/RemoteResponse' - - type: string - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/async-tasks/{id}: - get: - operationId: async_tasks_retrieve - description: Returns an `AsyncPostTask` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - required: true - tags: - - async-tasks - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncPostTask' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/attachments: - get: - operationId: attachments_list - description: Returns a list of `AccountingAttachment` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return accounting attachments for this - company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountingAttachmentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: attachments_create - description: Creates an `AccountingAttachment` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - attachments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AccountingAttachmentEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/AccountingAttachmentEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/AccountingAttachmentEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountingAttachmentResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/attachments/{id}: - get: - operationId: attachments_retrieve - description: Returns an `AccountingAttachment` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountingAttachment' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/attachments/meta/post: - get: - operationId: attachments_meta_post_retrieve - description: Returns metadata for `AccountingAttachment` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/audit-trail: - get: - operationId: audit_trail_list - description: Gets a list of audit trail events. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include audit trail events that occurred - before this time - - in: query - name: event_type - schema: - type: string - description: '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`' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include audit trail events that occurred - after this time - - in: query - name: user_email - schema: - type: string - description: 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. - tags: - - audit-trail - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAuditLogEventList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/available-actions: - get: - operationId: available_actions_retrieve - description: Returns a list of models and actions available for an account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - available-actions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AvailableActions' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/balance-sheets: - get: - operationId: balance_sheets_list - description: Returns a list of `BalanceSheet` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return balance sheets for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - balance-sheets - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedBalanceSheetList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/balance-sheets/{id}: - get: - operationId: balance_sheets_retrieve - description: Returns a `BalanceSheet` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - balance-sheets - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BalanceSheet' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/bank-feed-accounts: - get: - operationId: bank_feed_accounts_list - description: Returns a list of `BankFeedAccount` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - bank-feed-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedBankFeedAccountList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - post: - operationId: bank_feed_accounts_create - description: Creates a `BankFeedAccount` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - bank-feed-accounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BankFeedAccountEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/BankFeedAccountEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/BankFeedAccountEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/BankFeedAccountResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/bank-feed-accounts/{id}: - get: - operationId: bank_feed_accounts_retrieve - description: Returns a `BankFeedAccount` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - bank-feed-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BankFeedAccount' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/bank-feed-accounts/meta/post: - get: - operationId: bank_feed_accounts_meta_post_retrieve - description: Returns metadata for `BankFeedAccount` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - bank-feed-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/bank-feed-transactions: - get: - operationId: bank_feed_transactions_list - description: Returns a list of `BankFeedTransaction` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - bank_feed_account - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandBankFeedAccount: - value: bank_feed_account - summary: Expand Bank_feed_account - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_processed - schema: - type: boolean - description: If provided, will only return bank feed transactions with this - is_processed value - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - bank-feed-transactions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedBankFeedTransactionList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - post: - operationId: bank_feed_transactions_create - description: Creates a `BankFeedTransaction` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - bank-feed-transactions - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/BankFeedTransactionEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/BankFeedTransactionEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/BankFeedTransactionEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/BankFeedTransactionResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/bank-feed-transactions/{id}: - get: - operationId: bank_feed_transactions_retrieve - description: Returns a `BankFeedTransaction` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - bank_feed_account - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandBankFeedAccount: - value: bank_feed_account - summary: Expand Bank_feed_account - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - bank-feed-transactions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BankFeedTransaction' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/bank-feed-transactions/meta/post: - get: - operationId: bank_feed_transactions_meta_post_retrieve - description: Returns metadata for `BankFeedTransaction` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - bank-feed-transactions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/cash-flow-statements: - get: - operationId: cash_flow_statements_list - description: Returns a list of `CashFlowStatement` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return cash flow statements for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - cash-flow-statements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCashFlowStatementList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/cash-flow-statements/{id}: - get: - operationId: cash_flow_statements_retrieve - description: Returns a `CashFlowStatement` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - cash-flow-statements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CashFlowStatement' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/company-info: - get: - operationId: company_info_list - description: Returns a list of `CompanyInfo` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - addresses - - phone_numbers - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAddresses,PhoneNumbers: - value: addresses,phone_numbers - summary: Expand Addresses, Phone_numbers - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - company-info - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCompanyInfoList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/company-info/{id}: - get: - operationId: company_info_retrieve - description: Returns a `CompanyInfo` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - addresses - - phone_numbers - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAddresses,PhoneNumbers: - value: addresses,phone_numbers - summary: Expand Addresses, Phone_numbers - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - company-info - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CompanyInfo' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/contacts: - get: - operationId: contacts_list - description: Returns a list of `Contact` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return contacts for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email_address - schema: - type: string - nullable: true - description: If provided, will only return Contacts that match this email. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - addresses - - company - - phone_numbers - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAddresses,PhoneNumbers,Company: - value: addresses,phone_numbers,company - summary: Expand Addresses, Phone_numbers, Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_customer - schema: - type: string - description: If provided, will only return Contacts that are denoted as customers. - - in: query - name: is_supplier - schema: - type: string - description: If provided, will only return Contacts that are denoted as suppliers. - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return Contacts that match this name. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: status - schema: - type: string - nullable: true - enum: - - '' - - ACTIVE - - ARCHIVED - - - description: If provided, will only return Contacts that match this status. - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedContactList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: contacts_create - description: Creates a `Contact` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - contacts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ContactEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ContactEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ContactEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ContactResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/contacts/{id}: - get: - operationId: contacts_retrieve - description: Returns a `Contact` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - addresses - - company - - phone_numbers - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAddresses,PhoneNumbers,Company: - value: addresses,phone_numbers,company - summary: Expand Addresses, Phone_numbers, Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Contact' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/contacts/meta/post: - get: - operationId: contacts_meta_post_retrieve - description: Returns metadata for `Contact` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/contacts/remote-field-classes: - get: - operationId: contacts_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/credit-notes: - get: - operationId: credit_notes_list - description: Returns a list of `CreditNote` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return credit notes for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - applied_payments - - company - - contact - - line_items - - payments - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPayments,AppliedPayments,LineItems,TrackingCategories,Contact,Company,AccountingPeriod: - value: - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period - summary: Expand Payments, Applied_payments, Line_items, Tracking_categories, - Contact, Company, Accounting_period - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - - status,type - - type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus,Type: - value: status,type - summary: Original Enum Values Status, Type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - - status,type - - type - description: 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) - examples: - OriginalEnumValuesStatus,Type: - value: status,type - summary: Original Enum Values Status, Type - - in: query - name: transaction_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: transaction_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - tags: - - credit-notes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCreditNoteList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: credit_notes_create - description: Creates a `CreditNote` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - credit-notes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreditNoteEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreditNoteEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreditNoteEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CreditNoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/credit-notes/{id}: - get: - operationId: credit_notes_retrieve - description: Returns a `CreditNote` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - applied_payments - - company - - contact - - line_items - - payments - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPayments,AppliedPayments,LineItems,TrackingCategories,Contact,Company,AccountingPeriod: - value: - payments,applied_payments,line_items,tracking_categories,contact,company,accounting_period - summary: Expand Payments, Applied_payments, Line_items, Tracking_categories, - Contact, Company, Accounting_period - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - - status,type - - type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus,Type: - value: status,type - summary: Original Enum Values Status, Type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - - status,type - - type - description: 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) - examples: - OriginalEnumValuesStatus,Type: - value: status,type - summary: Original Enum Values Status, Type - tags: - - credit-notes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CreditNote' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/credit-notes/meta/post: - get: - operationId: credit_notes_meta_post_retrieve - description: Returns metadata for `CreditNote` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - credit-notes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/default-scopes: - get: - operationId: default_scopes_retrieve - description: 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). - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/delete-account: - post: - operationId: delete_account_delete - description: Delete a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - delete-account - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/employees: - get: - operationId: employees_list - description: Returns a list of `Employee` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - employees - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEmployeeList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/employees/{id}: - get: - operationId: employees_retrieve - description: Returns an `Employee` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - employees - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Employee' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/expenses: - get: - operationId: expenses_list - description: Returns a list of `Expense` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return expenses for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - accounting_period - - company - - contact - - employee - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTrackingCategories,Account,Contact,Company,Employee,AccountingPeriod: - value: tracking_categories,account,contact,company,employee,accounting_period - summary: Expand Tracking_categories, Account, Contact, Company, Employee, - Accounting_period - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: transaction_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: transaction_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - tags: - - expenses - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedExpenseList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: expenses_create - description: Creates an `Expense` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - expenses - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ExpenseEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ExpenseEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ExpenseEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ExpenseResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/expenses/{id}: - get: - operationId: expenses_retrieve - description: Returns an `Expense` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - accounting_period - - company - - contact - - employee - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTrackingCategories,Account,Contact,Company,Employee,AccountingPeriod: - value: tracking_categories,account,contact,company,employee,accounting_period - summary: Expand Tracking_categories, Account, Contact, Company, Employee, - Accounting_period - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - expenses - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Expense' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/expenses/lines/remote-field-classes: - get: - operationId: expenses_lines_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - expenses - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/expenses/meta/post: - get: - operationId: expenses_meta_post_retrieve - description: Returns metadata for `Expense` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - expenses - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/expenses/remote-field-classes: - get: - operationId: expenses_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - expenses - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/field-mappings: - get: - operationId: field_mappings_retrieve - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingApiInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: field_mappings_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/field-mappings/{field_mapping_id}: - patch: - operationId: field_mappings_partial_update - 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - delete: - operationId: field_mappings_destroy - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '204': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/general-ledger-transactions: - get: - operationId: general_ledger_transactions_list - description: Returns a list of `GeneralLedgerTransaction` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return general ledger transactions for - this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - company - - general_ledger_transaction_lines - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTrackingCategories,GeneralLedgerTransactionLines,Company,AccountingPeriod: - value: tracking_categories,general_ledger_transaction_lines,company,accounting_period - summary: Expand Tracking_categories, General_ledger_transaction_lines, - Company, Accounting_period - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: posted_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects posted after this datetime. - - in: query - name: posted_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects posted before this datetime. - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - general-ledger-transactions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedGeneralLedgerTransactionList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/general-ledger-transactions/{id}: - get: - operationId: general_ledger_transactions_retrieve - description: Returns a `GeneralLedgerTransaction` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - company - - general_ledger_transaction_lines - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTrackingCategories,GeneralLedgerTransactionLines,Company,AccountingPeriod: - value: tracking_categories,general_ledger_transaction_lines,company,accounting_period - summary: Expand Tracking_categories, General_ledger_transaction_lines, - Company, Accounting_period - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - general-ledger-transactions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/GeneralLedgerTransaction' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/generate-key: - post: - operationId: generate_key_create - description: Create a remote key. - tags: - - generate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/income-statements: - get: - operationId: income_statements_list - description: Returns a list of `IncomeStatement` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return income statements for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - income-statements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedIncomeStatementList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/income-statements/{id}: - get: - operationId: income_statements_retrieve - description: Returns an `IncomeStatement` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - income-statements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/IncomeStatement' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/invoices: - get: - operationId: invoices_list - description: Returns a list of `Invoice` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return invoices for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: contact_id - schema: - type: string - description: If provided, will only return invoices for this contact. - examples: - ContactId: - summary: contact_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - applied_credit_notes - - applied_payments - - applied_vendor_credits - - company - - contact - - employee - - line_items - - payment_term - - payments - - purchase_orders - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ? ExpandPayments,AppliedPayments,LineItems,TrackingCategories,PurchaseOrders,AppliedCreditNotes,AppliedVendorCredits,Contact,Company,Employee,AccountingPeriod,PaymentTerm - : value: - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - summary: Expand Payments, Applied_payments, Line_items, Tracking_categories, - Purchase_orders, Applied_credit_notes, Applied_vendor_credits, Contact, - Company, Employee, Accounting_period, Payment_term - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: issue_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: issue_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: number - schema: - type: string - nullable: true - description: If provided, will only return Invoices with this number. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - type - description: 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) - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - - in: query - name: status - schema: - type: string - nullable: true - enum: - - DRAFT - - OPEN - - PAID - - PARTIALLY_PAID - - SUBMITTED - - VOID - description: |- - If provided, will only return Invoices with this status. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - - in: query - name: type - schema: - type: string - nullable: true - enum: - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - description: |- - If provided, will only return Invoices with this type. - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - tags: - - invoices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedInvoiceList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: invoices_create - description: "Creates an `Invoice` object with the given values.\n \ - \ Including a `PurchaseOrder` id in the `purchase_orders` property will - generate an Accounts Payable Invoice from the specified Purchase Order(s).\n\ - \ " - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - invoices - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InvoiceEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/InvoiceEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/InvoiceEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/InvoiceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/invoices/{id}: - get: - operationId: invoices_retrieve - description: Returns an `Invoice` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - applied_credit_notes - - applied_payments - - applied_vendor_credits - - company - - contact - - employee - - line_items - - payment_term - - payments - - purchase_orders - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ? ExpandPayments,AppliedPayments,LineItems,TrackingCategories,PurchaseOrders,AppliedCreditNotes,AppliedVendorCredits,Contact,Company,Employee,AccountingPeriod,PaymentTerm - : value: - payments,applied_payments,line_items,tracking_categories,purchase_orders,applied_credit_notes,applied_vendor_credits,contact,company,employee,accounting_period,payment_term - summary: Expand Payments, Applied_payments, Line_items, Tracking_categories, - Purchase_orders, Applied_credit_notes, Applied_vendor_credits, Contact, - Company, Employee, Accounting_period, Payment_term - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - type - description: 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) - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - tags: - - invoices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Invoice' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: invoices_partial_update - description: Updates an `Invoice` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - invoices - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedInvoiceEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedInvoiceEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedInvoiceEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/InvoiceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/invoices/line-items/remote-field-classes: - get: - operationId: invoices_line_items_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - invoices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/invoices/meta/patch/{id}: - get: - operationId: invoices_meta_patch_retrieve - description: Returns metadata for `Invoice` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - invoices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/invoices/meta/post: - get: - operationId: invoices_meta_post_retrieve - description: Returns metadata for `Invoice` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - invoices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/invoices/remote-field-classes: - get: - operationId: invoices_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - invoices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/issues: - get: - operationId: issues_list - description: Gets all issues for Organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: account_token - schema: - type: string - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred before this time - - in: query - name: end_user_organization_name - schema: - type: string - - in: query - name: first_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was after this datetime. - - in: query - name: first_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was before this datetime. - - in: query - name: include_muted - schema: - type: string - description: If true, will include muted issues - - in: query - name: integration_name - schema: - type: string - - in: query - name: last_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was after this datetime. - - in: query - name: last_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was before this datetime. - - in: query - name: linked_account_id - schema: - type: string - description: If provided, will only include issues pertaining to the linked - account passed in. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred after this time - - in: query - name: status - schema: - type: string - enum: - - ONGOING - - RESOLVED - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedIssueList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/issues/{id}: - get: - operationId: issues_retrieve - description: Get a specific issue. - parameters: - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Issue' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/items: - get: - operationId: items_list - description: Returns a list of `Item` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return items for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - - purchase_account - - purchase_tax_rate - - sales_account - - sales_tax_rate - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPurchaseAccount,SalesAccount,Company,SalesTaxRate,PurchaseTaxRate: - value: purchase_account,sales_account,company,sales_tax_rate,purchase_tax_rate - summary: Expand Purchase_account, Sales_account, Company, Sales_tax_rate, - Purchase_tax_rate - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - items - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedItemList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: items_create - description: Creates an `Item` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - items - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ItemEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ItemEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ItemEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ItemResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/items/{id}: - get: - operationId: items_retrieve - description: Returns an `Item` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - - purchase_account - - purchase_tax_rate - - sales_account - - sales_tax_rate - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPurchaseAccount,SalesAccount,Company,SalesTaxRate,PurchaseTaxRate: - value: purchase_account,sales_account,company,sales_tax_rate,purchase_tax_rate - summary: Expand Purchase_account, Sales_account, Company, Sales_tax_rate, - Purchase_tax_rate - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - items - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Item' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: items_partial_update - description: Updates an `Item` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - items - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedItemEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedItemEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedItemEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ItemResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/items/meta/patch/{id}: - get: - operationId: items_meta_patch_retrieve - description: Returns metadata for `Item` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - items - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/items/meta/post: - get: - operationId: items_meta_post_retrieve - description: Returns metadata for `Item` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - items - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/journal-entries: - get: - operationId: journal_entries_list - description: Returns a list of `JournalEntry` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return journal entries for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - applied_payments - - company - - lines - - payments - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLines,Payments,AppliedPayments,TrackingCategories,Company,AccountingPeriod: - value: lines,payments,applied_payments,tracking_categories,company,accounting_period - summary: Expand Lines, Payments, Applied_payments, Tracking_categories, - Company, Accounting_period - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: transaction_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: transaction_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - tags: - - journal-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedJournalEntryList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: journal_entries_create - description: Creates a `JournalEntry` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - journal-entries - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JournalEntryEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/JournalEntryEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/JournalEntryEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/JournalEntryResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/journal-entries/{id}: - get: - operationId: journal_entries_retrieve - description: Returns a `JournalEntry` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - applied_payments - - company - - lines - - payments - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLines,Payments,AppliedPayments,TrackingCategories,Company,AccountingPeriod: - value: lines,payments,applied_payments,tracking_categories,company,accounting_period - summary: Expand Lines, Payments, Applied_payments, Tracking_categories, - Company, Accounting_period - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - journal-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/JournalEntry' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/journal-entries/lines/remote-field-classes: - get: - operationId: journal_entries_lines_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - journal-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/journal-entries/meta/post: - get: - operationId: journal_entries_meta_post_retrieve - description: Returns metadata for `JournalEntry` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - journal-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/journal-entries/remote-field-classes: - get: - operationId: journal_entries_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - journal-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/link-token: - post: - operationId: link_token_create - description: Creates a link token to be used when linking a new end user. - tags: - - link-token - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LinkToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/linked-account-scopes: - get: - operationId: linked_account_scopes_retrieve - 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). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: linked_account_scopes_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/linked-accounts: - get: - operationId: linked_accounts_list - description: List linked accounts for your organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: category - schema: - type: string - nullable: true - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - description: |- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` - - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_user_email_address - schema: - type: string - description: If provided, will only return linked accounts associated with - the given email address. - - in: query - name: end_user_organization_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given organization name. - - in: query - name: end_user_origin_id - schema: - type: string - description: If provided, will only return linked accounts associated with - the given origin ID. - - in: query - name: end_user_origin_ids - schema: - type: string - description: Comma-separated list of EndUser origin IDs, making it possible - to specify multiple EndUsers at once. - - in: query - name: id - schema: - type: string - format: uuid - - in: query - name: ids - schema: - type: string - description: Comma-separated list of LinkedAccount IDs, making it possible - to specify multiple LinkedAccounts at once. - - in: query - name: include_duplicates - schema: - type: boolean - description: 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. - - in: query - name: integration_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given integration name. - - in: query - name: is_test_account - schema: - type: string - description: If included, will only include test linked accounts. If not included, - will only include non-test linked accounts. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: status - schema: - type: string - description: 'Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, - `RELINK_NEEDED`' - tags: - - linked-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountDetailsAndActionsList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/passthrough: - post: - operationId: passthrough_create - description: Pull data from an endpoint not currently supported by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/payment-methods: - get: - operationId: payment_methods_list - description: Returns a list of `PaymentMethod` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - payment-methods - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedPaymentMethodList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/payment-methods/{id}: - get: - operationId: payment_methods_retrieve - description: Returns a `PaymentMethod` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - payment-methods - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaymentMethod' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/payment-terms: - get: - operationId: payment_terms_list - description: Returns a list of `PaymentTerm` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - payment-terms - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedPaymentTermList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/payment-terms/{id}: - get: - operationId: payment_terms_retrieve - description: Returns a `PaymentTerm` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - payment-terms - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaymentTerm' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/payments: - get: - operationId: payments_list - description: Returns a list of `Payment` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: account_id - schema: - type: string - description: If provided, will only return payments for this account. - examples: - AccountId: - summary: account_id - - in: query - name: company_id - schema: - type: string - description: If provided, will only return payments for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: contact_id - schema: - type: string - description: If provided, will only return payments for this contact. - examples: - ContactId: - summary: contact_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - accounting_period - - applied_to_lines - - company - - contact - - payment_method - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTrackingCategories,AppliedToLines,Contact,Account,Company,AccountingPeriod,PaymentMethod: - value: - tracking_categories,applied_to_lines,contact,account,company,accounting_period,payment_method - summary: Expand Tracking_categories, Applied_to_lines, Contact, Account, - Company, Accounting_period, Payment_method - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: transaction_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: transaction_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - tags: - - payments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedPaymentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: payments_create - description: Creates a `Payment` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - payments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PaymentEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PaymentEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PaymentEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/PaymentResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/payments/{id}: - get: - operationId: payments_retrieve - description: Returns a `Payment` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - accounting_period - - applied_to_lines - - company - - contact - - payment_method - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTrackingCategories,AppliedToLines,Contact,Account,Company,AccountingPeriod,PaymentMethod: - value: - tracking_categories,applied_to_lines,contact,account,company,accounting_period,payment_method - summary: Expand Tracking_categories, Applied_to_lines, Contact, Account, - Company, Accounting_period, Payment_method - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - payments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Payment' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: payments_partial_update - description: Updates a `Payment` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - payments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedPaymentEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedPaymentEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedPaymentEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaymentResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/payments/line-items/remote-field-classes: - get: - operationId: payments_line_items_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - payments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/payments/meta/patch/{id}: - get: - operationId: payments_meta_patch_retrieve - description: Returns metadata for `Payment` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - payments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/payments/meta/post: - get: - operationId: payments_meta_post_retrieve - description: Returns metadata for `Payment` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - payments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/payments/remote-field-classes: - get: - operationId: payments_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - payments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/phone-numbers/{id}: - get: - operationId: phone_numbers_retrieve - description: Returns an `AccountingPhoneNumber` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - phone-numbers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountingPhoneNumber' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/projects: - get: - operationId: projects_list - description: Returns a list of `Project` objects. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - - contact - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany,Contact: - value: company,contact - summary: Expand Company, Contact - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - projects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProjectList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/projects/{id}: - get: - operationId: projects_retrieve - description: Returns a `Project` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - - contact - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany,Contact: - value: company,contact - summary: Expand Company, Contact - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - projects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Project' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/purchase-orders: - get: - operationId: purchase_orders_list - description: Returns a list of `PurchaseOrder` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return purchase orders for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - company - - delivery_address - - line_items - - payment_term - - tracking_categories - - vendor - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLineItems,TrackingCategories,DeliveryAddress,Vendor,Company,AccountingPeriod,PaymentTerm: - value: - line_items,tracking_categories,delivery_address,vendor,company,accounting_period,payment_term - summary: Expand Line_items, Tracking_categories, Delivery_address, Vendor, - Company, Accounting_period, Payment_term - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: issue_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: issue_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - purchase-orders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedPurchaseOrderList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: purchase_orders_create - description: Creates a `PurchaseOrder` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - purchase-orders - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseOrderEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PurchaseOrderEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PurchaseOrderEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseOrderResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/purchase-orders/{id}: - get: - operationId: purchase_orders_retrieve - description: Returns a `PurchaseOrder` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - company - - delivery_address - - line_items - - payment_term - - tracking_categories - - vendor - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLineItems,TrackingCategories,DeliveryAddress,Vendor,Company,AccountingPeriod,PaymentTerm: - value: - line_items,tracking_categories,delivery_address,vendor,company,accounting_period,payment_term - summary: Expand Line_items, Tracking_categories, Delivery_address, Vendor, - Company, Accounting_period, Payment_term - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - purchase-orders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PurchaseOrder' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/purchase-orders/line-items/remote-field-classes: - get: - operationId: purchase_orders_line_items_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - purchase-orders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/purchase-orders/meta/post: - get: - operationId: purchase_orders_meta_post_retrieve - description: Returns metadata for `PurchaseOrder` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - purchase-orders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/purchase-orders/remote-field-classes: - get: - operationId: purchase_orders_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - purchase-orders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/regenerate-key: - post: - operationId: regenerate_key_create - description: Exchange remote keys. - tags: - - regenerate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/remote-fields: - get: - operationId: 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: common_models - schema: - type: string - description: A comma seperated list of Common Model names. If included, will - only return Remote Fields for those Common Models. - - in: query - name: include_example_values - schema: - type: string - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/sync-status: - get: - operationId: 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). - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - sync-status - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedSyncStatusList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/sync-status/resync: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - force-resync - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/target-fields: - get: - operationId: target_fields_retrieve - 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalTargetFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/tax-rates: - get: - operationId: tax_rates_list - description: Returns a list of `TaxRate` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return tax rates for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return TaxRates with this name. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - tax-rates - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTaxRateList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/tax-rates/{id}: - get: - operationId: tax_rates_retrieve - description: Returns a `TaxRate` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - tax-rates - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TaxRate' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /accounting/v1/tracking-categories: - get: - operationId: tracking_categories_list - description: Returns a list of `TrackingCategory` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: category_type - schema: - type: string - nullable: true - enum: - - '' - - CLASS - - DEPARTMENT - - - description: If provided, will only return tracking categories with this type. - - in: query - name: company_id - schema: - type: string - description: If provided, will only return tracking categories for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return tracking categories with this name. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: status - schema: - type: string - nullable: true - enum: - - '' - - ACTIVE - - ARCHIVED - - - description: If provided, will only return tracking categories with this status. - tags: - - tracking-categories - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTrackingCategoryList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/tracking-categories/{id}: - get: - operationId: tracking_categories_retrieve - description: Returns a `TrackingCategory` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCompany: - value: company - summary: Expand Company - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - tracking-categories - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TrackingCategory' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/transactions: - get: - operationId: transactions_list - description: Returns a list of `Transaction` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return accounting transactions for this - company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - accounting_period - - contact - - line_items - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLineItems,TrackingCategories,Contact,Account,AccountingPeriod: - value: line_items,tracking_categories,contact,account,accounting_period - summary: Expand Line_items, Tracking_categories, Contact, Account, Accounting_period - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: transaction_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: transaction_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - tags: - - transactions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTransactionList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/transactions/{id}: - get: - operationId: transactions_retrieve - description: Returns a `Transaction` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - accounting_period - - contact - - line_items - - tracking_categories - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLineItems,TrackingCategories,Contact,Account,AccountingPeriod: - value: line_items,tracking_categories,contact,account,accounting_period - summary: Expand Line_items, Tracking_categories, Contact, Account, Accounting_period - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - transactions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Transaction' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/vendor-credits: - get: - operationId: vendor_credits_list - description: Returns a list of `VendorCredit` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return vendor credits for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - company - - lines - - tracking_categories - - vendor - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLines,TrackingCategories,Vendor,Company,AccountingPeriod: - value: lines,tracking_categories,vendor,company,accounting_period - summary: Expand Lines, Tracking_categories, Vendor, Company, Accounting_period - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: transaction_date_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created after this datetime. - - in: query - name: transaction_date_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return objects created before this datetime. - tags: - - vendor-credits - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedVendorCreditList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: vendor_credits_create - description: Creates a `VendorCredit` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - vendor-credits - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/VendorCreditEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/VendorCreditEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/VendorCreditEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/VendorCreditResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/vendor-credits/{id}: - get: - operationId: vendor_credits_retrieve - description: Returns a `VendorCredit` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - accounting_period - - company - - lines - - tracking_categories - - vendor - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandLines,TrackingCategories,Vendor,Company,AccountingPeriod: - value: lines,tracking_categories,vendor,company,accounting_period - summary: Expand Lines, Tracking_categories, Vendor, Company, Accounting_period - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - vendor-credits - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/VendorCredit' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/vendor-credits/meta/post: - get: - operationId: vendor_credits_meta_post_retrieve - description: Returns metadata for `VendorCredit` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - vendor-credits - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /accounting/v1/webhook-receivers: - get: - operationId: webhook_receivers_list - description: Returns a list of `WebhookReceiver` objects. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: webhook_receivers_create - description: Creates a `WebhookReceiver` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC -components: - schemas: - Account: - type: object - description: |- - # The Account Object - ### Description - An `Account` represents a category in a company’s ledger in which a financial transaction is recorded against. The aggregation of each `Account` object is often referred to as the **Chart of Accounts**. - - An `Account` can be classified into one of the following categories, determined through the `classification` field: - * __Asset:__ Accounts Receivable and Bank Accounts - * __Liability:__ Accounts Payable and Credit Card Accounts - * __Equity:__ Treasury Accounts and Retained Earnings - * __Revenue:__ Income and Other Income - * __Expense:__ Cost of Goods Sold and Office Expenses - - ### Usage Example - Fetch from the `LIST Accounts` endpoint and view a company's accounts. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '21' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The account's name. - example: Cash - description: - type: string - nullable: true - description: The account's description. - example: Cash - classification: - oneOf: - - $ref: '#/components/schemas/ClassificationEnum' - - type: string - nullable: true - description: |- - The account's broadest grouping. - - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - example: ASSET - type: - type: string - nullable: true - description: The account's type is a narrower and more specific grouping - within the account's classification. - example: Asset - account_type: - oneOf: - - $ref: '#/components/schemas/AccountAccountTypeEnum' - - type: string - nullable: true - description: |- - Normalized account type- which is a narrower and more specific grouping within the account's classification. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `FIXED_ASSET` - FIXED_ASSET - * `OTHER_ASSET` - OTHER_ASSET - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - * `OTHER_EXPENSE` - OTHER_EXPENSE - * `OTHER_INCOME` - OTHER_INCOME - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - * `NON_POSTING` - NON_POSTING - example: FIXED_ASSET - status: - oneOf: - - $ref: '#/components/schemas/AccountStatusEnum' - - type: string - nullable: true - description: |- - The account's status. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - example: ACTIVE - current_balance: - type: number - format: double - nullable: true - description: The account's current balance. - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The account's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - account_number: - type: string - nullable: true - description: The account's number. - example: X12Y9AB - parent_account: - type: string - format: uuid - nullable: true - description: ID of the parent account. - example: 22d92d6c-22f9-11ed-861d-0242ac120002 - company: - type: string - format: uuid - nullable: true - description: The company the account belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-model-tooltip: - title: Looking for __Bank Accounts__? - content: Bank Accounts are represented as an __Account__ with a `classification` - of __ASSET__. - x-merge-expands: '{"owner": "User"}' - x-merge-category: accounting - AccountAccountTypeEnum: - enum: - - BANK - - CREDIT_CARD - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - - FIXED_ASSET - - OTHER_ASSET - - OTHER_CURRENT_ASSET - - OTHER_EXPENSE - - OTHER_INCOME - - COST_OF_GOODS_SOLD - - OTHER_CURRENT_LIABILITY - - LONG_TERM_LIABILITY - - NON_POSTING - type: string - description: |- - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `FIXED_ASSET` - FIXED_ASSET - * `OTHER_ASSET` - OTHER_ASSET - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - * `OTHER_EXPENSE` - OTHER_EXPENSE - * `OTHER_INCOME` - OTHER_INCOME - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - * `NON_POSTING` - NON_POSTING - x-merge-category: accounting - AccountDetails: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - integration: - type: string - readOnly: true - example: BambooHR - integration_slug: - type: string - readOnly: true - example: bamboohr - category: - allOf: - - $ref: '#/components/schemas/CategoryEnum' - nullable: true - example: hris - end_user_origin_id: - type: string - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - end_user_organization_name: - type: string - readOnly: true - example: Waystar Royco - end_user_email_address: - type: string - format: email - readOnly: true - example: kendall.roy@waystar-royco.com - status: - type: string - readOnly: true - example: COMPLETE - webhook_listener_url: - type: string - format: uri - readOnly: true - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - readOnly: true - description: 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. - example: true - account_type: - type: string - readOnly: true - example: PRODUCTION - completed_at: - type: string - format: date-time - nullable: true - description: The time at which account completes the linking flow. - example: '2024-08-26T20:11:19.277118Z' - x-merge-category: accounting - AccountDetailsAndActions: - type: object - description: |- - # 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: - type: string - example: e59b1821-f85c-4e28-a6b3-1804156f3563 - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - example: hris - status: - oneOf: - - $ref: '#/components/schemas/AccountDetailsAndActionsStatusEnum' - - type: string - example: INCOMPLETE - status_detail: - type: string - example: Invalid login credentials - end_user_origin_id: - type: string - example: 3ac95cde-6c7f-4eef-afec-be710b42308d - end_user_organization_name: - type: string - example: Foo Bar, LLC - end_user_email_address: - type: string - example: hradmin@foobar.dev - subdomain: - type: string - description: The tenant or domain the customer has provided access to. - example: foobar - webhook_listener_url: - type: string - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - description: 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. - example: true - integration: - $ref: '#/components/schemas/AccountDetailsAndActionsIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - 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: - type: string - example: PRODUCTION - completed_at: - type: string - format: date-time - example: '2024-08-26T20:11:19.277118Z' - required: - - account_type - - completed_at - - end_user_email_address - - end_user_organization_name - - id - - status - - webhook_listener_url - x-merge-sample-json: '{"id": "e59b1821-f85c-4e28-a6b3-1804156f3563", "category": - "hris", "status": "INCOMPLETE", "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", "webhook_listener_url": - "https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4", - "is_duplicate": true, "integration": {"name": "SAP SuccessFactors", "categories": - ["hris", "ats"], "image": "https://cdn.merge.dev/SuccessFactors_Logo.png", - "square_image": "https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg", "color": - "#F6A704", "slug": "sap-successfactors", "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"]}]}}' - x-merge-category: accounting - AccountDetailsAndActionsIntegration: - type: object - properties: - name: - type: string - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - image: - type: string - square_image: - type: string - color: - type: string - slug: - type: string - passthrough_available: - type: boolean - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - required: - - categories - - color - - name - - passthrough_available - - slug - x-merge-category: accounting - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - type: string - description: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - x-merge-category: accounting - AccountEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/AccountRequest' - required: - - model - x-merge-category: accounting - AccountIntegration: - type: object - properties: - name: - type: string - description: Company name. - abbreviated_name: - type: string - nullable: true - description: "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: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: Category or categories this integration belongs to. Multiple - categories should be comma separated, i.e. [ats, hris]. - readOnly: true - image: - type: string - format: uri - nullable: true - description: Company logo in rectangular shape. - square_image: - type: string - format: uri - nullable: true - description: Company logo in square shape. - color: - type: string - description: The color of this integration used for buttons and text throughout - the app and landing pages. Choose a darker, saturated color. - pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ - maxLength: 18 - slug: - type: string - readOnly: true - api_endpoints_to_documentation_urls: - type: object - additionalProperties: {} - description: "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: string - nullable: true - description: Setup guide URL for third party webhook creation. Exposed in - Merge Docs. - category_beta_status: - type: object - description: Category or categories this integration is in beta status for. - readOnly: true - required: - - name - x-merge-category: accounting - AccountRequest: - type: object - description: |- - # The Account Object - ### Description - An `Account` represents a category in a company’s ledger in which a financial transaction is recorded against. The aggregation of each `Account` object is often referred to as the **Chart of Accounts**. - - An `Account` can be classified into one of the following categories, determined through the `classification` field: - * __Asset:__ Accounts Receivable and Bank Accounts - * __Liability:__ Accounts Payable and Credit Card Accounts - * __Equity:__ Treasury Accounts and Retained Earnings - * __Revenue:__ Income and Other Income - * __Expense:__ Cost of Goods Sold and Office Expenses - - ### Usage Example - Fetch from the `LIST Accounts` endpoint and view a company's accounts. - properties: - name: - type: string - nullable: true - description: The account's name. - example: Cash - description: - type: string - nullable: true - description: The account's description. - example: Cash - classification: - oneOf: - - $ref: '#/components/schemas/ClassificationEnum' - - type: string - nullable: true - description: |- - The account's broadest grouping. - - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - example: ASSET - type: - type: string - nullable: true - description: The account's type is a narrower and more specific grouping - within the account's classification. - example: Asset - account_type: - oneOf: - - $ref: '#/components/schemas/AccountAccountTypeEnum' - - type: string - nullable: true - description: |- - Normalized account type- which is a narrower and more specific grouping within the account's classification. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `FIXED_ASSET` - FIXED_ASSET - * `OTHER_ASSET` - OTHER_ASSET - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - * `OTHER_EXPENSE` - OTHER_EXPENSE - * `OTHER_INCOME` - OTHER_INCOME - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - * `NON_POSTING` - NON_POSTING - example: FIXED_ASSET - status: - oneOf: - - $ref: '#/components/schemas/AccountStatusEnum' - - type: string - nullable: true - description: |- - The account's status. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - example: ACTIVE - current_balance: - type: number - format: double - nullable: true - description: The account's current balance. - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The account's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - account_number: - type: string - nullable: true - description: The account's number. - example: X12Y9AB - parent_account: - type: string - format: uuid - nullable: true - description: ID of the parent account. - example: 22d92d6c-22f9-11ed-861d-0242ac120002 - company: - type: string - format: uuid - nullable: true - description: The company the account belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-model-tooltip: - title: Looking for __Bank Accounts__? - content: Bank Accounts are represented as an __Account__ with a `classification` - of __ASSET__. - x-merge-expands: '{"owner": "User"}' - x-merge-category: accounting - AccountResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Account' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - AccountStatusEnum: - enum: - - ACTIVE - - PENDING - - INACTIVE - type: string - description: |- - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - x-merge-category: accounting - AccountToken: - type: object - properties: - account_token: - type: string - example: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB - integration: - $ref: '#/components/schemas/AccountIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - id: - type: string - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - required: - - account_token - - id - - integration - x-merge-category: accounting - AccountingAttachment: - type: object - description: |- - # The Accounting Attachment Object - ### Description - The `AccountingAttachment` object is used to represent a company's attachments. - - ### Usage Example - Fetch from the `LIST AccountingAttachments` endpoint and view a company's attachments. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '1018270' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - file_name: - type: string - nullable: true - description: The attachment's name. - example: invoice.png - file_url: - type: string - format: uri - nullable: true - maxLength: 2000 - example: https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png - description: The attachment's url. - company: - type: string - format: uuid - nullable: true - description: The company the accounting attachment belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-category: accounting - AccountingAttachmentEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/AccountingAttachmentRequest' - required: - - model - x-merge-category: accounting - AccountingAttachmentRequest: - type: object - description: |- - # The Accounting Attachment Object - ### Description - The `AccountingAttachment` object is used to represent a company's attachments. - - ### Usage Example - Fetch from the `LIST AccountingAttachments` endpoint and view a company's attachments. - properties: - file_name: - type: string - nullable: true - description: The attachment's name. - example: invoice.png - file_url: - type: string - format: uri - nullable: true - maxLength: 2000 - example: https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png - description: The attachment's url. - company: - type: string - format: uuid - nullable: true - description: The company the accounting attachment belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: accounting - AccountingAttachmentResponse: - type: object - properties: - model: - $ref: '#/components/schemas/AccountingAttachment' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - AccountingPeriod: - type: object - description: |- - # The AccountingPeriod Object - ### Description - The `AccountingPeriod` object is used to define a period of time in which events occurred. - - ### Usage Example - Common models like `Invoice` and `Transaction` will have `AccountingPeriod` objects which will denote when they occurred. - properties: - id: - type: string - format: uuid - readOnly: true - example: 3015f7b1-4d01-460d-bfab-02a52d16cbd0 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '2804580' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: Name of the accounting period. - maxLength: 100 - example: April 2020 Financials - status: - oneOf: - - $ref: '#/components/schemas/Status895Enum' - - type: string - nullable: true - example: ACTIVE - start_date: - type: string - format: date-time - nullable: true - description: Beginning date of the period - example: '2020-03-31T00:00:00Z' - end_date: - type: string - format: date-time - nullable: true - description: End date of the period - example: '2020-04-31T00:00:00Z' - field_mappings: - type: object - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-category: accounting - AccountingPhoneNumber: - type: object - description: |- - # The AccountingPhoneNumber Object - ### Description - The `AccountingPhoneNumber` object is used to represent a contact's or company's phone number. - - ### Usage Example - Fetch from the `GET CompanyInfo` endpoint and view the company's phone numbers. - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - number: - type: string - nullable: true - description: The phone number. - example: '+3198675309' - type: - type: string - nullable: true - description: The phone number's type. - example: Mobile - x-merge-category: accounting - AccountingPhoneNumberRequest: - type: object - description: |- - # The AccountingPhoneNumber Object - ### Description - The `AccountingPhoneNumber` object is used to represent a contact's or company's phone number. - - ### Usage Example - Fetch from the `GET CompanyInfo` endpoint and view the company's phone numbers. - properties: - number: - type: string - nullable: true - description: The phone number. - example: '+3198675309' - type: - type: string - nullable: true - description: The phone number's type. - example: Mobile - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: accounting - Address: - type: object - description: |- - # The Address Object - ### Description - The `Address` object is used to represent a contact's or company's address. - - ### Usage Example - Fetch from the `GET CompanyInfo` endpoint and view the company's addresses. - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - type: - oneOf: - - $ref: '#/components/schemas/AddressTypeEnum' - - type: string - nullable: true - description: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - example: SHIPPING - street_1: - type: string - nullable: true - description: Line 1 of the address's street. - example: 2920 Broadway - street_2: - type: string - nullable: true - description: Line 2 of the address's street. - example: 2nd Floor - city: - type: string - nullable: true - description: The address's city. - example: New York - state: - nullable: true - description: The address's state or region. - readOnly: true - example: NY - country_subdivision: - type: string - nullable: true - description: The address's state or region. - example: NY - country: - oneOf: - - $ref: '#/components/schemas/CountryEnum' - - type: string - nullable: true - description: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - example: US - zip_code: - type: string - nullable: true - description: The address's zip code. - example: '10027' - x-merge-nested-write-allowed: true - x-merge-category: accounting - AddressRequest: - type: object - description: |- - # The Address Object - ### Description - The `Address` object is used to represent a contact's or company's address. - - ### Usage Example - Fetch from the `GET CompanyInfo` endpoint and view the company's addresses. - properties: - type: - oneOf: - - $ref: '#/components/schemas/AddressTypeEnum' - - type: string - nullable: true - description: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - example: SHIPPING - street_1: - type: string - nullable: true - description: Line 1 of the address's street. - example: 2920 Broadway - street_2: - type: string - nullable: true - description: Line 2 of the address's street. - example: 2nd Floor - city: - type: string - nullable: true - description: The address's city. - example: New York - country_subdivision: - type: string - nullable: true - description: The address's state or region. - example: NY - country: - oneOf: - - $ref: '#/components/schemas/CountryEnum' - - type: string - nullable: true - description: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - example: US - zip_code: - type: string - nullable: true - description: The address's zip code. - example: '10027' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: accounting - AddressTypeEnum: - enum: - - BILLING - - SHIPPING - type: string - description: |- - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - x-merge-category: accounting - AdvancedMetadata: - type: object - properties: - id: - type: string - format: uuid - display_name: - type: string - description: - type: string - is_required: - type: boolean - is_custom: - type: boolean - field_choices: - type: array - items: {} - required: - - id - x-merge-category: accounting - AsyncPassthroughReciept: - type: object - properties: - async_passthrough_receipt_id: - type: string - format: uuid - example: fd29020f-2695-445e-922e-dcd5e81903fd - required: - - async_passthrough_receipt_id - x-merge-category: accounting - AsyncPostTask: - type: object - properties: - status: - oneOf: - - $ref: '#/components/schemas/AsyncPostTaskStatusEnum' - - type: string - example: COMPLETED - result: - $ref: '#/components/schemas/AsyncPostTaskResult' - required: - - result - - status - x-merge-category: accounting - AsyncPostTaskResult: - type: object - properties: - status_code: - type: integer - example: 201 - response: - type: object - additionalProperties: {} - example: - model: - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '990110' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - integration_params: - unique_integration_field: unique_integration_field_value - linked_account_params: - unique_linked_account_field: unique_linked_account_field_value - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - type: ACCOUNTS_RECEIVABLE - contact: 022a2bef-57e5-4def-8ed2-7c41bd9a5ed8 - number: AIQ12546 - issue_date: '2020-03-31T00:00:00Z' - due_date: '2020-04-15T00:00:00Z' - memo: Weekly Payment - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - paid_on_date: '2020-04-01T00:00:00Z' - currency: USD - exchange_rate: '2.9' - status: DRAFT - total_discount: 0 - sub_total: 100 - total_tax_amount: 5 - total_amount: 105 - balance: 105 - inclusive_of_tax: false - remote_updated_at: '2020-04-01T00:00:00Z' - tracking_categories: - - 7dc5ca17-d311-44cd-9ce0-333080367a18 - - 6aa0700c-48e1-4c4a-8162-02e6a582df05 - - 8c933d61-8f5b-4360-ac0c-c9dc87bee763 - purchase_orders: - - e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7 - - dd70ca2f-b120-46fa-889a-9604037f45fd - - 889b281d-739c-4759-95b8-0aedb3947131 - accounting_period: 7dc5ca17-d311-44cd-9ce0-333080367a18 - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 9017594e-dc33-4113-a5d2-b0f928e34fdd - line_items: [] - applied_credit_notes: [] - applied_vendor_credits: [] - remote_data: - - path: /actions - data: - - Varies by platform - x-merge-category: accounting - AsyncPostTaskStatusEnum: - enum: - - QUEUED - - IN_PROGRESS - - COMPLETED - - FAILURE - type: string - description: |- - * `QUEUED` - QUEUED - * `IN_PROGRESS` - IN_PROGRESS - * `COMPLETED` - COMPLETED - * `FAILURE` - FAILURE - x-merge-category: accounting - AuditLogEvent: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: b5ceea2a-7171-47ce-8090-165cfce5572c - user_name: - type: string - nullable: true - description: The User's full name at the time of this Event occurring. - maxLength: 200 - example: Gil Feig - user_email: - type: string - format: email - nullable: true - description: The User's email at the time of this Event occurring. - maxLength: 254 - example: hello@merge.dev - role: - oneOf: - - $ref: '#/components/schemas/RoleEnum' - - type: string - description: |- - 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 - example: ADMIN - ip_address: - type: string - maxLength: 45 - example: 192.0.2.123 - event_type: - oneOf: - - $ref: '#/components/schemas/EventTypeEnum' - - type: string - description: |- - 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 - example: CHANGED_SCOPES - event_description: - type: string - example: Organization-wide Scopes for model hris.Employee updated from Read - to Read+Write - created_at: - type: string - format: date-time - readOnly: true - required: - - event_description - - event_type - - ip_address - - role - x-merge-category: accounting - AvailableActions: - type: object - description: |- - # 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: - $ref: '#/components/schemas/AccountIntegration' - example: - name: Lever - categories: - - ats - image: https://merge-api-production.s3.amazonaws.com/media/Lever_Logo.png - square_image: https://merge-api-production.s3.amazonaws.com/media/Lever_Square_Logo.png - color: '#262A34' - is_in_beta: 'true' - api_endpoints_to_documentation_urls: "{'GET': [('/common-model-scopes', - 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve')], - 'POST': []}" - passthrough_available: - type: boolean - example: true - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - example: - - model_name: Candidate - available_operations: - - FETCH - - CREATE - required_post_parameters: - - remote_user_id - supported_fields: - - first_name - - last_name - - company - - title - required: - - integration - - passthrough_available - x-merge-category: accounting - BalanceSheet: - type: object - description: |- - # The BalanceSheet Object - ### Description - The `BalanceSheet` object shows a company’s assets, liabilities, and equity. Assets should be equal to liability and equity combined. This shows the company’s financial health at a specific point in time. - - ### Usage Example - Fetch from the `LIST BalanceSheets` endpoint and view a company's balance sheets. - properties: - id: - type: string - format: uuid - readOnly: true - example: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '8937018' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The balance sheet's name. - example: BalanceSheet - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The balance sheet's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: '`Company` object for the given `BalanceSheet` object.' - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - date: - type: string - format: date-time - nullable: true - description: The balance sheet's date. The balance sheet data will reflect - the company's financial position this point in time. - example: '2021-09-31T00:00:00Z' - net_assets: - type: number - format: double - nullable: true - description: The balance sheet's net assets. - example: 1000 - assets: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '10010' - name: Assets - value: 1000 - sub_items: [] - liabilities: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '10011' - name: Liabilities - value: 500 - sub_items: [] - equity: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '10012' - name: Equity - value: 500 - sub_items: [] - remote_generated_at: - type: string - format: date-time - nullable: true - description: The time that balance sheet was generated by the accounting - system. - example: '2021-10-01T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"company": "CompanyInfo"}' - x-merge-category: accounting - BankFeedAccount: - type: object - description: |- - # The BankFeedAccount Object - ### Description - The `BankFeedAccount` object represents a bank feed account, detailing various attributes including account identifiers, names, currency, and balance information. This object is central to managing and tracking bank feed accounts within the system. - - ### Usage Example - Fetch from the `GET BankFeedAccount` endpoint to view details of a bank feed account. - properties: - id: - type: string - format: uuid - readOnly: true - example: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '987300' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - source_account_id: - type: string - nullable: true - description: The unique identifier of the source account from our customer’s - platform. - maxLength: 1024 - example: '123566909' - target_account_id: - type: string - nullable: true - description: The unique identifier of the target account from the third - party software. - maxLength: 1024 - example: 49cd5a42-b311-4750-9361-52e2ed1d4653 - source_account_name: - type: string - nullable: true - description: The name of the source account as stored in our customer’s - platform. - maxLength: 1024 - example: Travel Bank Account - source_account_number: - type: string - nullable: true - description: The human-readable account number of the source account as - stored in our customer’s platform. - maxLength: 1024 - example: '12567' - target_account_name: - type: string - nullable: true - description: The name of the target account from the third party software. - maxLength: 1024 - example: Netsuite Travel Bank Account - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The currency code of the bank feed. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - feed_status: - oneOf: - - $ref: '#/components/schemas/FeedStatusEnum' - - type: string - nullable: true - description: |- - The status of the bank feed. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - example: ACTIVE - feed_start_date: - type: string - format: date-time - nullable: true - description: The start date of the bank feed’s transactions. - example: '2024-02-02T00:00:00.000Z' - source_account_balance: - type: number - format: double - nullable: true - description: The current balance of funds in the source account. - example: 123.94 - account_type: - oneOf: - - $ref: '#/components/schemas/BankFeedAccountAccountTypeEnum' - - type: string - nullable: true - description: |- - The type of the account. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - example: BANK - remote_was_deleted: - type: boolean - description: 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: - type: object - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - type: object - additionalProperties: {} - nullable: true - description: The full data pulled from the third-party API for an object. - nullable: true - x-merge-category: accounting - BankFeedAccountAccountTypeEnum: - enum: - - BANK - - CREDIT_CARD - type: string - description: |- - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - x-merge-category: accounting - BankFeedAccountEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/BankFeedAccountRequest' - required: - - model - x-merge-category: accounting - BankFeedAccountRequest: - type: object - description: |- - # The BankFeedAccount Object - ### Description - The `BankFeedAccount` object represents a bank feed account, detailing various attributes including account identifiers, names, currency, and balance information. This object is central to managing and tracking bank feed accounts within the system. - - ### Usage Example - Fetch from the `GET BankFeedAccount` endpoint to view details of a bank feed account. - properties: - source_account_id: - type: string - nullable: true - description: The unique identifier of the source account from our customer’s - platform. - maxLength: 1024 - example: '123566909' - target_account_id: - type: string - nullable: true - description: The unique identifier of the target account from the third - party software. - maxLength: 1024 - example: 49cd5a42-b311-4750-9361-52e2ed1d4653 - source_account_name: - type: string - nullable: true - description: The name of the source account as stored in our customer’s - platform. - maxLength: 1024 - example: Travel Bank Account - source_account_number: - type: string - nullable: true - description: The human-readable account number of the source account as - stored in our customer’s platform. - maxLength: 1024 - example: '12567' - target_account_name: - type: string - nullable: true - description: The name of the target account from the third party software. - maxLength: 1024 - example: Netsuite Travel Bank Account - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The currency code of the bank feed. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - feed_status: - oneOf: - - $ref: '#/components/schemas/FeedStatusEnum' - - type: string - nullable: true - description: |- - The status of the bank feed. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - example: ACTIVE - feed_start_date: - type: string - format: date-time - nullable: true - description: The start date of the bank feed’s transactions. - example: '2024-02-02T00:00:00.000Z' - source_account_balance: - type: number - format: double - nullable: true - description: The current balance of funds in the source account. - example: 123.94 - account_type: - oneOf: - - $ref: '#/components/schemas/BankFeedAccountAccountTypeEnum' - - type: string - nullable: true - description: |- - The type of the account. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - example: BANK - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: accounting - BankFeedAccountResponse: - type: object - properties: - model: - $ref: '#/components/schemas/BankFeedAccount' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - BankFeedTransaction: - type: object - description: |- - # The BankFeedTransaction Object - ### Description - The `BankFeedTransaction` object is used to represent transactions linked to a bank feed account. This includes details about the transaction such as the date, amount, description, and type. - - ### Usage Example - Fetch from the `GET BankFeedTransaction` endpoint to view details of a transaction associated with a bank feed account. - properties: - id: - type: string - format: uuid - readOnly: true - example: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '987300' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - bank_feed_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/BankFeedAccount' - nullable: true - description: The bank feed account associated with the transaction. - example: 49cd5a42-b311-4750-9361-52e2ed1d4653 - x-merge-expands-to: BankFeedAccount - transaction_date: - type: string - format: date-time - nullable: true - description: The date that the transaction occurred. - example: '2024-02-02T00:00:00.000Z' - posted_date: - type: string - format: date-time - nullable: true - description: The date the transaction was posted to the bank account. - example: '2024-02-03T00:00:00.000Z' - amount: - type: number - format: double - nullable: true - description: The amount of the transaction. - example: 100.1 - description: - type: string - nullable: true - description: The description of the transaction. - maxLength: 1024 - example: Lunch expense - transaction_type: - type: string - nullable: true - description: The underlying type of the transaction. - maxLength: 1024 - example: payment - payee: - type: string - nullable: true - description: The person or merchant who initiated the transaction, or alternatively, - to whom the transaction was paid. - maxLength: 1024 - example: Elmo's diner - credit_or_debit: - oneOf: - - $ref: '#/components/schemas/CreditOrDebitEnum' - - type: string - nullable: true - description: |- - If the transaction is of type debit or credit. - - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - example: CREDIT - source_transaction_id: - type: string - nullable: true - description: The customer’s identifier for the transaction. - maxLength: 1024 - example: '124569' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - is_processed: - type: boolean - readOnly: true - description: Whether or not this transaction has been processed by the external - system. For example, NetSuite writes this field as True when the SuiteApp - has processed the transaction. - x-merge-expands: '{"bank_feed_account": "BankFeedAccount"}' - x-merge-category: accounting - BankFeedTransactionEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/BankFeedTransactionRequestRequest' - required: - - model - x-merge-category: accounting - BankFeedTransactionRequestRequest: - type: object - description: |- - # The BankFeedTransaction Object - ### Description - The `BankFeedTransaction` object is used to represent transactions linked to a bank feed account. This includes details about the transaction such as the date, amount, description, and type. - - ### Usage Example - Fetch from the `GET BankFeedTransaction` endpoint to view details of a transaction associated with a bank feed account. - properties: - bank_feed_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/BankFeedAccount' - nullable: true - description: The bank feed account associated with the transaction. - example: 49cd5a42-b311-4750-9361-52e2ed1d4653 - x-merge-expands-to: BankFeedAccount - transaction_date: - type: string - format: date-time - nullable: true - description: The date that the transaction occurred. - example: '2024-02-02T00:00:00.000Z' - posted_date: - type: string - format: date-time - nullable: true - description: The date the transaction was posted to the bank account. - example: '2024-02-03T00:00:00.000Z' - amount: - type: number - format: double - nullable: true - description: The amount of the transaction. - example: 100.1 - description: - type: string - nullable: true - description: The description of the transaction. - maxLength: 1024 - example: Lunch expense - transaction_type: - type: string - nullable: true - description: The underlying type of the transaction. - maxLength: 1024 - example: payment - payee: - type: string - nullable: true - description: The person or merchant who initiated the transaction, or alternatively, - to whom the transaction was paid. - maxLength: 1024 - example: Elmo's diner - credit_or_debit: - oneOf: - - $ref: '#/components/schemas/CreditOrDebitEnum' - - type: string - nullable: true - description: |- - If the transaction is of type debit or credit. - - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - example: CREDIT - source_transaction_id: - type: string - nullable: true - description: The customer’s identifier for the transaction. - maxLength: 1024 - example: '124569' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - required: - - bank_feed_account - x-merge-expands: '{"bank_feed_account": "BankFeedAccount"}' - x-merge-category: accounting - BankFeedTransactionResponse: - type: object - properties: - model: - $ref: '#/components/schemas/BankFeedTransaction' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - CashFlowStatement: - type: object - description: |- - # The CashFlowStatement Object - ### Description - The `CashFlowStatement` object shows operating activities, investing activities, and financing activities over a period of time (month, quarter, or year). - - ### Usage Example - Fetch from the `LIST CashFlowStatements` endpoint and view a company's cash flow statements. - properties: - id: - type: string - format: uuid - readOnly: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '8211088' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The cash flow statement's name. - example: CashFlow - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The cash flow statement's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the cash flow statement belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - start_period: - type: string - format: date-time - nullable: true - description: The cash flow statement's start period. - example: '2020-01-01T00:00:00Z' - end_period: - type: string - format: date-time - nullable: true - description: The cash flow statement's end period. - example: '2020-03-31T00:00:00Z' - cash_at_beginning_of_period: - type: number - format: double - nullable: true - description: Cash and cash equivalents at the beginning of the cash flow - statement's period. - example: 5000 - cash_at_end_of_period: - type: number - format: double - nullable: true - description: Cash and cash equivalents at the beginning of the cash flow - statement's period. - example: 4063.52 - operating_activities: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Operating Activities - value: 1000 - sub_items: - - remote_id: '23042938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Net Income - value: 1097.13 - sub_items: [] - company: - investing_activities: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '192406939' - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-11-18T00:00:00Z' - name: Equipment - value: 1000 - sub_items: - - remote_id: - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Equipment - value: 1000 - sub_items: [] - company: - financing_activities: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '192406939' - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-11-15T00:00:00Z' - sub_items: [] - remote_generated_at: - type: string - format: date-time - nullable: true - description: The time that cash flow statement was generated by the accounting - system. - example: '2020-04-01T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"company": "CompanyInfo"}' - x-merge-category: accounting - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: accounting - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: accounting - CategoryTypeEnum: - enum: - - CLASS - - DEPARTMENT - type: string - description: |- - * `CLASS` - CLASS - * `DEPARTMENT` - DEPARTMENT - x-merge-category: accounting - ClassificationEnum: - enum: - - ASSET - - EQUITY - - EXPENSE - - LIABILITY - - REVENUE - type: string - description: |- - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - x-merge-category: accounting - CommonModelScopeAPI: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializer' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: accounting - CommonModelScopesBodyRequest: - type: object - properties: - model_id: - type: string - minLength: 1 - example: hris.Employee - enabled_actions: - type: array - items: - $ref: '#/components/schemas/EnabledActionsEnum' - example: - - READ - - WRITE - disabled_fields: - type: array - items: - type: string - minLength: 1 - example: - - first_name - required: - - disabled_fields - - enabled_actions - - model_id - x-merge-category: accounting - CompanyInfo: - type: object - description: |- - # The CompanyInfo Object - ### Description - The `CompanyInfo` object contains information about the company of the linked account. If the company has multiple entities (also known as subsidiaries), each entity may show up as a single `CompanyInfo` record. - - ### Usage Example - Fetch from the `GET CompanyInfo` endpoint and view a company's information. - properties: - id: - type: string - format: uuid - readOnly: true - example: 65d8ffd0-211b-4ba4-b85a-fbe2ce220982 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The company's name. - example: Merge Pickleball Company - legal_name: - type: string - nullable: true - description: The company's legal name. - example: Merge Pickleball Company Inc. - tax_number: - type: string - nullable: true - description: The company's tax number. - example: 11-0011000 - fiscal_year_end_month: - type: integer - maximum: 12 - minimum: 1 - nullable: true - description: The company's fiscal year end month. - example: 12 - fiscal_year_end_day: - type: integer - maximum: 31 - minimum: 1 - nullable: true - description: The company's fiscal year end day. - example: 31 - currency: - nullable: true - description: |- - The currency set in the company's accounting platform. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's company was created. - example: '2020-03-31T00:00:00Z' - urls: - type: array - items: - type: string - nullable: true - description: The url. - nullable: true - description: The company's urls. - example: https://www.merge.dev - addresses: - type: array - items: - $ref: '#/components/schemas/Address' - example: - - street_1: 2920 Broadway - street_2: 2nd Floor - city: New York - state: NY - country: US - zip_code: '10027' - x-merge-expands-to: Address - phone_numbers: - type: array - items: - $ref: '#/components/schemas/AccountingPhoneNumber' - x-merge-expands-to: AccountingPhoneNumber - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"addresses": "Address", "phone_numbers": "AccountingPhoneNumber"}' - x-merge-category: accounting - ComponentTypeEnum: - enum: - - SALES - - PURCHASE - type: string - description: |- - * `SALES` - SALES - * `PURCHASE` - PURCHASE - x-merge-category: accounting - Contact: - type: object - description: |- - # The Contact Object - ### Description - A `Contact` is an individual or business entity to which products and services are sold to or purchased from. The `Contact` model contains both Customers, in which products and services are sold to, and Vendors (or Suppliers), in which products and services are purchased from. - * A `Contact` is a Vendor/Supplier if the `is_supplier` property is true. - * A `Contact` is a customer if the `is_customer` property is true. - - ### Usage Example - Fetch from the `LIST Contacts` endpoint and view a company's contacts. - properties: - id: - type: string - format: uuid - readOnly: true - example: c640b80b-fac9-409f-aa19-1f9221aec445 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '11167' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The contact's name. - example: Gil Feig's pickleball store - is_supplier: - type: boolean - nullable: true - description: Whether the contact is a supplier. - is_customer: - type: boolean - nullable: true - description: Whether the contact is a customer. - example: true - email_address: - type: string - nullable: true - description: The contact's email address. - example: pickleball@merge.dev - tax_number: - type: string - nullable: true - description: The contact's tax number. - example: 12-3456789 - status: - oneOf: - - $ref: '#/components/schemas/Status7d1Enum' - - type: string - nullable: true - description: |- - The contact's status - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - example: ACTIVE - currency: - type: string - nullable: true - description: The currency the contact's transactions are in. - example: USD - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's contact was updated. - example: '2020-03-31T00:00:00Z' - company: - type: string - format: uuid - nullable: true - description: The company the contact belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - addresses: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Address' - nullable: true - example: - - 2f2702aa-8948-492b-a412-2acdf6d2c499 - - d98c7428-8dda-48a8-a1da-c570f65e2375 - description: '`Address` object IDs for the given `Contacts` object.' - phone_numbers: - type: array - items: - $ref: '#/components/schemas/AccountingPhoneNumber' - example: - - number: '+3198675309' - type: Mobile - description: '`AccountingPhoneNumber` object for the given `Contacts` object.' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account"}' - x-merge-category: accounting - ContactEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ContactRequest' - required: - - model - x-merge-category: accounting - ContactRequest: - type: object - description: |- - # The Contact Object - ### Description - A `Contact` is an individual or business entity to which products and services are sold to or purchased from. The `Contact` model contains both Customers, in which products and services are sold to, and Vendors (or Suppliers), in which products and services are purchased from. - * A `Contact` is a Vendor/Supplier if the `is_supplier` property is true. - * A `Contact` is a customer if the `is_customer` property is true. - - ### Usage Example - Fetch from the `LIST Contacts` endpoint and view a company's contacts. - properties: - name: - type: string - nullable: true - description: The contact's name. - example: Gil Feig's pickleball store - is_supplier: - type: boolean - nullable: true - description: Whether the contact is a supplier. - is_customer: - type: boolean - nullable: true - description: Whether the contact is a customer. - example: true - email_address: - type: string - nullable: true - description: The contact's email address. - example: pickleball@merge.dev - tax_number: - type: string - nullable: true - description: The contact's tax number. - example: 12-3456789 - status: - oneOf: - - $ref: '#/components/schemas/Status7d1Enum' - - type: string - nullable: true - description: |- - The contact's status - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - example: ACTIVE - currency: - type: string - nullable: true - description: The currency the contact's transactions are in. - example: USD - company: - type: string - format: uuid - nullable: true - description: The company the contact belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - addresses: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Address' - nullable: true - example: - - 2f2702aa-8948-492b-a412-2acdf6d2c499 - - d98c7428-8dda-48a8-a1da-c570f65e2375 - description: '`Address` object IDs for the given `Contacts` object.' - phone_numbers: - type: array - items: - $ref: '#/components/schemas/AccountingPhoneNumberRequest' - example: - - number: '+3198675309' - type: Mobile - description: '`AccountingPhoneNumber` object for the given `Contacts` object.' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account"}' - x-merge-category: accounting - ContactResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Contact' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - CountryEnum: - enum: - - AF - - AX - - AL - - DZ - - AS - - AD - - AO - - AI - - AQ - - AG - - AR - - AM - - AW - - AU - - AT - - AZ - - BS - - BH - - BD - - BB - - BY - - BE - - BZ - - BJ - - BM - - BT - - BO - - BQ - - BA - - BW - - BV - - BR - - IO - - BN - - BG - - BF - - BI - - CV - - KH - - CM - - CA - - KY - - CF - - TD - - CL - - CN - - CX - - CC - - CO - - KM - - CG - - CD - - CK - - CR - - CI - - HR - - CU - - CW - - CY - - CZ - - DK - - DJ - - DM - - DO - - EC - - EG - - SV - - GQ - - ER - - EE - - SZ - - ET - - FK - - FO - - FJ - - FI - - FR - - GF - - PF - - TF - - GA - - GM - - GE - - DE - - GH - - GI - - GR - - GL - - GD - - GP - - GU - - GT - - GG - - GN - - GW - - GY - - HT - - HM - - VA - - HN - - HK - - HU - - IS - - IN - - ID - - IR - - IQ - - IE - - IM - - IL - - IT - - JM - - JP - - JE - - JO - - KZ - - KE - - KI - - KW - - KG - - LA - - LV - - LB - - LS - - LR - - LY - - LI - - LT - - LU - - MO - - MG - - MW - - MY - - MV - - ML - - MT - - MH - - MQ - - MR - - MU - - YT - - MX - - FM - - MD - - MC - - MN - - ME - - MS - - MA - - MZ - - MM - - NA - - NR - - NP - - NL - - NC - - NZ - - NI - - NE - - NG - - NU - - NF - - KP - - MK - - MP - - NO - - OM - - PK - - PW - - PS - - PA - - PG - - PY - - PE - - PH - - PN - - PL - - PT - - PR - - QA - - RE - - RO - - RU - - RW - - BL - - SH - - KN - - LC - - MF - - PM - - VC - - WS - - SM - - ST - - SA - - SN - - RS - - SC - - SL - - SG - - SX - - SK - - SI - - SB - - SO - - ZA - - GS - - KR - - SS - - ES - - LK - - SD - - SR - - SJ - - SE - - CH - - SY - - TW - - TJ - - TZ - - TH - - TL - - TG - - TK - - TO - - TT - - TN - - TR - - TM - - TC - - TV - - UG - - UA - - AE - - GB - - UM - - US - - UY - - UZ - - VU - - VE - - VN - - VG - - VI - - WF - - EH - - YE - - ZM - - ZW - type: string - description: |- - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - x-merge-category: accounting - CreateFieldMappingRequest: - type: object - properties: - target_field_name: - type: string - minLength: 1 - description: The name of the target field you want this remote field to - map to. - example: example_target_field_name - target_field_description: - type: string - minLength: 1 - description: The description of the target field you want this remote field - to map to. - example: this is a example description of the target field - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - common_model_name: - type: string - minLength: 1 - description: The name of the Common Model that the remote field corresponds - to in a given category. - example: ExampleCommonModel - required: - - common_model_name - - remote_field_traversal_path - - remote_method - - remote_url_path - - target_field_description - - target_field_name - x-merge-category: accounting - CreditNote: - type: object - description: |- - # The CreditNote Object - ### Description - A `CreditNote` is transaction issued to a customer, indicating a reduction or cancellation of the amount owed by the customer. It is most generally used as an adjustment note used to rectify errors, returns, or overpayments related to a sales transaction. A `CreditNote` can be applied to *Accounts Receivable* Invoices to decrease the overall amount of the Invoice. - - ### Usage Example - Fetch from the `LIST CreditNotes` endpoint and view a company's credit notes. - properties: - id: - type: string - format: uuid - readOnly: true - example: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '123877' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - transaction_date: - type: string - format: date-time - nullable: true - description: The credit note's transaction date. - example: '2020-03-31T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/CreditNoteStatusEnum' - - type: string - nullable: true - description: |- - The credit note's status. - - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - example: PAID - number: - type: string - nullable: true - description: The credit note's number. - example: CN-29 - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The credit note's contact. - example: c6c7b870-bb4d-489a-921e-2f0ee4192ff9 - x-merge-expands-to: Contact - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the credit note belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The credit note's exchange rate. - example: '2.9' - total_amount: - type: number - format: double - nullable: true - description: The credit note's total amount. - example: 50 - remaining_credit: - type: number - format: double - nullable: true - description: The amount of value remaining in the credit note that the customer - can use. - example: 20 - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - line_items: - type: array - items: - $ref: '#/components/schemas/CreditNoteLineItem' - readOnly: true - example: - - item: 0e3fd929-436c-4fd4-a48b-0c61f68d6178 - name: Basic Monthly - description: prorated amount for items - quantity: 1 - memo: privNote - unit_price: '5.0' - tax_rate: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - total_line_amount: '5.0' - tracking_categories: - - 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - account: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_id: '121222' - remote_was_deleted: true - x-merge-expands-to: CreditNoteLineItem - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The credit note's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's credit note was created. - example: '2020-03-31T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's credit note was updated. - example: '2020-03-31T00:00:00Z' - payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Payment' - nullable: true - example: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - description: Array of `Payment` object IDs - x-merge-expands-to: Payment - applied_payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentLineItem' - nullable: true - example: - - a9a94a75-19c1-41fe-90d8-d9ba959c38e5 - description: A list of the Payment Applied to Lines common models related - to a given Invoice, Credit Note, or Journal Entry. - x-merge-expands-to: PaymentLineItemWithPayment - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the CreditNote was generated in. - example: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - x-merge-expands-to: AccountingPeriod - applied_to_lines: - type: array - items: - $ref: '#/components/schemas/CreditNoteApplyLineForCreditNote' - description: A list of the CreditNote Applied to Lines common models related - to a given Credit Note - example: - - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"accounting_period": "AccountingPeriod", "applied_payments": - "PaymentLineItemWithPayment", "company": "CompanyInfo", "contact": "Contact", - "line_items": "CreditNoteLineItem", "payments": "Payment", "tracking_categories": - "TrackingCategory"}' - x-merge-category: accounting - CreditNoteApplyLineForCreditNote: - type: object - description: |- - # The CreditNoteApplyLine Object - ### Description - The `CreditNoteApplyLine` is attached to the CreditNote model. - - ### Usage Example - Fetch from the `GET CreditNote` endpoint and view the invoice's applied to lines. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - invoice: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Invoice' - nullable: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Invoice - applied_date: - type: string - format: date-time - nullable: true - description: Date that the credit note is applied to the invoice. - example: '2020-03-31T00:00:00Z' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount of the Credit Note applied to the invoice. - example: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"invoice": "Invoice"}' - x-merge-category: accounting - CreditNoteApplyLineForCreditNoteRequest: - type: object - description: |- - # The CreditNoteApplyLine Object - ### Description - The `CreditNoteApplyLine` is attached to the CreditNote model. - - ### Usage Example - Fetch from the `GET CreditNote` endpoint and view the invoice's applied to lines. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - invoice: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Invoice' - nullable: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Invoice - applied_date: - type: string - format: date-time - nullable: true - description: Date that the credit note is applied to the invoice. - example: '2020-03-31T00:00:00Z' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount of the Credit Note applied to the invoice. - example: '2.9' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"invoice": "Invoice"}' - x-merge-category: accounting - CreditNoteApplyLineForInvoice: - type: object - description: |- - # The CreditNoteApplyLine Object - ### Description - The `CreditNoteApplyLine` is attached to the CreditNote model. - - ### Usage Example - Fetch from the `GET CreditNote` endpoint and view the invoice's applied to lines. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - credit_note: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CreditNote' - nullable: true - example: dd7ae92086acb2fc9c2739de564ef8e9571f7263 - x-merge-expands-to: CreditNote - applied_date: - type: string - format: date-time - nullable: true - description: Date that the credit note is applied to the invoice. - example: '2020-03-31T00:00:00Z' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount of the Credit Note applied to the invoice. - example: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"credit_note": "CreditNote"}' - x-merge-category: accounting - CreditNoteEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/CreditNoteRequest' - required: - - model - x-merge-category: accounting - CreditNoteLineItem: - type: object - description: |- - # The CreditNoteLineItem Object - ### Description - The `CreditNoteLineItem` object is used to represent a credit note's line items. - - ### Usage Example - Fetch from the `GET CreditNote` endpoint and view the credit note's line items. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: 0e3fd929-436c-4fd4-a48b-0c61f68d6178 - x-merge-expands-to: Item - name: - type: string - nullable: true - description: The credit note line item's name. - example: Basic Monthly - description: - type: string - nullable: true - description: The description of the item that is owed. - example: prorated amount for items - quantity: - type: string - format: decimal - pattern: ^-?\d{0,24}(?:\.\d{0,8})?$ - nullable: true - description: The credit note line item's quantity. - example: 1 - memo: - type: string - nullable: true - description: The credit note line item's memo. - example: privNote - unit_price: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The credit note line item's unit price. - example: '5.0' - tax_rate: - type: string - format: uuid - nullable: true - example: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - description: The tax rate that applies to this line item. - total_line_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The credit note line item's total. - example: '5.0' - tracking_category: - type: string - format: uuid - nullable: true - description: The credit note line item's associated tracking category. - deprecated: true - tracking_categories: - type: array - items: - type: string - format: uuid - nullable: true - example: - - 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The credit note line item's associated tracking categories. - account: - type: string - format: uuid - nullable: true - description: The credit note line item's account. - example: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the credit note belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The credit note's contact. - example: 908934-49j9-093f-0989-908923908 - x-merge-expands-to: Contact - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - example: true - x-merge-nested-write-allowed: true - x-merge-expands: '{"company": "CompanyInfo", "contact": "Contact", "item": "Item", - "project": "Project"}' - x-merge-category: accounting - CreditNoteLineItemRequest: - type: object - description: |- - # The CreditNoteLineItem Object - ### Description - The `CreditNoteLineItem` object is used to represent a credit note's line items. - - ### Usage Example - Fetch from the `GET CreditNote` endpoint and view the credit note's line items. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: 0e3fd929-436c-4fd4-a48b-0c61f68d6178 - x-merge-expands-to: Item - name: - type: string - nullable: true - description: The credit note line item's name. - example: Basic Monthly - description: - type: string - nullable: true - description: The description of the item that is owed. - example: prorated amount for items - quantity: - type: string - format: decimal - pattern: ^-?\d{0,24}(?:\.\d{0,8})?$ - nullable: true - description: The credit note line item's quantity. - example: 1 - memo: - type: string - nullable: true - description: The credit note line item's memo. - example: privNote - unit_price: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The credit note line item's unit price. - example: '5.0' - tax_rate: - type: string - format: uuid - nullable: true - example: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - description: The tax rate that applies to this line item. - total_line_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The credit note line item's total. - example: '5.0' - tracking_category: - type: string - format: uuid - nullable: true - description: The credit note line item's associated tracking category. - deprecated: true - tracking_categories: - type: array - items: - type: string - format: uuid - nullable: true - example: - - 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The credit note line item's associated tracking categories. - account: - type: string - format: uuid - nullable: true - description: The credit note line item's account. - example: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the credit note belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The credit note's contact. - example: 908934-49j9-093f-0989-908923908 - x-merge-expands-to: Contact - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"company": "CompanyInfo", "contact": "Contact", "item": "Item", - "project": "Project"}' - x-merge-category: accounting - CreditNoteRequest: - type: object - description: |- - # The CreditNote Object - ### Description - A `CreditNote` is transaction issued to a customer, indicating a reduction or cancellation of the amount owed by the customer. It is most generally used as an adjustment note used to rectify errors, returns, or overpayments related to a sales transaction. A `CreditNote` can be applied to *Accounts Receivable* Invoices to decrease the overall amount of the Invoice. - - ### Usage Example - Fetch from the `LIST CreditNotes` endpoint and view a company's credit notes. - properties: - transaction_date: - type: string - format: date-time - nullable: true - description: The credit note's transaction date. - example: '2020-03-31T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/CreditNoteStatusEnum' - - type: string - nullable: true - description: |- - The credit note's status. - - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - example: PAID - number: - type: string - nullable: true - description: The credit note's number. - example: CN-29 - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The credit note's contact. - example: c6c7b870-bb4d-489a-921e-2f0ee4192ff9 - x-merge-expands-to: Contact - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the credit note belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The credit note's exchange rate. - example: '2.9' - total_amount: - type: number - format: double - nullable: true - description: The credit note's total amount. - example: 50 - remaining_credit: - type: number - format: double - nullable: true - description: The amount of value remaining in the credit note that the customer - can use. - example: 20 - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - line_items: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CreditNoteLineItemRequest' - example: - - item: 0e3fd929-436c-4fd4-a48b-0c61f68d6178 - name: Basic Monthly - description: prorated amount for items - quantity: 1 - memo: privNote - unit_price: '5.0' - tax_rate: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - total_line_amount: '5.0' - tracking_categories: - - 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - account: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_id: '121222' - remote_was_deleted: true - x-merge-expands-to: CreditNoteLineItem - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The credit note's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Payment' - nullable: true - example: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - description: Array of `Payment` object IDs - x-merge-expands-to: Payment - applied_payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentLineItem' - nullable: true - example: - - a9a94a75-19c1-41fe-90d8-d9ba959c38e5 - description: A list of the Payment Applied to Lines common models related - to a given Invoice, Credit Note, or Journal Entry. - x-merge-expands-to: PaymentLineItemWithPayment - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the CreditNote was generated in. - example: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - x-merge-expands-to: AccountingPeriod - applied_to_lines: - type: array - items: - $ref: '#/components/schemas/CreditNoteApplyLineForCreditNoteRequest' - description: A list of the CreditNote Applied to Lines common models related - to a given Credit Note - example: - - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"accounting_period": "AccountingPeriod", "applied_payments": - "PaymentLineItemWithPayment", "company": "CompanyInfo", "contact": "Contact", - "line_items": "CreditNoteLineItem", "payments": "Payment", "tracking_categories": - "TrackingCategory"}' - x-merge-category: accounting - CreditNoteResponse: - type: object - properties: - model: - $ref: '#/components/schemas/CreditNote' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - CreditNoteStatusEnum: - enum: - - SUBMITTED - - AUTHORIZED - - PAID - type: string - description: |- - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - x-merge-category: accounting - CreditOrDebitEnum: - enum: - - CREDIT - - DEBIT - type: string - description: |- - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - x-merge-category: accounting - DataPassthroughRequest: - type: object - description: |- - # 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: - allOf: - - $ref: '#/components/schemas/MethodEnum' - example: POST - path: - type: string - minLength: 1 - description: The path of the request in the third party's platform. - example: /scooters - base_url_override: - type: string - nullable: true - minLength: 1 - description: An optional override of the third party's base url for the - request. - example: https://api.example.com - data: - type: string - nullable: true - minLength: 1 - description: The data with the request. You must include a `request_format` - parameter matching the data's format - example: '{"company": "Lime", "model": "Gen 2.5"}' - multipart_form_data: - type: array - items: - $ref: '#/components/schemas/MultipartFormFieldRequest' - nullable: true - description: Pass an array of `MultipartFormField` objects in here instead - of using the `data` param if `request_format` is set to `MULTIPART`. - headers: - type: object - additionalProperties: {} - nullable: true - description: 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. - example: - EXTRA-HEADER: value - request_format: - allOf: - - $ref: '#/components/schemas/RequestFormatEnum' - nullable: true - example: JSON - normalize_response: - type: boolean - description: '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`.' - required: - - method - - path - x-merge-category: accounting - DebugModeLog: - type: object - properties: - log_id: - type: string - example: 99433219-8017-4acd-bb3c-ceb23d663832 - dashboard_view: - type: string - example: https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 - log_summary: - $ref: '#/components/schemas/DebugModelLogSummary' - example: - url: www.exampleintegration.com/api/v1/exampleapi - method: POST - status_code: 200 - required: - - dashboard_view - - log_id - - log_summary - x-merge-sample-json: '{"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}}' - x-merge-category: accounting - DebugModelLogSummary: - type: object - properties: - url: - type: string - example: www.exampleintegration.com/api/v1/exampleapi - method: - type: string - example: POST - status_code: - type: integer - example: 200 - required: - - method - - status_code - - url - x-merge-sample-json: '{"url": "www.exampleintegration.com/api/v1/exampleapi", - "method": "POST", "status_code": 200}' - x-merge-category: accounting - Employee: - type: object - description: |- - # The Employee Object - ### Description - An `Employee` is an individual who works for the company of the linked account. The `Employee` model contains both contractors and full time employees. - * An `Employee` is a contractor if `is_contractor` property is `True` - * An `Employee` is a full time employee if `is_contractor` property is `False` - - ### Usage Example - Fetch from the `LIST Employees` endpoint and view a company's employees. - properties: - id: - type: string - format: uuid - readOnly: true - example: c640b80b-fac9-409f-aa19-1f9221aec445 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '11167' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - first_name: - type: string - nullable: true - description: The employee's first name. - maxLength: 255 - example: John - last_name: - type: string - nullable: true - description: The employee's last name. - maxLength: 255 - example: Smith - is_contractor: - type: boolean - nullable: true - description: '`True` if the employee is a contractor, `False` if not.' - example: true - employee_number: - type: string - nullable: true - description: The employee's internal identification number. - maxLength: 50 - example: '325462' - email_address: - type: string - nullable: true - description: The employee's email address. - example: johnsmith@merge.dev - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The subsidiary that the employee belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - status: - oneOf: - - $ref: '#/components/schemas/Status895Enum' - - type: string - description: |- - The employee's status in the accounting system. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - example: ACTIVE - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - required: - - status - x-merge-expands: '{"company": "Company", "employments": "Employment", "groups": - "Group", "home_location": "Location", "manager": "Employee", "pay_group": - "PayGroup", "team": "Team", "work_location": "Location"}' - x-merge-category: accounting - EnabledActionsEnum: - enum: - - READ - - WRITE - type: string - description: |- - * `READ` - READ - * `WRITE` - WRITE - x-merge-category: accounting - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - type: string - description: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - x-merge-category: accounting - EndUserDetailsRequest: - type: object - properties: - end_user_email_address: - type: string - minLength: 1 - description: Your end user's email address. This is purely for identification - purposes - setting this value will not cause any emails to be sent. - maxLength: 100 - example: example@gmail.com - end_user_organization_name: - type: string - minLength: 1 - description: Your end user's organization. - maxLength: 100 - example: Test Organization - end_user_origin_id: - type: string - minLength: 1 - description: 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. - maxLength: 100 - example: '12345' - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: The integration categories to show in Merge Link. - example: - - hris - - ats - integration: - type: string - nullable: true - minLength: 1 - description: 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/. - example: bamboohr - link_expiry_mins: - type: integer - maximum: 10080 - minimum: 30 - default: 30 - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: array - items: - $ref: '#/components/schemas/CommonModelScopesBodyRequest' - nullable: true - description: 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: object - additionalProperties: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - nullable: true - description: 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. - example: - hris: - - model_name: Employee - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - first_name - - last_name - - personal_email - disabled_fields: - - preferred_name - - model_name: Employment - model_permissions: - READ: - is_enabled: false - WRITE: - is_enabled: false - field_permissions: - enabled_fields: - - effective_date - ats: - - model_name: Job - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - name - disabled_fields: - - description - - model_name: Department - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - language: - oneOf: - - $ref: '#/components/schemas/LanguageEnum' - - type: string - nullable: true - description: |- - The following subset of IETF language tags can be used to configure localization. - - * `en` - en - * `de` - de - example: en - are_syncs_disabled: - type: boolean - nullable: true - default: false - description: The boolean that indicates whether initial, periodic, and force - syncs will be disabled. - integration_specific_config: - type: object - additionalProperties: {} - nullable: true - description: A JSON object containing integration-specific configuration - options. - example: - rippling: - oauth_code: 3h1jj8ssdf31dfji3o1jjdfjasd - required: - - categories - - end_user_email_address - - end_user_organization_name - - end_user_origin_id - x-merge-category: accounting - ErrorValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /model/custom_fields - title: - type: string - example: Missing Required Field - detail: - type: string - example: custom_fields is a required field on model. - problem_type: - type: string - example: MISSING_REQUIRED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: accounting - 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 - type: string - description: |- - * `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 - x-merge-category: accounting - Expense: - type: object - description: |- - # The Expense Object - ### Description - The `Expense` object is used to represent a direct purchase by a business, typically made with a check, credit card, or cash. Each `Expense` object is dedicated to a grouping of expenses, with each expense recorded in the lines object. - - The `Expense` object is used also used to represent refunds to direct purchases. Refunds can be distinguished from purchases by the amount sign of the records. Expense objects with a negative amount are purchases and `Expense` objects with a positive amount are refunds to those purchases. - - ### Usage Example - Fetch from the `GET Expense` endpoint and view a company's expense. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - transaction_date: - type: string - format: date-time - nullable: true - description: When the transaction occurred. - remote_created_at: - type: string - format: date-time - nullable: true - description: When the expense was created. - example: '2020-03-31T00:00:00Z' - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The expense's payment account. - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: Account - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The expense's contact. - example: 3d263469-51a1-4766-9205-f6c997826be1 - x-merge-expands-to: Contact - total_amount: - type: number - format: double - nullable: true - description: The expense's total amount. - example: 10000 - sub_total: - type: number - format: double - nullable: true - description: The expense's total amount before tax. - total_tax_amount: - type: number - format: double - nullable: true - description: The expense's total tax amount. - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The expense's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The expense's exchange rate. - example: '2.9' - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the expense belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - x-merge-expands-to: Employee - memo: - type: string - nullable: true - description: The expense's private note. - example: New employee supplies - lines: - type: array - items: - $ref: '#/components/schemas/ExpenseLine' - example: - - remote_id: '121222' - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - account: 2a56344a-a491-11ec-b909-0242ac120002 - contact: c640b80b-fac9-409f-aa19-1f9221aec445 - description: MacBook Pro - exchange_rate: '2.9' - remote_was_deleted: false - - remote_id: '121223' - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - account: 2a56344a-a491-11ec-b909-0242ac120002 - description: Desk Lamp - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the Expense was generated in. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: AccountingPeriod - field_mappings: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account", "accounting_period": "AccountingPeriod", - "company": "CompanyInfo", "contact": "Contact", "employee": "Employee", "tracking_categories": - "TrackingCategory"}' - x-merge-category: accounting - ExpenseEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ExpenseRequest' - required: - - model - x-merge-category: accounting - ExpenseLine: - type: object - description: |- - # The ExpenseLine Object - ### Description - The `ExpenseLine` object is used to represent an expense's line items. - - ### Usage Example - Fetch from the `GET Expense` endpoint and view the expense's line items. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - description: The line's item. - example: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - x-merge-expands-to: Item - net_amount: - type: number - format: double - nullable: true - description: The line's net amount. - example: 25.54 - tracking_category: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - deprecated: true - x-merge-expands-to: TrackingCategory - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The expense line item's associated tracking categories. - x-merge-expands-to: TrackingCategory - company: - type: string - format: uuid - nullable: true - description: The company the expense belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - x-merge-expands-to: Employee - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - = type: string - nullable: true - description: |- - The expense line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The expense's payment account. - example: 2a56344a-a491-11ec-b909-0242ac120002 - x-merge-expands-to: Account - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The expense's contact. - example: c640b80b-fac9-409f-aa19-1f9221aec445 - x-merge-expands-to: Contact - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - description: - type: string - nullable: true - description: The description of the item that was purchased by the company. - example: MacBook Pro - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The expense line item's exchange rate. - example: '2.9' - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"account": "Account", "contact": "Contact", "employee": "Employee", - "item": "Item", "project": "Project", "tracking_categories": "TrackingCategory", - "tracking_category": "TrackingCategory"}' - x-merge-category: accounting - ExpenseLineRequest: - type: object - description: |- - # The ExpenseLine Object - ### Description - The `ExpenseLine` object is used to represent an expense's line items. - - ### Usage Example - Fetch from the `GET Expense` endpoint and view the expense's line items. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - description: The line's item. - example: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - x-merge-expands-to: Item - net_amount: - type: number - format: double - nullable: true - description: The line's net amount. - example: 25.54 - tracking_category: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - deprecated: true - x-merge-expands-to: TrackingCategory - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The expense line item's associated tracking categories. - x-merge-expands-to: TrackingCategory - company: - type: string - format: uuid - nullable: true - description: The company the expense belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - x-merge-expands-to: Employee - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The expense line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The expense's payment account. - example: 2a56344a-a491-11ec-b909-0242ac120002 - x-merge-expands-to: Account - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The expense's contact. - example: c640b80b-fac9-409f-aa19-1f9221aec445 - x-merge-expands-to: Contact - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - description: - type: string - nullable: true - description: The description of the item that was purchased by the company. - example: MacBook Pro - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The expense line item's exchange rate. - example: '2.9' - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "contact": "Contact", "employee": "Employee", - "item": "Item", "project": "Project", "tracking_categories": "TrackingCategory", - "tracking_category": "TrackingCategory"}' - x-merge-category: accounting - ExpenseRequest: - type: object - description: |- - # The Expense Object - ### Description - The `Expense` object is used to represent a direct purchase by a business, typically made with a check, credit card, or cash. Each `Expense` object is dedicated to a grouping of expenses, with each expense recorded in the lines object. - - The `Expense` object is used also used to represent refunds to direct purchases. Refunds can be distinguished from purchases by the amount sign of the records. Expense objects with a negative amount are purchases and `Expense` objects with a positive amount are refunds to those purchases. - - ### Usage Example - Fetch from the `GET Expense` endpoint and view a company's expense. - properties: - transaction_date: - type: string - format: date-time - nullable: true - description: When the transaction occurred. - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The expense's payment account. - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: Account - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The expense's contact. - example: 3d263469-51a1-4766-9205-f6c997826be1 - x-merge-expands-to: Contact - total_amount: - type: number - format: double - nullable: true - description: The expense's total amount. - example: 10000 - sub_total: - type: number - format: double - nullable: true - description: The expense's total amount before tax. - total_tax_amount: - type: number - format: double - nullable: true - description: The expense's total tax amount. - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - = type: string - nullable: true - description: |- - The expense's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The expense's exchange rate. - example: '2.9' - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the expense belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - x-merge-expands-to: Employee - memo: - type: string - nullable: true - description: The expense's private note. - example: New employee supplies - lines: - type: array - items: - $ref: '#/components/schemas/ExpenseLineRequest' - example: - - remote_id: '121222' - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - account: 2a56344a-a491-11ec-b909-0242ac120002 - contact: c640b80b-fac9-409f-aa19-1f9221aec445 - description: MacBook Pro - exchange_rate: '2.9' - remote_was_deleted: false - - remote_id: '121223' - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - account: 2a56344a-a491-11ec-b909-0242ac120002 - description: Desk Lamp - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the Expense was generated in. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: AccountingPeriod - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "accounting_period": "AccountingPeriod", - "company": "CompanyInfo", "contact": "Contact", "employee": "Employee", "tracking_categories": - "TrackingCategory"}' - x-merge-category: accounting - ExpenseResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Expense' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - ExternalTargetFieldAPI: - type: object - properties: - name: - type: string - nullable: true - readOnly: true - example: example_target_field_name - description: - type: string - nullable: true - readOnly: true - example: this is a example description of a target field - is_mapped: - type: string - nullable: true - readOnly: true - example: true - x-merge-category: accounting - ExternalTargetFieldAPIResponse: - type: object - properties: - Account: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - AccountingAttachment: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - BalanceSheet: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - CashFlowStatement: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - CompanyInfo: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Contact: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - IncomeStatement: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - CreditNote: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Item: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - PurchaseOrder: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - TrackingCategory: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - JournalEntry: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - TaxRate: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Invoice: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Payment: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Expense: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - VendorCredit: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Transaction: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - AccountingPeriod: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - GeneralLedgerTransaction: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - BankFeedAccount: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Employee: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - PaymentMethod: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Project: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - PaymentTerm: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - x-merge-category: accounting - FeedStatusEnum: - enum: - - ACTIVE - - INACTIVE - type: string - description: |- - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - x-merge-category: accounting - FieldFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: accounting - FieldMappingApiInstance: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - is_integration_wide: - type: boolean - readOnly: true - target_field: - type: object - properties: - name: - type: string - description: - type: string - is_organization_wide: - type: boolean - required: - - description - - is_organization_wide - - name - nullable: true - readOnly: true - example: - name: example_target_field_name - description: this is a example description of a target field - is_organization_wide: true - remote_field: - type: object - properties: - remote_key_name: - type: string - nullable: true - schema: - type: object - additionalProperties: {} - nullable: true - remote_endpoint_info: - type: object - properties: - method: - type: string - nullable: true - url_path: - type: string - nullable: true - field_traversal_path: - type: array - items: - type: string - nullable: true - required: - - field_traversal_path - - method - - url_path - required: - - remote_endpoint_info - - remote_key_name - - schema - nullable: true - readOnly: true - example: - 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 - x-merge-category: accounting - FieldMappingApiInstanceResponse: - type: object - properties: - Account: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - AccountingAttachment: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - BalanceSheet: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - CashFlowStatement: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - CompanyInfo: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Contact: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - IncomeStatement: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - CreditNote: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Item: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - PurchaseOrder: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - TrackingCategory: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - JournalEntry: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - TaxRate: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Invoice: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Payment: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Expense: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - VendorCredit: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Transaction: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - AccountingPeriod: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - GeneralLedgerTransaction: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - BankFeedAccount: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Employee: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - PaymentMethod: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Project: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - PaymentTerm: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - x-merge-category: accounting - FieldMappingInstanceResponse: - type: object - properties: - model: - $ref: '#/components/schemas/FieldMappingApiInstance' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - FieldPermissionDeserializer: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: accounting - FieldPermissionDeserializerRequest: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: accounting - FieldTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: accounting - GeneralLedgerTransaction: - type: object - description: |- - # The GeneralLedgerTransaction Object - ### Description - A General Ledger Entry is a record of a financial transaction that is posted to the general ledger, the central repository of a company’s financial data. - - The `GeneralLedgerTransaction` object is a singular endpoint to pull all transactions posted to a company’s general ledger. The transaction that generated the `GeneralLedgerTransaction` can be found by referencing the `underlying_transaction_type` and `underlying_transaction_remote_id` fields. - - The lines of a `GeneralLedgerTransaction` object will always have equal amounts of debits and credits. - - ### Usage Example - Fetch from the `GET GeneralLedgerTransaction` endpoint and view a general ledger transaction. - properties: - id: - type: string - format: uuid - readOnly: true - example: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '987300' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - underlying_transaction_remote_id: - type: string - nullable: true - description: The third party remote ID of the underlying transaction. - maxLength: 50 - example: '1234' - underlying_transaction_type: - oneOf: - - $ref: '#/components/schemas/UnderlyingTransactionTypeEnum' - - type: string - nullable: true - description: |- - The type of the underlying transaction. - - * `INVOICE` - INVOICE - * `EXPENSE` - EXPENSE - * `TRANSACTION` - TRANSACTION - * `JOURNAL_ENTRY` - JOURNAL_ENTRY - * `PAYMENT` - PAYMENT - * `VENDOR_CREDIT` - VENDOR_CREDIT - * `CREDIT_NOTE` - CREDIT_NOTE - example: INVOICE - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the GeneralLedgerTransaction was - generated in. - example: d6e687d6-0c36-48a1-8114-35324b5cb38f - x-merge-expands-to: AccountingPeriod - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the GeneralLedgerTransaction belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's GeneralLedgerTransaction entry was updated. - example: '2020-03-31T00:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's GeneralLedgerTransaction entry was created. - example: '2020-03-31T00:00:00Z' - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - posting_date: - type: string - format: date-time - nullable: true - description: The date that the transaction was posted to the general ledger. - example: '2020-03-31T00:00:00Z' - general_ledger_transaction_lines: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/GeneralLedgerTransactionLine' - readOnly: true - example: - - remote_id: '123' - account: a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - contact: d6e687d6-0c36-48a1-8114-35324b5cb38f - base_currency: USD - transaction_currency: USD - description: Invoice created - exchange_rate: 1 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - debit_amount: 0 - crebit_amount: 123.5 - item: a47e11b6-c73b-4a0c-be31-130fc48177fa - foreign_debit_amount: 0 - foreign_credit_amount: 123.5 - remote_was_deleted: false - remote_data: - - path: /actions - data: - - Varies by platform - description: A list of “General Ledger Transaction Applied to Lines” objects. - x-merge-expands-to: GeneralLedgerTransactionLine - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"accounting_period": "AccountingPeriod", "company": "CompanyInfo", - "general_ledger_transaction_lines": "GeneralLedgerTransactionLine", "tracking_categories": - "TrackingCategory"}' - x-merge-category: accounting - GeneralLedgerTransactionLine: - type: object - description: |- - # The GeneralLedgerTransactionLineSerializer Object - ### Description - The `GeneralLedgerTransactionLineSerializer` object represents general ledger transaction line item. - - ### Usage Example Fetch from the `GET GeneralLedgerTransactionLineSerializer` endpoint and view an - `GeneralLedgerTransaction` line item. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '123' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - example: a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: Account - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the GeneralLedgerTransaction belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - x-merge-expands-to: Employee - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - example: d6e687d6-0c36-48a1-8114-35324b5cb38f - x-merge-expands-to: Contact - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - base_currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - = type: string - nullable: true - description: |- - The base currency of the transaction - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - transaction_currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The transaction currency that the transaction is made in. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The exchange rate between the base currency and the transaction - currency. - example: 1 - description: - type: string - nullable: true - description: A description of the line item. - example: Invoice created - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - readOnly: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - debit_amount: - type: string - format: decimal - credit_amount: - type: string - format: decimal - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: Item - foreign_debit_amount: - type: string - format: decimal - foreign_credit_amount: - type: string - format: decimal - example: 123.5 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - required: - - credit_amount - - debit_amount - - foreign_credit_amount - - foreign_debit_amount - x-merge-nested-write-allowed: true - x-merge-expands: '{"account": "Account", "company": "CompanyInfo", "contact": - "Contact", "employee": "Employee", "item": "Item", "project": "Project"}' - x-merge-category: accounting - GenerateRemoteKeyRequest: - type: object - description: |- - # The GenerateRemoteKey Object - ### Description - The `GenerateRemoteKey` object is used to represent a request for a new remote key. - - ### Usage Example - Post a `GenerateRemoteKey` to create a new remote key. - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: accounting - IncomeStatement: - type: object - description: |- - # The IncomeStatement Object - ### Description - The `IncomeStatement` object is used to represent a company’s income, the cost of sales, operating expenses, and other non-operating expenses. The object also includes other important values like gross profit, gross operating profit, and net income. This represents a period of time (month, quarter, or year). - - ### Usage Example - Fetch from the `GET IncomeStatement` endpoint and view a company's income statement for a given period. - properties: - id: - type: string - format: uuid - readOnly: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '1342348' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The income statement's name. - example: IncomeStatement - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The income statement's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the income statement belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - start_period: - type: string - format: date-time - nullable: true - description: The income statement's start period. - end_period: - type: string - format: date-time - nullable: true - description: The income statement's end period. - income: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '10299' - name: Total Income - value: 325 - sub_items: - - remote_id: '10200' - name: Landscaping Services - value: 425 - sub_items: [] - - remote_id: '10201' - name: Pest Control Services - value: -100 - sub_items: [] - cost_of_sales: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '10299' - name: Total COGS - value: 25 - sub_items: - - remote_id: '10200' - name: Supplies - value: 10 - sub_items: [] - gross_profit: - type: number - format: double - nullable: true - description: The revenue minus the cost of sale. - example: 300 - operating_expenses: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '10299' - name: Total Operating Expenses - value: 100 - sub_items: [] - net_operating_income: - type: number - format: double - nullable: true - description: The revenue minus the operating expenses. - example: 200 - non_operating_expenses: - type: array - items: - $ref: '#/components/schemas/ReportItem' - readOnly: true - example: - - remote_id: '10299' - name: Total Non-Operating Expenses - value: 100 - sub_items: [] - net_income: - type: number - format: double - nullable: true - description: The gross profit minus the total expenses. - example: 100 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"company": "CompanyInfo"}' - x-merge-category: accounting - IndividualCommonModelScopeDeserializer: - type: object - properties: - model_name: - type: string - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializer' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializer' - required: - - model_name - x-merge-category: accounting - IndividualCommonModelScopeDeserializerRequest: - type: object - properties: - model_name: - type: string - minLength: 1 - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializerRequest' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializerRequest' - required: - - model_name - x-merge-category: accounting - Invoice: - type: object - description: |- - # The Invoice Object - ### Description - The `Invoice` object represents an itemized record of goods and/or services sold to a customer or bought from a vendor. - - - Represents a Bill when the `Invoice` type is `ACCOUNTS_PAYABLE`. References an Invoice when the `Invoice` type is `ACCOUNTS_RECEIVABLE`. - - ### Usage Example - Fetch from the `LIST Invoices` endpoint and view a company's invoices. - properties: - id: - type: string - format: uuid - readOnly: true - example: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '990110' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - type: - oneOf: - - $ref: '#/components/schemas/InvoiceTypeEnum' - = type: string - nullable: true - description: |- - Whether the invoice is an accounts receivable or accounts payable. If `type` is `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is `ACCOUNTS_RECEIVABLE`, it is an invoice. - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - example: ACCOUNTS_RECEIVABLE - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The invoice's contact. - example: 022a2bef-57e5-4def-8ed2-7c41bd9a5ed8 - x-merge-expands-to: Contact - number: - type: string - nullable: true - description: The invoice's number. - example: AIQ12546 - issue_date: - type: string - format: date-time - nullable: true - description: The invoice's issue date. - example: '2020-03-31T00:00:00Z' - due_date: - type: string - format: date-time - nullable: true - description: The invoice's due date. - example: '2020-04-15T00:00:00Z' - paid_on_date: - type: string - format: date-time - nullable: true - description: The invoice's paid date. - example: '2020-04-01T00:00:00Z' - memo: - type: string - nullable: true - description: The invoice's private note. - example: Weekly Payment - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the invoice belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - x-merge-expands-to: Employee - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The invoice's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The invoice's exchange rate. - example: '2.9' - payment_term: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentTerm' - nullable: true - description: The payment term that applies to this transaction. - example: 89d329de-825f-4ac6-8369-3c58b4e68bee - x-merge-expands-to: PaymentTerm - total_discount: - type: number - format: double - nullable: true - description: The total discounts applied to the total cost. - sub_total: - type: number - format: double - nullable: true - description: The total amount being paid before taxes. - example: 100 - status: - oneOf: - - $ref: '#/components/schemas/InvoiceStatusEnum' - - type: string - nullable: true - description: |- - The status of the invoice. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - example: DRAFT - total_tax_amount: - type: number - format: double - nullable: true - description: The total amount being paid in taxes. - example: 5 - total_amount: - type: number - format: double - nullable: true - description: The invoice's total amount. - example: 105 - balance: - type: number - format: double - nullable: true - description: The invoice's remaining balance. - example: 105 - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's invoice entry was updated. - example: '2020-04-01T00:00:00Z' - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - 7dc5ca17-d311-44cd-9ce0-333080367a18 - - 6aa0700c-48e1-4c4a-8162-02e6a582df05 - - 8c933d61-8f5b-4360-ac0c-c9dc87bee763 - x-merge-expands-to: TrackingCategory - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the Invoice was generated in. - example: 7dc5ca17-d311-44cd-9ce0-333080367a18 - x-merge-expands-to: AccountingPeriod - purchase_orders: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PurchaseOrder' - nullable: true - example: - - e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7 - - dd70ca2f-b120-46fa-889a-9604037f45fd - - 889b281d-739c-4759-95b8-0aedb3947131 - x-merge-expands-to: PurchaseOrder - payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Payment' - nullable: true - example: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - description: Array of `Payment` object IDs. - x-merge-expands-to: Payment - applied_payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentLineItem' - nullable: true - example: - - 9017594e-dc33-4113-a5d2-b0f928e34fdd - description: A list of the Payment Applied to Lines common models related - to a given Invoice, Credit Note, or Journal Entry. - x-merge-expands-to: PaymentLineItemWithPayment - line_items: - type: array - items: - $ref: '#/components/schemas/InvoiceLineItem' - readOnly: true - example: - - remote_id: '8765432' - description: Pickleball lessons - unit_price: 50 - quantity: 1 - total_amount: 50 - currency: USD - exchange_rate: '2.9' - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - item: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - account: cd0f32d4-a493-11ec-b909-0242ac120002 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_data: - - path: /actions - data: - - Varies by platform - x-merge-expands-to: InvoiceLineItem - applied_credit_notes: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CreditNoteApplyLineForInvoice' - readOnly: true - example: - - credit_note: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - description: '`CreditNoteApplyLines` applied to the Invoice.' - x-merge-expands-to: CreditNoteApplyLineForInvoice - applied_vendor_credits: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/VendorCreditApplyLineForInvoice' - readOnly: true - example: - - vendor_credit: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - description: '`VendorCreditApplyLines` applied to the Invoice.' - x-merge-expands-to: VendorCreditApplyLineForInvoice - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"accounting_period": "AccountingPeriod", "applied_credit_notes": - "CreditNoteApplyLineForInvoice", "applied_payments": "PaymentLineItemWithPayment", - "applied_vendor_credits": "VendorCreditApplyLineForInvoice", "company": "CompanyInfo", - "contact": "Contact", "employee": "Employee", "line_items": "InvoiceLineItem", - "payment_term": "PaymentTerm", "payments": "Payment", "purchase_orders": "PurchaseOrder", - "tracking_categories": "TrackingCategory"}' - x-merge-category: accounting - InvoiceEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/InvoiceRequest' - required: - - model - x-merge-category: accounting - InvoiceLineItem: - type: object - description: |- - # The InvoiceLineItem Object - ### Description - The `InvoiceLineItem` object represents an itemized record of goods and/or services sold to a customer. - - ### Usage Example - Fetch from the `GET Invoice` endpoint and view the invoice's line items. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '8765432' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - description: - type: string - nullable: true - description: The line item's description. - example: Pickleball lessons - unit_price: - type: number - format: double - nullable: true - description: The line item's unit price. - example: 50 - quantity: - type: number - format: double - nullable: true - description: The line item's quantity. - example: 1 - total_amount: - type: number - format: double - nullable: true - description: The line item's total amount. - example: 50 - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The invoice's contact. - example: 908934-49j9-093f-0989-908923908 - x-merge-expands-to: Contact - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The line item's exchange rate. - example: '2.9' - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Item - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - example: cd0f32d4-a493-11ec-b909-0242ac120002 - x-merge-expands-to: Account - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - tracking_category: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - deprecated: true - x-merge-expands-to: TrackingCategory - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The invoice line item's associated tracking categories. - x-merge-expands-to: TrackingCategory - company: - type: string - format: uuid - nullable: true - description: The company the invoice belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-nested-write-allowed: true - x-merge-expands: '{"account": "Account", "contact": "Contact", "item": "Item", - "project": "Project", "tracking_categories": "TrackingCategory", "tracking_category": - "TrackingCategory"}' - x-merge-category: accounting - InvoiceLineItemRequest: - type: object - description: |- - # The InvoiceLineItem Object - ### Description - The `InvoiceLineItem` object represents an itemized record of goods and/or services sold to a customer. - - ### Usage Example - Fetch from the `GET Invoice` endpoint and view the invoice's line items. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '8765432' - description: - type: string - nullable: true - description: The line item's description. - example: Pickleball lessons - unit_price: - type: number - format: double - nullable: true - description: The line item's unit price. - example: 50 - quantity: - type: number - format: double - nullable: true - description: The line item's quantity. - example: 1 - total_amount: - type: number - format: double - nullable: true - description: The line item's total amount. - example: 50 - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - example: 7442f0d5-722d-45bd-b807-6e38489d37fe - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The invoice's contact. - example: 908934-49j9-093f-0989-908923908 - x-merge-expands-to: Contact - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The line item's exchange rate. - example: '2.9' - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Item - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - example: cd0f32d4-a493-11ec-b909-0242ac120002 - x-merge-expands-to: Account - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - tracking_category: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - deprecated: true - x-merge-expands-to: TrackingCategory - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The invoice line item's associated tracking categories. - x-merge-expands-to: TrackingCategory - company: - type: string - format: uuid - nullable: true - description: The company the invoice belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "contact": "Contact", "item": "Item", - "project": "Project", "tracking_categories": "TrackingCategory", "tracking_category": - "TrackingCategory"}' - x-merge-category: accounting - InvoiceRequest: - type: object - description: |- - # The Invoice Object - ### Description - The `Invoice` object represents an itemized record of goods and/or services sold to a customer or bought from a vendor. - - - Represents a Bill when the `Invoice` type is `ACCOUNTS_PAYABLE`. References an Invoice when the `Invoice` type is `ACCOUNTS_RECEIVABLE`. - - ### Usage Example - Fetch from the `LIST Invoices` endpoint and view a company's invoices. - properties: - type: - oneOf: - - $ref: '#/components/schemas/InvoiceTypeEnum' - - type: string - nullable: true - description: |- - Whether the invoice is an accounts receivable or accounts payable. If `type` is `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is `ACCOUNTS_RECEIVABLE`, it is an invoice. - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The invoice's contact. - x-merge-expands-to: Contact - number: - type: string - nullable: true - description: The invoice's number. - issue_date: - type: string - format: date-time - nullable: true - description: The invoice's issue date. - due_date: - type: string - format: date-time - nullable: true - description: The invoice's due date. - paid_on_date: - type: string - format: date-time - nullable: true - description: The invoice's paid date. - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee this overall transaction relates to. - x-merge-expands-to: Employee - memo: - type: string - nullable: true - description: The invoice's private note. - status: - oneOf: - - $ref: '#/components/schemas/InvoiceStatusEnum' - - type: string - nullable: true - description: |- - The status of the invoice. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the invoice belongs to. - x-merge-expands-to: CompanyInfo - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The invoice's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The invoice's exchange rate. - total_discount: - type: number - format: double - nullable: true - description: The total discounts applied to the total cost. - sub_total: - type: number - format: double - nullable: true - description: The total amount being paid before taxes. - payment_term: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentTerm' - nullable: true - description: The payment term that applies to this transaction. - x-merge-expands-to: PaymentTerm - total_tax_amount: - type: number - format: double - nullable: true - description: The total amount being paid in taxes. - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - total_amount: - type: number - format: double - nullable: true - description: The invoice's total amount. - balance: - type: number - format: double - nullable: true - description: The invoice's remaining balance. - payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Payment' - nullable: true - description: Array of `Payment` object IDs. - x-merge-expands-to: Payment - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - x-merge-expands-to: TrackingCategory - line_items: - type: array - items: - $ref: '#/components/schemas/InvoiceLineItemRequest' - x-merge-expands-to: InvoiceLineItem - purchase_orders: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PurchaseOrder' - nullable: true - x-merge-expands-to: PurchaseOrder - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"accounting_period": "AccountingPeriod", "applied_credit_notes": - "CreditNoteApplyLineForInvoice", "applied_payments": "PaymentLineItemWithPayment", - "applied_vendor_credits": "VendorCreditApplyLineForInvoice", "company": "CompanyInfo", - "contact": "Contact", "employee": "Employee", "line_items": "InvoiceLineItem", - "payment_term": "PaymentTerm", "payments": "Payment", "purchase_orders": "PurchaseOrder", - "tracking_categories": "TrackingCategory"}' - x-merge-category: accounting - InvoiceResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Invoice' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - InvoiceStatusEnum: - enum: - - PAID - - DRAFT - - SUBMITTED - - PARTIALLY_PAID - - OPEN - - VOID - type: string - description: |- - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - x-merge-category: accounting - InvoiceTypeEnum: - enum: - - ACCOUNTS_RECEIVABLE - - ACCOUNTS_PAYABLE - type: string - description: |- - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - x-merge-category: accounting - Issue: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - status: - oneOf: - - $ref: '#/components/schemas/IssueStatusEnum' - - type: string - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - example: ONGOING - error_description: - type: string - example: Missing Permissions - end_user: - type: object - additionalProperties: {} - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - first_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - last_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - is_muted: - type: boolean - readOnly: true - example: true - error_details: - type: array - items: - type: string - readOnly: true - example: - - Missing employee permissions. - - Missing time off permissions. - required: - - error_description - x-merge-category: accounting - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - type: string - description: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - x-merge-category: accounting - Item: - type: object - description: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. - - ### Usage Example - Fetch from the `LIST Items` endpoint and view a company's items. - properties: - id: - type: string - format: uuid - readOnly: true - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '12374' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The item's name. - example: Pickleball Paddle - status: - oneOf: - - $ref: '#/components/schemas/Status7d1Enum' - - type: string - nullable: true - description: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - example: ACTIVE - type: - oneOf: - - $ref: '#/components/schemas/Type2bbEnum' - - type: string - nullable: true - description: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - example: INVENTORY - unit_price: - type: number - format: double - nullable: true - description: The item's unit price. - example: 10 - purchase_price: - type: number - format: double - nullable: true - description: The price at which the item is purchased from a vendor. - example: 25 - purchase_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: References the default account used to record a purchase of - the item. - example: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - x-merge-expands-to: Account - sales_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: References the default account used to record a sale. - example: 3872b4c9-f5d2-4f3b-a66b-dfedbed42c49 - x-merge-expands-to: Account - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the item belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - purchase_tax_rate: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TaxRate' - nullable: true - description: The default purchase tax rate for this item. - example: 983e8f97-9qw2-34v9-p123-67bdf98740v5 - x-merge-expands-to: TaxRate - sales_tax_rate: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TaxRate' - nullable: true - description: The default sales tax rate for this item. - example: 232c8f56-7se4-98f2-y334-12bdf89249f5 - x-merge-expands-to: TaxRate - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's item note was updated. - example: '2020-03-31T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"company": "CompanyInfo", "purchase_account": "Account", - "purchase_tax_rate": "TaxRate", "sales_account": "Account", "sales_tax_rate": - "TaxRate"}' - x-merge-category: accounting - ItemEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ItemRequestRequest' - required: - - model - x-merge-category: accounting - ItemFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - uuid - * `number` - url - * `date` - email - * `datetime` - phone - * `bool` - currency - * `list` - decimal - x-merge-category: accounting - ItemRequestRequest: - type: object - description: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. - - ### Usage Example - Fetch from the `LIST Items` endpoint and view a company's items. - properties: - name: - type: string - nullable: true - description: The item's name. - example: Pickleball Paddle - status: - oneOf: - - $ref: '#/components/schemas/Status7d1Enum' - - type: string - nullable: true - description: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - example: ACTIVE - type: - oneOf: - - $ref: '#/components/schemas/Type2bbEnum' - - type: string - nullable: true - description: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - example: INVENTORY - unit_price: - type: number - format: double - nullable: true - description: The item's unit price. - example: 10 - purchase_price: - type: number - format: double - nullable: true - description: The price at which the item is purchased from a vendor. - example: 25 - purchase_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: References the default account used to record a purchase of - the item. - example: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - x-merge-expands-to: Account - sales_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: References the default account used to record a sale. - example: 3872b4c9-f5d2-4f3b-a66b-dfedbed42c49 - x-merge-expands-to: Account - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the item belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - purchase_tax_rate: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TaxRate' - nullable: true - description: The default purchase tax rate for this item. - example: 983e8f97-9qw2-34v9-p123-67bdf98740v5 - x-merge-expands-to: TaxRate - sales_tax_rate: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TaxRate' - nullable: true - description: The default sales tax rate for this item. - example: 232c8f56-7se4-98f2-y334-12bdf89249f5 - x-merge-expands-to: TaxRate - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"company": "CompanyInfo", "purchase_account": "Account", - "purchase_tax_rate": "TaxRate", "sales_account": "Account", "sales_tax_rate": - "TaxRate"}' - x-merge-category: accounting - ItemResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Item' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - ItemSchema: - type: object - properties: - item_type: - $ref: '#/components/schemas/ItemTypeEnum' - item_format: - $ref: '#/components/schemas/ItemFormatEnum' - item_choices: - type: array - items: - type: string - x-merge-category: accounting - ItemTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: accounting - JournalEntry: - type: object - description: |- - # The JournalEntry Object - ### Description - A `JournalEntry` is a record of a transaction or event that is entered into a company's accounting system. - - The `JournalEntry` common model contains records that are automatically created as a result of a certain type of transaction, like an Invoice, and records that are manually created against a company’s ledger. - - The lines of a given `JournalEntry` object should always sum to 0. A positive `net_amount` means the line represents a debit and a negative net_amount represents a credit. - - ### Usage Example - Fetch from the `GET JournalEntry` endpoint and view a company's journey entry. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - transaction_date: - type: string - format: date-time - nullable: true - description: The journal entry's transaction date. - example: '2020-03-31T00:00:00Z' - payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Payment' - nullable: true - example: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - description: Array of `Payment` object IDs. - x-merge-expands-to: Payment - applied_payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentLineItem' - nullable: true - example: - - 4311155d-f236-4a5d-9e0f-1cb167e38f95 - description: A list of the Payment Applied to Lines common models related - to a given Invoice, Credit Note, or Journal Entry. - x-merge-expands-to: PaymentLineItemWithPayment - memo: - type: string - nullable: true - description: The journal entry's private note. - example: Weekly Payment - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The journal's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The journal entry's exchange rate. - example: '2.9' - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the journal entry belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - lines: - type: array - items: - $ref: '#/components/schemas/JournalLine' - readOnly: true - example: - - remote_id: '121222' - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - net_amount: 25.54 - tracking_categories: - - d25d609b-945f-4762-b55a-1c8fb220c43c - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - contact: d2d5ea3c-b032-11ec-b909-0242ac120002 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - employee: 123c8r35-5kf5-12x5-r833-99bwf35210b5 - description: Cash payment for lunch - exchange_rate: '2.9' - remote_was_deleted: false - - remote_id: '121223' - account: f963f34d-3d2f-4f77-b557-cf36bc7e6498 - net_amount: 10 - x-merge-expands-to: JournalLine - journal_number: - type: string - nullable: true - description: Reference number for identifying journal entries. - maxLength: 70 - example: '42' - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - posting_status: - oneOf: - - $ref: '#/components/schemas/PostingStatusEnum' - - type: string - nullable: true - description: |- - The journal's posting status. - - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - example: POSTED - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the JournalEntry was generated in. - example: 655c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: AccountingPeriod - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's journal entry was created. - example: '2020-03-31T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's journal entry was updated. - example: '2020-03-31T00:00:00Z' - field_mappings: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"accounting_period": "AccountingPeriod", "applied_payments": - "PaymentLineItemWithPayment", "company": "CompanyInfo", "lines": "JournalLine", - "payments": "Payment", "tracking_categories": "TrackingCategory"}' - x-merge-category: accounting - JournalEntryEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/JournalEntryRequest' - required: - - model - x-merge-category: accounting - JournalEntryRequest: - type: object - description: |- - # The JournalEntry Object - ### Description - The `JournalEntry` object is used to get a record of all manually created entries made in a company’s general ledger. The journal line items for each journal entry should sum to zero. - - ### Usage Example - Fetch from the `GET JournalEntry` endpoint and view a company's journey entry. - properties: - transaction_date: - type: string - format: date-time - nullable: true - description: The journal entry's transaction date. - payments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Payment' - nullable: true - description: Array of `Payment` object IDs. - x-merge-expands-to: Payment - memo: - type: string - nullable: true - description: The journal entry's private note. - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The journal's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The journal entry's exchange rate. - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the journal entry belongs to. - x-merge-expands-to: CompanyInfo - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - x-merge-expands-to: TrackingCategory - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - lines: - type: array - items: - $ref: '#/components/schemas/JournalLineRequest' - x-merge-expands-to: JournalLine - journal_number: - type: string - nullable: true - description: Reference number for identifying journal entries. - maxLength: 70 - posting_status: - oneOf: - - $ref: '#/components/schemas/PostingStatusEnum' - - type: string - nullable: true - description: |- - The journal's posting status. - - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"accounting_period": "AccountingPeriod", "applied_payments": - "PaymentLineItemWithPayment", "company": "CompanyInfo", "lines": "JournalLine", - "payments": "Payment", "tracking_categories": "TrackingCategory"}' - x-merge-category: accounting - JournalEntryResponse: - type: object - properties: - model: - $ref: '#/components/schemas/JournalEntry' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - JournalLine: - type: object - description: |- - # The JournalLine Object - ### Description - The `JournalLine` object is used to represent a journal entry's line items. - - ### Usage Example - Fetch from the `GET JournalEntry` endpoint and view the journal entry's line items. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: Account - net_amount: - type: number - format: double - nullable: true - description: The value of the line item including taxes and other fees. - example: 25.54 - tracking_category: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - deprecated: true - x-merge-expands-to: TrackingCategory - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - d25d609b-945f-4762-b55a-1c8fb220c43c - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The journal line item's associated tracking categories. - x-merge-expands-to: TrackingCategory - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The journal line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - company: - type: string - format: uuid - nullable: true - description: The company the journal entry belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: - type: string - format: uuid - nullable: true - example: 123c8r35-5kf5-12x5-r833-99bwf35210b5 - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - contact: - type: string - format: uuid - nullable: true - example: d2d5ea3c-b032-11ec-b909-0242ac120002 - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - description: - type: string - nullable: true - description: The line's description. - example: Cash payment for lunch - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The journal line item's exchange rate. - example: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-nested-write-allowed: true - x-merge-expands: '{"account": "Account", "project": "Project", "tracking_categories": - "TrackingCategory", "tracking_category": "TrackingCategory"}' - x-merge-category: accounting - JournalLineRequest: - type: object - description: |- - # The JournalLine Object - ### Description - The `JournalLine` object is used to represent a journal entry's line items. - - ### Usage Example - Fetch from the `GET JournalEntry` endpoint and view the journal entry's line items. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: Account - net_amount: - type: number - format: double - nullable: true - description: The value of the line item including taxes and other fees. - example: 25.54 - tracking_category: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - deprecated: true - x-merge-expands-to: TrackingCategory - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - d25d609b-945f-4762-b55a-1c8fb220c43c - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The journal line item's associated tracking categories. - x-merge-expands-to: TrackingCategory - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The journal line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - company: - type: string - format: uuid - nullable: true - description: The company the journal entry belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: - type: string - format: uuid - nullable: true - example: 123c8r35-5kf5-12x5-r833-99bwf35210b5 - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - contact: - type: string - format: uuid - nullable: true - example: d2d5ea3c-b032-11ec-b909-0242ac120002 - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - description: - type: string - nullable: true - description: The line's description. - example: Cash payment for lunch - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The journal line item's exchange rate. - example: '2.9' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "project": "Project", "tracking_categories": - "TrackingCategory", "tracking_category": "TrackingCategory"}' - x-merge-category: accounting - LanguageEnum: - enum: - - en - - de - type: string - description: |- - * `en` - en - * `de` - de - x-merge-category: accounting - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: accounting - LinkToken: - type: object - properties: - link_token: - type: string - example: necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0 - integration_name: - type: string - example: Lever - magic_link_url: - type: string - example: https://link.merge.dev/asdfjkl12345jsndfgi2i83n - required: - - link_token - x-merge-category: accounting - LinkedAccountCommonModelScopeDeserializerRequest: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: accounting - LinkedAccountStatus: - type: object - properties: - linked_account_status: - type: string - can_make_request: - type: boolean - required: - - can_make_request - - linked_account_status - x-merge-category: accounting - MetaResponse: - type: object - properties: - request_schema: - type: object - additionalProperties: {} - example: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - type: object - additionalProperties: {} - status: - $ref: '#/components/schemas/LinkedAccountStatus' - example: - linked_account_status: COMPLETE - can_make_request: true - has_conditional_params: - type: boolean - has_required_linked_account_params: - type: boolean - required: - - has_conditional_params - - has_required_linked_account_params - - request_schema - x-merge-category: accounting - MethodEnum: - enum: - - GET - - OPTIONS - - HEAD - - POST - - PUT - - PATCH - - DELETE - type: string - description: |- - * `GET` - GET - * `OPTIONS` - OPTIONS - * `HEAD` - HEAD - * `POST` - POST - * `PUT` - PUT - * `PATCH` - PATCH - * `DELETE` - DELETE - x-merge-category: accounting - MethodTypeEnum: - enum: - - CREDIT_CARD - - DEBIT_CARD - - ACH - - CASH - - CHECK - type: string - description: |- - * `CREDIT_CARD` - CREDIT_CARD - * `DEBIT_CARD` - DEBIT_CARD - * `ACH` - ACH - * `CASH` - CASH - * `CHECK` - CHECK - x-merge-category: accounting - ModelOperation: - type: object - description: |- - # 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: - type: string - example: Candidate - available_operations: - type: array - items: - type: string - example: - - FETCH - - CREATE - required_post_parameters: - type: array - items: - type: string - example: - - remote_user_id - supported_fields: - type: array - items: - type: string - example: - - first_name - - last_name - - company - - title - required: - - available_operations - - model_name - - required_post_parameters - - supported_fields - x-merge-category: accounting - ModelPermissionDeserializer: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: accounting - ModelPermissionDeserializerRequest: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: accounting - MultipartFormFieldRequest: - type: object - description: |- - # 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 - minLength: 1 - description: The name of the form field - example: resume - data: - type: string - minLength: 1 - description: The data for the form field. - example: SW50ZWdyYXRlIGZhc3QKSW50ZWdyYXRlIG9uY2U= - encoding: - oneOf: - - $ref: '#/components/schemas/EncodingEnum' - nullable: true - default: RAW - description: |- - The encoding of the value of `data`. Defaults to `RAW` if not defined. - - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - example: BASE64 - file_name: - type: string - nullable: true - minLength: 1 - description: The file name of the form field, if the field is for a file. - example: resume.pdf - content_type: - type: string - nullable: true - minLength: 1 - description: The MIME type of the file, if the field is for a file. - example: application/pdf - required: - - data - - name - x-merge-category: accounting - PaginatedAccountDetailsAndActionsList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountDetailsAndActions' - x-merge-category: accounting - PaginatedAccountList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Account' - x-merge-category: accounting - PaginatedAccountingAttachmentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountingAttachment' - x-merge-category: accounting - PaginatedAccountingPeriodList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountingPeriod' - x-merge-category: accounting - PaginatedAuditLogEventList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AuditLogEvent' - x-merge-category: accounting - PaginatedBalanceSheetList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/BalanceSheet' - x-merge-category: accounting - PaginatedBankFeedAccountList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/BankFeedAccount' - x-merge-category: accounting - PaginatedBankFeedTransactionList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/BankFeedTransaction' - x-merge-category: accounting - PaginatedCashFlowStatementList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/CashFlowStatement' - x-merge-category: accounting - PaginatedCompanyInfoList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/CompanyInfo' - x-merge-category: accounting - PaginatedContactList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Contact' - x-merge-category: accounting - PaginatedCreditNoteList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/CreditNote' - x-merge-category: accounting - PaginatedEmployeeList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Employee' - x-merge-category: accounting - PaginatedExpenseList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Expense' - x-merge-category: accounting - PaginatedGeneralLedgerTransactionList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/GeneralLedgerTransaction' - x-merge-category: accounting - PaginatedIncomeStatementList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/IncomeStatement' - x-merge-category: accounting - PaginatedInvoiceList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Invoice' - x-merge-category: accounting - PaginatedIssueList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Issue' - x-merge-category: accounting - PaginatedItemList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Item' - x-merge-category: accounting - PaginatedJournalEntryList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/JournalEntry' - x-merge-category: accounting - PaginatedPaymentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Payment' - x-merge-category: accounting - PaginatedPaymentMethodList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/PaymentMethod' - x-merge-category: accounting - PaginatedPaymentTermList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/PaymentTerm' - x-merge-category: accounting - PaginatedProjectList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Project' - x-merge-category: accounting - PaginatedPurchaseOrderList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/PurchaseOrder' - x-merge-category: accounting - PaginatedRemoteFieldClassList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/RemoteFieldClass' - x-merge-category: accounting - PaginatedSyncStatusList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - x-merge-category: accounting - PaginatedTaxRateList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/TaxRate' - x-merge-category: accounting - PaginatedTrackingCategoryList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/TrackingCategory' - x-merge-category: accounting - PaginatedTransactionList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Transaction' - x-merge-category: accounting - PaginatedVendorCreditList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/VendorCredit' - x-merge-category: accounting - PatchedEditFieldMappingRequest: - type: object - properties: - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field_name - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - x-merge-category: accounting - PatchedInvoiceEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/InvoiceRequest' - required: - - model - x-merge-category: accounting - PatchedItemEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedItemRequestRequest' - required: - - model - x-merge-category: accounting - PatchedItemRequestRequest: - type: object - description: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. - - ### Usage Example - Fetch from the `LIST Items` endpoint and view a company's items. - properties: - name: - type: string - nullable: true - description: The item's name. - example: Pickleball Paddle - status: - oneOf: - - $ref: '#/components/schemas/Status7d1Enum' - - type: string - nullable: true - description: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - example: ACTIVE - type: - oneOf: - - $ref: '#/components/schemas/Type2bbEnum' - - type: string - nullable: true - description: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - example: INVENTORY - unit_price: - type: number - format: double - nullable: true - description: The item's unit price. - example: 10 - purchase_price: - type: number - format: double - nullable: true - description: The price at which the item is purchased from a vendor. - example: 25 - purchase_account: - type: string - format: uuid - nullable: true - description: References the default account used to record a purchase of - the item. - example: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - sales_account: - type: string - format: uuid - nullable: true - description: References the default account used to record a sale. - example: 3872b4c9-f5d2-4f3b-a66b-dfedbed42c49 - company: - type: string - format: uuid - nullable: true - description: The company the item belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - purchase_tax_rate: - type: string - format: uuid - nullable: true - description: The default purchase tax rate for this item. - example: 983e8f97-9qw2-34v9-p123-67bdf98740v5 - sales_tax_rate: - type: string - format: uuid - nullable: true - description: The default sales tax rate for this item. - example: 232c8f56-7se4-98f2-y334-12bdf89249f5 - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: accounting - PatchedPaymentEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedPaymentRequest' - required: - - model - x-merge-category: accounting - PatchedPaymentRequest: - type: object - description: |- - # The Payment Object - ### Description - The `Payment` object represents general payments made towards a specific transaction. - - ### Usage Example - Fetch from the `GET Payment` endpoint and view an invoice's payment. - properties: - transaction_date: - type: string - format: date-time - nullable: true - description: The payment's transaction date. - example: '2020-03-31T00:00:00Z' - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The supplier, or customer involved in the payment. - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The supplier’s or customer’s account in which the payment is - made. - example: d6e687d6-0c36-48a1-8114-35324b5cb38f - payment_method: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentMethod' - nullable: true - description: The method which this payment was made by. - example: 9394320-8864-2343-4343-9008789 - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The payment's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: FKP - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The payment's exchange rate. - example: '2.9' - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the payment belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - total_amount: - type: number - format: double - nullable: true - description: The total amount of money being paid to the supplier, or customer, - after taxes. - example: 50 - type: - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - type: string - nullable: true - description: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - example: ACCOUNTS_PAYABLE - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the Payment was generated in. - example: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - applied_to_lines: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentLineItemRequest' - description: A list of “Payment Applied to Lines” objects. - example: - - remote_id: '234' - applied_amount: '25' - related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa - related_object_type: INVOICE - applied_date: '2020-03-31T00:00:00Z' - - remote_id: '235' - applied_amount: '25' - related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 - related_object_type: CREDIT_NOTE - applied_date: '2020-03-31T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: accounting - Payment: - type: object - description: |- - # The Payment Object - ### Description - The `Payment` object represents general payments made towards a specific transaction. - - ### Usage Example - Fetch from the `GET Payment` endpoint and view an invoice's payment. - properties: - id: - type: string - format: uuid - readOnly: true - example: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '987300' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - transaction_date: - type: string - format: date-time - nullable: true - description: The payment's transaction date. - example: '2020-03-31T00:00:00Z' - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The supplier, or customer involved in the payment. - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Contact - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The supplier’s or customer’s account in which the payment is - made. - example: d6e687d6-0c36-48a1-8114-35324b5cb38f - x-merge-expands-to: Account - payment_method: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentMethod' - nullable: true - description: The method which this payment was made by. - example: 9394320-8864-2343-4343-9008789 - x-merge-expands-to: PaymentMethod - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The payment's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: FKP - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The payment's exchange rate. - example: '2.9' - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the payment belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - total_amount: - type: number - format: double - nullable: true - description: The total amount of money being paid to the supplier, or customer, - after taxes. - example: 50 - type: - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - type: string - nullable: true - description: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - example: ACCOUNTS_PAYABLE - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the Payment was generated in. - example: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - x-merge-expands-to: AccountingPeriod - applied_to_lines: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentLineItem' - description: A list of “Payment Applied to Lines” objects. - example: - - remote_id: '234' - applied_amount: '25' - related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa - related_object_type: INVOICE - applied_date: '2020-03-31T00:00:00Z' - - remote_id: '235' - applied_amount: '25' - related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 - related_object_type: CREDIT_NOTE - applied_date: '2020-03-31T00:00:00Z' - x-merge-expands-to: PaymentLineItem - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's payment entry was updated. - example: '2020-03-31T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account", "accounting_period": "AccountingPeriod", - "applied_to_lines": "PaymentLineItem", "company": "CompanyInfo", "contact": - "Contact", "payment_method": "PaymentMethod", "tracking_categories": "TrackingCategory"}' - x-merge-category: accounting - PaymentEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PaymentRequest' - required: - - model - x-merge-category: accounting - PaymentLineItem: - type: object - description: |- - # The PaymentLineItem Object - ### Description - The `PaymentLineItem` object is an applied-to-line on a `Payment` that can either be a `Invoice`, `CreditNote`, or `JournalEntry`. - - ### Usage Example - `Payment` will have a field called `applied-to-lines` which will be an array of `PaymentLineItemInternalMappingSerializer` objects that can either be a `Invoice`, `CreditNote`, or `JournalEntry`. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '234' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount being applied to the transaction. - example: '25' - applied_date: - type: string - format: date-time - nullable: true - description: The date the payment portion is applied. - example: '2020-03-31T00:00:00Z' - related_object_id: - type: string - format: uuid - description: The Merge ID of the transaction the payment portion is being - applied to. - example: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - related_object_type: - type: string - description: 'The type of transaction the payment portion is being applied - to. Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE.' - example: INVOICE - x-merge-nested-write-allowed: true - x-merge-category: accounting - PaymentLineItemRequest: - type: object - description: |- - # The PaymentLineItem Object - ### Description - The `PaymentLineItem` object is an applied-to-line on a `Payment` that can either be a `Invoice`, `CreditNote`, or `JournalEntry`. - - ### Usage Example - `Payment` will have a field called `applied-to-lines` which will be an array of `PaymentLineItemInternalMappingSerializer` objects that can either be a `Invoice`, `CreditNote`, or `JournalEntry`. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '234' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount being applied to the transaction. - example: '25' - applied_date: - type: string - format: date-time - nullable: true - description: The date the payment portion is applied. - example: '2020-03-31T00:00:00Z' - related_object_id: - type: string - format: uuid - description: The Merge ID of the transaction the payment portion is being - applied to. - example: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - related_object_type: - type: string - minLength: 1 - description: 'The type of transaction the payment portion is being applied - to. Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE.' - example: INVOICE - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: accounting - PaymentMethod: - type: object - description: |- - # The PaymentMethod Object - ### Description - The `PaymentMethod` object defines how a payment against an invoice is made. - - ### Usage Example - Fetch from the `GET PaymentMethod` endpoint and view payment method information. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - method_type: - oneOf: - - $ref: '#/components/schemas/MethodTypeEnum' - - type: string - description: |- - The type of the payment method. - - * `CREDIT_CARD` - CREDIT_CARD - * `DEBIT_CARD` - DEBIT_CARD - * `ACH` - ACH - * `CASH` - CASH - * `CHECK` - CHECK - example: CREDIT_CARD - name: - type: string - description: The payment method’s name - maxLength: 255 - example: John Smith's Credit Card - is_active: - type: boolean - description: '`True` if the payment method is active, `False` if not.' - example: true - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's payment method was updated. - example: '2021-09-15T00:00:00Z' - field_mappings: - type: object - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - required: - - method_type - - name - x-merge-category: accounting - PaymentRequest: - type: object - description: |- - # The Payment Object - ### Description - The `Payment` object represents general payments made towards a specific transaction. - - ### Usage Example - Fetch from the `GET Payment` endpoint and view an invoice's payment. - properties: - transaction_date: - type: string - format: date-time - nullable: true - description: The payment's transaction date. - example: '2020-03-31T00:00:00Z' - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The supplier, or customer involved in the payment. - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Contact - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The supplier’s or customer’s account in which the payment is - made. - example: d6e687d6-0c36-48a1-8114-35324b5cb38f - x-merge-expands-to: Account - payment_method: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentMethod' - nullable: true - description: The method which this payment was made by. - example: 9394320-8864-2343-4343-9008789 - x-merge-expands-to: PaymentMethod - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The payment's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: FKP - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The payment's exchange rate. - example: '2.9' - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the payment belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - total_amount: - type: number - format: double - nullable: true - description: The total amount of money being paid to the supplier, or customer, - after taxes. - example: 50 - type: - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - type: string - nullable: true - description: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - example: ACCOUNTS_PAYABLE - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the Payment was generated in. - example: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - x-merge-expands-to: AccountingPeriod - applied_to_lines: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentLineItemRequest' - description: A list of “Payment Applied to Lines” objects. - example: - - remote_id: '234' - applied_amount: 25 - related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa - related_object_type: INVOICE - applied_date: '2020-03-31T00:00:00Z' - - remote_id: '235' - applied_amount: 25 - related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 - related_object_type: CREDIT_NOTE - applied_date: '2020-03-31T00:00:00Z' - x-merge-expands-to: PaymentLineItem - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "accounting_period": "AccountingPeriod", - "applied_to_lines": "PaymentLineItem", "company": "CompanyInfo", "contact": - "Contact", "payment_method": "PaymentMethod", "tracking_categories": "TrackingCategory"}' - x-merge-category: accounting - PaymentResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Payment' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - PaymentTerm: - type: object - description: |- - # The PaymentTerm Object - ### Description - The `PaymentTerm` object is the agreed-upon conditions between a buyer and a seller that define the timing, - amount, and conditions under which payment for goods or services must be made. - - ### Usage Example - Fetch from the `GET PaymentTerm` endpoint and view payment term information. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - description: The name of the payment term. - maxLength: 255 - example: Net 30 - is_active: - type: boolean - description: '`True` if the payment term is active, `False` if not.' - example: true - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The subsidiary that the payment term belongs to. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: CompanyInfo - days_until_due: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The number of days after the invoice date that payment is due. - example: 30 - discount_days: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The number of days the invoice must be paid before discounts - expire. - example: 15 - remote_last_modified_at: - type: string - format: date-time - nullable: true - description: When the third party's payment term was modified. - example: '2024-10-16T00:00:00Z' - field_mappings: - type: object - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - required: - - name - x-merge-expands: '{"company": "CompanyInfo"}' - x-merge-category: accounting - PaymentTypeEnum: - enum: - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - type: string - description: |- - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - x-merge-category: accounting - PostingStatusEnum: - enum: - - UNPOSTED - - POSTED - type: string - description: |- - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - x-merge-category: accounting - Project: - type: object - description: |- - # The Project Object - ### Description - The `Project` object is used to track and manage time, costs, resources, and revenue for specific initiatives or work efforts. - It provides classification on transactions for allocating expenses, revenue, and activities to a specific project for financial reporting. - - ### Usage Example - Fetch from the `GET Project` endpoint and view project information. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - description: The project’s name - maxLength: 255 - example: Permissions Mapping - is_active: - type: boolean - description: '`True` if the project is active, `False` if the project is - not active.' - example: true - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The subsidiary that the project belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The supplier, or customer involved in the project. - example: d25d609b-945f-4762-b55a-1c8fb220c43c - x-merge-expands-to: Contact - field_mappings: - type: object - nullable: true - readOnly: true - additionalProperties: {} - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - required: - - name - x-merge-expands: '{"company": "CompanyInfo", "contact": "Contact"}' - x-merge-category: accounting - PurchaseOrder: - type: object - description: |- - # The PurchaseOrder Object - ### Description - A `PurchaseOrder` represents a request to purchase goods or services from a vendor. It outlines the details of the purchase, such as the items or services requested, quantities, prices, and delivery details. - - A `PurchaseOrder` is a crucial component of the procurement process, but does not typically result in any impact on the company’s general ledger. The general ledger is typically only affected when the `PurchaseOrder` is fulfilled as an *Accounts Payable* `Invoice` object (also known as a Bill). - - ### Usage Example - Fetch from the `LIST PurchaseOrders` endpoint and view a company's purchase orders. - properties: - id: - type: string - format: uuid - readOnly: true - example: 0048ea5b-911e-4dff-9364-92070dea62ff - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '239741' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/PurchaseOrderStatusEnum' - - type: string - nullable: true - description: |- - The purchase order's status. - - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - example: SUBMITTED - issue_date: - type: string - format: date-time - nullable: true - description: The purchase order's issue date. - example: '2020-03-31T00:00:00Z' - purchase_order_number: - type: string - nullable: true - description: The human-readable number of the purchase order. - maxLength: 100 - example: PO1234 - delivery_date: - type: string - format: date-time - nullable: true - description: The purchase order's delivery date. - example: '2020-04-15T00:00:00Z' - delivery_address: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Address' - nullable: true - description: The purchase order's delivery address. - example: - street_1: 2920 Broadway - street_2: 2nd Floor - city: New York - state: NY - country: US - zip_code: '10027' - x-merge-expands-to: Address - customer: - type: string - format: uuid - nullable: true - description: The contact making the purchase order. - example: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - vendor: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The party fulfilling the purchase order. - example: 2c22ce34-5c6e-4fc7-a594-7f26bb4cf78b - x-merge-expands-to: Contact - memo: - type: string - nullable: true - description: A memo attached to the purchase order. - example: private note - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the purchase order belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - total_amount: - type: number - format: double - nullable: true - description: The purchase order's total amount. - example: 260 - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The purchase order's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order's exchange rate. - example: '2.9' - payment_term: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentTerm' - nullable: true - description: The payment term that applies to this transaction. - example: 89d329de-825f-4ac6-8369-3c58b4e68bee - x-merge-expands-to: PaymentTerm - line_items: - type: array - items: - $ref: '#/components/schemas/PurchaseOrderLineItem' - readOnly: true - example: - - remote_id: '121222' - description: Pickleball paddles - unit_price: 25 - quantity: 10 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - item: 0958cbc6-6040-430a-848e-aafacbadf4ae - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: 10 - total_line_amount: 260 - currency: USD - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - - description: Pickleball Balls - unit_price: 1 - quantity: 10 - item: 249c9faa-3045-4a31-953b-8f22d3613301 - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: 10 - total_line_amount: 20 - x-merge-expands-to: PurchaseOrderLineItem - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the PurchaseOrder was generated - in. - example: 2c22ce34-5c6e-4fc7-a594-7f26bb4cf78b - x-merge-expands-to: AccountingPeriod - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's purchase order note was created. - example: '2020-03-31T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's purchase order note was updated. - example: '2020-03-31T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"accounting_period": "AccountingPeriod", "company": "CompanyInfo", - "delivery_address": "Address", "line_items": "PurchaseOrderLineItem", "payment_term": - "PaymentTerm", "tracking_categories": "TrackingCategory", "vendor": "Contact"}' - x-merge-category: accounting - PurchaseOrderEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PurchaseOrderRequest' - required: - - model - x-merge-category: accounting - PurchaseOrderLineItem: - type: object - description: |- - # The PurchaseOrderLineItem Object - ### Description - The `PurchaseOrderLineItem` object is used to represent a purchase order's line item. - - ### Usage Example - Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - description: - type: string - nullable: true - description: A description of the good being purchased. - example: Pickleball paddles - unit_price: - type: number - format: double - nullable: true - description: The line item's unit price. - example: 25 - quantity: - type: number - format: double - nullable: true - description: The line item's quantity. - example: 10 - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Item - account: - type: string - format: uuid - nullable: true - description: The purchase order line item's account. - tracking_category: - type: string - format: uuid - nullable: true - description: The purchase order line item's associated tracking category. - deprecated: true - tracking_categories: - type: array - items: - type: string - format: uuid - nullable: true - example: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The purchase order line item's associated tracking categories. - tax_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order line item's tax amount. - example: 10 - total_line_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order line item's total amount. - example: 260 - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The purchase order line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order line item's exchange rate. - example: '2.9' - company: - type: string - format: uuid - nullable: true - description: The company the purchase order line item belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-nested-write-allowed: true - x-merge-expands: '{"item": "Item"}' - x-merge-category: accounting - PurchaseOrderLineItemRequest: - type: object - description: |- - # The PurchaseOrderLineItem Object - ### Description - The `PurchaseOrderLineItem` object is used to represent a purchase order's line item. - - ### Usage Example - Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase orders. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - description: - type: string - nullable: true - description: A description of the good being purchased. - example: Pickleball paddles - unit_price: - type: number - format: double - nullable: true - description: The line item's unit price. - example: 25 - quantity: - type: number - format: double - nullable: true - description: The line item's quantity. - example: 10 - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Item - account: - type: string - format: uuid - nullable: true - description: The purchase order line item's account. - tracking_category: - type: string - format: uuid - nullable: true - description: The purchase order line item's associated tracking category. - deprecated: true - tracking_categories: - type: array - items: - type: string - format: uuid - nullable: true - example: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The purchase order line item's associated tracking categories. - tax_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order line item's tax amount. - example: 10 - total_line_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order line item's total amount. - example: 260 - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The purchase order line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order line item's exchange rate. - example: '2.9' - company: - type: string - format: uuid - nullable: true - description: The company the purchase order line item belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"item": "Item"}' - x-merge-category: accounting - PurchaseOrderRequest: - type: object - description: |- - # The PurchaseOrder Object - ### Description - The `PurchaseOrder` object is a record of request for a product or service between a buyer and seller. - - ### Usage Example - Fetch from the `LIST PurchaseOrders` endpoint and view a company's purchase orders. - properties: - status: - oneOf: - - $ref: '#/components/schemas/PurchaseOrderStatusEnum' - - type: string - nullable: true - description: |- - The purchase order's status. - - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - issue_date: - type: string - format: date-time - nullable: true - description: The purchase order's issue date. - delivery_date: - type: string - format: date-time - nullable: true - description: The purchase order's delivery date. - delivery_address: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Address' - nullable: true - description: The purchase order's delivery address. - x-merge-expands-to: Address - customer: - type: string - format: uuid - nullable: true - description: The contact making the purchase order. - vendor: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The party fulfilling the purchase order. - x-merge-expands-to: Contact - memo: - type: string - nullable: true - description: A memo attached to the purchase order. - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the purchase order belongs to. - x-merge-expands-to: CompanyInfo - total_amount: - type: number - format: double - nullable: true - description: The purchase order's total amount. - payment_term: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PaymentTerm' - nullable: true - description: The payment term that applies to this transaction. - x-merge-expands-to: PaymentTerm - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The purchase order's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The purchase order's exchange rate. - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - x-merge-expands-to: TrackingCategory - line_items: - type: array - items: - $ref: '#/components/schemas/PurchaseOrderLineItemRequest' - x-merge-expands-to: PurchaseOrderLineItem - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"accounting_period": "AccountingPeriod", "company": "CompanyInfo", - "delivery_address": "Address", "line_items": "PurchaseOrderLineItem", "payment_term": - "PaymentTerm", "tracking_categories": "TrackingCategory", "vendor": "Contact"}' - x-merge-category: accounting - PurchaseOrderResponse: - type: object - properties: - model: - $ref: '#/components/schemas/PurchaseOrder' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - PurchaseOrderStatusEnum: - enum: - - DRAFT - - SUBMITTED - - AUTHORIZED - - BILLED - - DELETED - type: string - description: |- - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - x-merge-category: accounting - RemoteData: - type: object - description: |- - # 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 - description: The third-party API path that is being called. - example: /platform-endpoint - data: - readOnly: true - description: The data returned from the third-party for this object in its - original, unnormalized format. - example: - - Varies by platform - required: - - path - x-merge-category: accounting - RemoteEndpointInfo: - type: object - properties: - method: - type: string - example: GET - url_path: - type: string - example: /example-url-path - field_traversal_path: - type: array - items: {} - example: - - example_key_name - required: - - field_traversal_path - - method - - url_path - x-merge-category: accounting - RemoteField: - type: object - properties: - remote_field_class: - oneOf: - - type: string - - $ref: '#/components/schemas/RemoteFieldClass' - x-merge-expands-to: RemoteFieldClass - value: - nullable: true - example: string - required: - - remote_field_class - x-merge-expands: '{"remote_field_class": "RemoteFieldClass"}' - x-merge-category: accounting - RemoteFieldAPI: - type: object - properties: - schema: - type: object - additionalProperties: {} - example: - type: string - remote_key_name: - type: string - example: example_remote_key_name - remote_endpoint_info: - $ref: '#/components/schemas/RemoteEndpointInfo' - example: - method: GET - url_path: /example-url-path - field_traversal_path: - - example_key_name - example_values: - type: array - items: {} - nullable: true - example: - - example - advanced_metadata: - allOf: - - $ref: '#/components/schemas/AdvancedMetadata' - nullable: true - coverage: - oneOf: - - type: integer - - type: number - format: double - nullable: true - readOnly: true - example: 0.33 - required: - - advanced_metadata - - remote_endpoint_info - - remote_key_name - - schema - x-merge-category: accounting - RemoteFieldAPIResponse: - type: object - properties: - Account: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - AccountingAttachment: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - BalanceSheet: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - CashFlowStatement: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - CompanyInfo: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Contact: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - IncomeStatement: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - CreditNote: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Item: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - PurchaseOrder: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - TrackingCategory: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - JournalEntry: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - TaxRate: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Invoice: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Payment: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Expense: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - VendorCredit: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Transaction: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - AccountingPeriod: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - GeneralLedgerTransaction: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - BankFeedAccount: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Employee: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - PaymentMethod: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Project: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - PaymentTerm: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - x-merge-category: accounting - RemoteFieldClass: - type: object - properties: - id: - type: string - display_name: - type: string - remote_key_name: - type: string - description: - type: string - is_custom: - type: boolean - is_required: - type: boolean - field_type: - $ref: '#/components/schemas/FieldTypeEnum' - field_format: - $ref: '#/components/schemas/FieldFormatEnum' - field_choices: - type: array - items: - type: string - item_schema: - $ref: '#/components/schemas/ItemSchema' - x-merge-category: accounting - RemoteFieldRequest: - type: object - properties: - remote_field_class: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteFieldClass' - example: b057d1d2-c204-4da8-a74c-c91d1a260614 - x-merge-expands-to: RemoteFieldClass - value: - nullable: true - example: string - required: - - remote_field_class - x-merge-expands: '{"remote_field_class": "RemoteFieldClass"}' - x-merge-category: accounting - RemoteKey: - type: object - description: |- - # 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: - type: string - example: Remote Deployment Key 1 - key: - type: string - example: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA - required: - - key - - name - x-merge-category: accounting - RemoteKeyForRegenerationRequest: - type: object - description: |- - # The RemoteKeyForRegeneration Object - ### Description - The `RemoteKeyForRegeneration` object is used to exchange an old remote key for a new one - - ### Usage Example - Post a `RemoteKeyForRegeneration` to swap out an old remote key for a new one - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: accounting - RemoteResponse: - type: object - description: |- - # 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: - type: string - example: GET - path: - type: string - example: /scooters - status: - type: integer - example: 200 - response: - example: - scooters: - - company: Lime - model: Gen 2.5 - - company: Bird - model: Bird Zero - response_headers: - type: object - additionalProperties: {} - example: - X-Page-Token: value - response_type: - allOf: - - $ref: '#/components/schemas/ResponseTypeEnum' - example: JSON - headers: - type: object - additionalProperties: {} - example: - EXTRA-HEADER: value - Authorization: - required: - - method - - path - - response - - status - x-merge-category: accounting - ReportItem: - type: object - description: |- - # The ReportItem Object - ### Description - The `ReportItem` object is used to represent a report item for a Balance Sheet, Cash Flow Statement or Profit and Loss Report. - - ### Usage Example - Fetch from the `GET BalanceSheet` endpoint and view the balance sheet's report items. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '10299' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The report item's name. - example: Revenue - value: - type: number - format: double - nullable: true - description: The report item's value. - example: 1000 - sub_items: - type: array - items: - type: object - additionalProperties: {} - readOnly: true - example: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - sub_items: [] - - remote_id: '10301' - name: Revenue - New York - value: 500 - sub_items: [] - company: - type: string - format: uuid - nullable: true - description: The company the report item belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: - type: boolean - description: 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/). - x-merge-nested-write-allowed: true - x-merge-category: accounting - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - type: string - description: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - x-merge-category: accounting - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - type: string - description: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - x-merge-category: accounting - RoleEnum: - enum: - - ADMIN - - DEVELOPER - - MEMBER - - API - - SYSTEM - - MERGE_TEAM - type: string - description: |- - * `ADMIN` - ADMIN - * `DEVELOPER` - DEVELOPER - * `MEMBER` - MEMBER - * `API` - API - * `SYSTEM` - SYSTEM - * `MERGE_TEAM` - MERGE_TEAM - x-merge-category: accounting - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - type: string - description: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - x-merge-category: accounting - Status7d1Enum: - enum: - - ACTIVE - - ARCHIVED - type: string - description: |- - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - x-merge-category: accounting - Status895Enum: - enum: - - ACTIVE - - INACTIVE - type: string - description: |- - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - x-merge-category: accounting - StatusFd5Enum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: accounting - SyncStatus: - type: object - description: |- - # 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: - type: string - example: Invoice - model_id: - type: string - example: accounting.Invoices - last_sync_start: - type: string - format: date-time - example: '2021-03-30T19:44:18.695973Z' - next_sync_start: - type: string - format: date-time - example: '2021-03-30T20:44:18.662942Z' - last_sync_result: - oneOf: - - $ref: '#/components/schemas/LastSyncResultEnum' - - type: string - example: DONE - last_sync_finished: - type: string - format: date-time - example: '2021-03-30T19:55:18.695973Z' - status: - oneOf: - - $ref: '#/components/schemas/StatusFd5Enum' - - type: string - example: SYNCING - is_initial_sync: - type: boolean - example: true - selective_sync_configurations_usage: - $ref: '#/components/schemas/SelectiveSyncConfigurationsUsageEnum' - required: - - is_initial_sync - - model_id - - model_name - - status - x-merge-sample-json: '{"model_name": "Candidate", "model_id": "ats.Candidate", - "last_sync_start": "2021-03-30T19:44:18.695973Z", "next_sync_start": "2021-03-30T20:44:18.662942Z", - "status": "SYNCING", "is_initial_sync": true}' - x-merge-category: accounting - TaxComponent: - type: object - description: |- - # The TaxRate Object - ### Description - The `TaxComponent` object is used to represent any sub-taxes that make up the `TaxRate`. - - ### Usage Example - Fetch from the `LIST TaxRates` endpoint and view tax components relevant to a tax rate. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '039111' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The tax rate’s name. - maxLength: 100 - example: Drink Tax Component - rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The tax component’s rate. - example: 15 - is_compound: - type: boolean - nullable: true - description: Returns True if the tax component is compound, False if not. - example: true - component_type: - oneOf: - - $ref: '#/components/schemas/ComponentTypeEnum' - - type: string - nullable: true - description: |- - Returns PURCHASE if the tax component corresponds to a purchase tax or SALES if the tax component corresponds to a sales tax. - - * `SALES` - SALES - * `PURCHASE` - PURCHASE - example: SALES - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-category: accounting - TaxRate: - type: object - description: |- - # The TaxRate Object - ### Description - The `TaxRate` object is used to represent a tax rate. - - ### Usage Example - Fetch from the `LIST TaxRates` endpoint and view tax rates relevant to a company. - properties: - id: - type: string - format: uuid - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '039111' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The subsidiary that the tax rate belongs to (in the case of - multi-entity systems). - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - code: - type: string - nullable: true - description: The tax code associated with this tax rate or group of tax - rates from the third-party platform. - maxLength: 100 - example: '890' - name: - type: string - nullable: true - description: The tax rate’s name. - maxLength: 100 - example: State tax rate - description: - type: string - nullable: true - description: The tax rate's description. - example: Sales Tax - status: - oneOf: - - $ref: '#/components/schemas/Status7d1Enum' - - type: string - nullable: true - description: |- - The tax rate’s status - `ACTIVE` if an active tax rate, `ARCHIVED` if not active. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - example: ACTIVE - country: - type: string - nullable: true - description: The country the tax rate is associated with. - maxLength: 100 - example: US - total_tax_rate: - type: number - format: double - nullable: true - description: The tax’s total tax rate - sum of the tax components (not compounded). - example: 15 - effective_tax_rate: - type: number - format: double - nullable: true - description: The tax rate’s effective tax rate - total amount of tax with - compounding. - example: 15 - tax_components: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TaxComponent' - example: - - remote_id: '039111' - is_compound: true - rate: 15 - component_type: SALES - name: Drink Tax Component - description: The related tax components of the tax rate. - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"company": "CompanyInfo"}' - x-merge-category: accounting - TrackingCategory: - type: object - description: |- - # The TrackingCategory Object - ### Description - A `TrackingCategory` object represents a categorization method used to classify transactions within an accounting platform. They are often used to group records for reporting and analysis purposes. The most common types of `TrackingCategories` are Classes and Departments. - - ### Usage Example - Fetch from the `GET TrackingCategory` endpoint and view a company's tracking category. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '948201' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The tracking category's name. - example: Marketing Department - status: - oneOf: - - $ref: '#/components/schemas/Status7d1Enum' - - type: string - nullable: true - description: |- - The tracking category's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - example: ACTIVE - category_type: - oneOf: - - $ref: '#/components/schemas/CategoryTypeEnum' - - type: string - nullable: true - description: |- - The tracking category’s type. - - * `CLASS` - CLASS - * `DEPARTMENT` - DEPARTMENT - example: DEPARTMENT - parent_category: - type: string - format: uuid - nullable: true - example: d25d609b-945f-4762-b55a-1c8fb220c43c - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the GeneralLedgerTransaction belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - x-merge-expands: '{"company": "CompanyInfo"}' - x-merge-category: accounting - Transaction: - type: object - description: |- - # The Transaction Object - ### Description - The `Transaction` common model includes records of all types of transactions that do not appear in other common models. The type of transaction can be identified through the type field. More specifically, it will contain all types of transactions outside of: - * __Credit Notes__ - * __Expenses__ - * __Invoices__ - * __Journal Entries__ - * __Payments__ - * __Purchase Orders__ - * __Vendor Credits__ - - ### Usage Example - Fetch from the `GET Transaction` endpoint and view a company's transactions. - properties: - id: - type: string - format: uuid - readOnly: true - example: 0048ea5b-911e-4dff-9364-92070dea62ff - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '239741' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - transaction_type: - type: string - nullable: true - description: The type of transaction, which can by any transaction object - not already included in Merge’s common model. - example: estimate - number: - type: string - nullable: true - description: The transaction's number used for identifying purposes. - example: '122' - transaction_date: - type: string - format: date-time - nullable: true - description: The date upon which the transaction occurred. - example: '2020-03-31T00:00:00Z' - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The transaction's account. - example: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - x-merge-expands-to: Account - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The contact to whom the transaction relates to. - example: 2c22ce34-5c6e-4fc7-a594-7f26bb4cf78b - x-merge-expands-to: Contact - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - total_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The total amount being paid after taxes. - example: 260 - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The transaction's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The transaction's exchange rate. - example: '2.9' - company: - type: string - format: uuid - nullable: true - description: The company the transaction belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - line_items: - type: array - items: - $ref: '#/components/schemas/TransactionLineItem' - readOnly: true - example: - - remote_id: '121222' - memo: Pickleball paddles - unit_price: '25.0' - quantity: '10.0' - item: 0958cbc6-6040-430a-848e-aafacbadf4ae - account: 2b38c085-2620-4269-b5ec-75dd9095ed2c - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - total_line_amount: 260 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - currency: USD - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - - memo: Pickleball balls - unit_price: 1 - quantity: 10 - item: 249c9faa-3045-4a31-953b-8f22d3613301 - account: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - total_line_amount: 20 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - x-merge-expands-to: TransactionLineItem - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the Transaction was generated in. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: AccountingPeriod - field_mappings: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-model-tooltip: - title: - content: A positive `net_amount` means the line represents a debit and a negative - `net_amount` represents a credit. - x-merge-expands: '{"account": "Account", "accounting_period": "AccountingPeriod", - "contact": "Contact", "line_items": "TransactionLineItem", "tracking_categories": - "TrackingCategory"}' - x-merge-category: accounting - TransactionCurrencyEnum: - enum: - - XUA - - AFN - - AFA - - ALL - - ALK - - DZD - - ADP - - AOA - - AOK - - AON - - AOR - - ARA - - ARS - - ARM - - ARP - - ARL - - AMD - - AWG - - AUD - - ATS - - AZN - - AZM - - BSD - - BHD - - BDT - - BBD - - BYN - - BYB - - BYR - - BEF - - BEC - - BEL - - BZD - - BMD - - BTN - - BOB - - BOL - - BOV - - BOP - - BAM - - BAD - - BAN - - BWP - - BRC - - BRZ - - BRE - - BRR - - BRN - - BRB - - BRL - - GBP - - BND - - BGL - - BGN - - BGO - - BGM - - BUK - - BIF - - XPF - - KHR - - CAD - - CVE - - KYD - - XAF - - CLE - - CLP - - CLF - - CNX - - CNY - - CNH - - COP - - COU - - KMF - - CDF - - CRC - - HRD - - HRK - - CUC - - CUP - - CYP - - CZK - - CSK - - DKK - - DJF - - DOP - - NLG - - XCD - - DDM - - ECS - - ECV - - EGP - - GQE - - ERN - - EEK - - ETB - - EUR - - XBA - - XEU - - XBB - - XBC - - XBD - - FKP - - FJD - - FIM - - FRF - - XFO - - XFU - - GMD - - GEK - - GEL - - DEM - - GHS - - GHC - - GIP - - XAU - - GRD - - GTQ - - GWP - - GNF - - GNS - - GYD - - HTG - - HNL - - HKD - - HUF - - IMP - - ISK - - ISJ - - INR - - IDR - - IRR - - IQD - - IEP - - ILS - - ILP - - ILR - - ITL - - JMD - - JPY - - JOD - - KZT - - KES - - KWD - - KGS - - LAK - - LVL - - LVR - - LBP - - LSL - - LRD - - LYD - - LTL - - LTT - - LUL - - LUC - - LUF - - MOP - - MKD - - MKN - - MGA - - MGF - - MWK - - MYR - - MVR - - MVP - - MLF - - MTL - - MTP - - MRU - - MRO - - MUR - - MXV - - MXN - - MXP - - MDC - - MDL - - MCF - - MNT - - MAD - - MAF - - MZE - - MZN - - MZM - - MMK - - NAD - - NPR - - ANG - - TWD - - NZD - - NIO - - NIC - - NGN - - KPW - - NOK - - OMR - - PKR - - XPD - - PAB - - PGK - - PYG - - PEI - - PEN - - PES - - PHP - - XPT - - PLN - - PLZ - - PTE - - GWE - - QAR - - XRE - - RHD - - RON - - ROL - - RUB - - RUR - - RWF - - SVC - - WST - - SAR - - RSD - - CSD - - SCR - - SLL - - XAG - - SGD - - SKK - - SIT - - SBD - - SOS - - ZAR - - ZAL - - KRH - - KRW - - KRO - - SSP - - SUR - - ESP - - ESA - - ESB - - XDR - - LKR - - SHP - - XSU - - SDD - - SDG - - SDP - - SRD - - SRG - - SZL - - SEK - - CHF - - SYP - - STN - - STD - - TVD - - TJR - - TJS - - TZS - - XTS - - THB - - XXX - - TPE - - TOP - - TTD - - TND - - TRY - - TRL - - TMT - - TMM - - USD - - USN - - USS - - UGX - - UGS - - UAH - - UAK - - AED - - UYW - - UYU - - UYP - - UYI - - UZS - - VUV - - VES - - VEB - - VEF - - VND - - VNN - - CHE - - CHW - - XOF - - YDD - - YER - - YUN - - YUD - - YUM - - YUR - - ZWN - - ZRN - - ZRZ - - ZMW - - ZMK - - ZWD - - ZWR - - ZWL - type: string - description: |- - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - x-merge-category: accounting - TransactionLineItem: - type: object - description: |- - # The TransactionLineItem Object - ### Description - The `TransactionLineItem` object is used to represent a transaction's line items. - - ### Usage Example - Fetch from the `GET TransactionLineItem` endpoint and view the transaction's line items. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - memo: - type: string - nullable: true - description: An internal note used by the business to clarify purpose of - the transaction. - example: Pickleball paddles - unit_price: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The line item's unit price. - example: '25.0' - quantity: - type: string - format: decimal - pattern: ^-?\d{0,24}(?:\.\d{0,8})?$ - nullable: true - description: The line item's quantity. - example: '10.0' - item: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Item' - nullable: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Item - account: - type: string - format: uuid - nullable: true - description: The line item's account. - example: 2b38c085-2620-4269-b5ec-75dd9095ed2c - tracking_category: - type: string - format: uuid - nullable: true - description: The line's associated tracking category. - deprecated: true - tracking_categories: - type: array - items: - type: string - format: uuid - nullable: true - example: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The transaction line item's associated tracking categories. - total_line_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The line item's total. - example: 260 - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The line item's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The line item's exchange rate. - example: '2.9' - company: - type: string - format: uuid - nullable: true - description: The company the line belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"item": "Item"}' - x-merge-category: accounting - Type2bbEnum: - enum: - - INVENTORY - - NON_INVENTORY - - SERVICE - - UNKNOWN - type: string - description: |- - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - x-merge-category: accounting - UnderlyingTransactionTypeEnum: - enum: - - INVOICE - - EXPENSE - - TRANSACTION - - JOURNAL_ENTRY - - PAYMENT - - VENDOR_CREDIT - - CREDIT_NOTE - type: string - description: |- - * `INVOICE` - INVOICE - * `EXPENSE` - EXPENSE - * `TRANSACTION` - TRANSACTION - * `JOURNAL_ENTRY` - JOURNAL_ENTRY - * `PAYMENT` - PAYMENT - * `VENDOR_CREDIT` - VENDOR_CREDIT - * `CREDIT_NOTE` - CREDIT_NOTE - x-merge-category: accounting - ValidationProblemSource: - type: object - properties: - pointer: - type: string - required: - - pointer - x-merge-category: accounting - VendorCredit: - type: object - description: |- - # The VendorCredit Object - ### Description - A `VendorCredit` is transaction issued by a vendor to the accounting company, indicating a reduction or cancellation of the amount owed to the vendor. It is most generally used as an adjustment note used to rectify errors, returns, or overpayments related to a purchasing transaction. A `VendorCredit` can be applied to `Accounts Payable` Invoices to decrease the overall amount of the `Invoice`. - - ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view a company's vendor credits. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - number: - type: string - nullable: true - description: The vendor credit's number. - example: '6' - transaction_date: - type: string - format: date-time - nullable: true - description: The vendor credit's transaction date. - example: '2020-03-31T00:00:00Z' - vendor: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The vendor that owes the gift or refund. - example: 3d263469-51a1-4766-9205-f6c997826be1 - x-merge-expands-to: Contact - total_amount: - type: number - format: double - nullable: true - description: The vendor credit's total amount. - example: 10000 - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The vendor credit's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The vendor credit's exchange rate. - example: '2.9' - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the vendor credit belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - lines: - type: array - items: - $ref: '#/components/schemas/VendorCreditLine' - readOnly: true - example: - - remote_id: '121222' - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - description: Gifted Merge Credit - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - - remote_id: '121223' - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: Refund for overpayment - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: VendorCreditLine - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - applied_to_lines: - type: array - items: - $ref: '#/components/schemas/VendorCreditApplyLineForVendorCredit' - description: A list of VendorCredit Applied to Lines objects. - example: - - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the VendorCredit was generated in. - example: 9b840d2-686a-465a-8a8e-7b028498f8e4 - x-merge-expands-to: AccountingPeriod - field_mappings: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"accounting_period": "AccountingPeriod", "company": "CompanyInfo", - "lines": "VendorCreditLine", "tracking_categories": "TrackingCategory", "vendor": - "Contact"}' - x-merge-category: accounting - VendorCreditApplyLineForInvoice: - type: object - description: |- - # The VendorCreditApplyLine Object - ### Description - The `VendorCreditApplyLine` object is used to represent a applied vendor credit. - - ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's applied to lines. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - vendor_credit: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/VendorCredit' - nullable: true - example: f776d7e886ebcc3c56ff31b5ab2608c10f9fd823 - x-merge-expands-to: VendorCredit - applied_date: - type: string - format: date-time - nullable: true - description: Date that the vendor credit is applied to the invoice. - example: '2020-03-31T00:00:00Z' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount of the VendorCredit applied to the invoice. - example: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"vendor_credit": "VendorCredit"}' - x-merge-category: accounting - VendorCreditApplyLineForVendorCredit: - type: object - description: |- - # The VendorCreditApplyLine Object - ### Description - The `VendorCreditApplyLine` object is used to represent a applied vendor credit. - - ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's applied to lines. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - invoice: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Invoice' - nullable: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Invoice - applied_date: - type: string - format: date-time - nullable: true - description: Date that the vendor credit is applied to the invoice. - example: '2020-03-31T00:00:00Z' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount of the VendorCredit applied to the invoice. - example: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"invoice": "Invoice"}' - x-merge-category: accounting - VendorCreditApplyLineForVendorCreditRequest: - type: object - description: |- - # The VendorCreditApplyLine Object - ### Description - The `VendorCreditApplyLine` object is used to represent a applied vendor credit. - - ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's applied to lines. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - invoice: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Invoice' - nullable: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - x-merge-expands-to: Invoice - applied_date: - type: string - format: date-time - nullable: true - description: Date that the vendor credit is applied to the invoice. - example: '2020-03-31T00:00:00Z' - applied_amount: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The amount of the VendorCredit applied to the invoice. - example: '2.9' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"invoice": "Invoice"}' - x-merge-category: accounting - VendorCreditEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/VendorCreditRequest' - required: - - model - x-merge-category: accounting - VendorCreditLine: - type: object - description: |- - # The VendorCreditLine Object - ### Description - The `VendorCreditLine` object is used to represent a vendor credit's line items. - - ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's line items. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - net_amount: - type: number - format: double - nullable: true - description: The full value of the credit. - example: 25.54 - tracking_category: - type: string - format: uuid - nullable: true - description: The line's associated tracking category. - deprecated: true - tracking_categories: - type: array - items: - type: string - format: uuid - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The vendor credit line item's associated tracking categories. - description: - type: string - nullable: true - description: The line's description. - example: Gifted Merge Credit - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The line's account. - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: Account - company: - type: string - format: uuid - nullable: true - description: The company the line belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - example: 908934-49j9-093f-0989-908923908 - x-merge-expands-to: Contact - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The vendor credit line item's exchange rate. - example: '2.9' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"account": "Account", "contact": "Contact", "project": "Project"}' - x-merge-category: accounting - VendorCreditLineRequest: - type: object - description: |- - # The VendorCreditLine Object - ### Description - The `VendorCreditLine` object is used to represent a vendor credit's line items. - - ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's line items. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '121222' - net_amount: - type: number - format: double - nullable: true - description: The full value of the credit. - example: 25.54 - tracking_category: - type: string - format: uuid - nullable: true - description: The line's associated tracking category. - deprecated: true - tracking_categories: - type: array - items: - type: string - format: uuid - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: The vendor credit line item's associated tracking categories. - description: - type: string - nullable: true - description: The line's description. - example: Gifted Merge Credit - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The line's account. - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: Account - company: - type: string - format: uuid - nullable: true - description: The company the line belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Project' - nullable: true - example: 22e65a5d-2df5-4e6e-884a-e538d0339000 - x-merge-expands-to: Project - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - example: 908934-49j9-093f-0989-908923908 - x-merge-expands-to: Contact - tax_rate: - type: string - format: uuid - nullable: true - example: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: The tax rate that applies to this line item. - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The vendor credit line item's exchange rate. - example: '2.9' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"account": "Account", "contact": "Contact", "project": "Project"}' - x-merge-category: accounting - VendorCreditRequest: - type: object - description: |- - # The VendorCredit Object - ### Description - A `VendorCredit` is transaction issued by a vendor to the accounting company, indicating a reduction or cancellation of the amount owed to the vendor. It is most generally used as an adjustment note used to rectify errors, returns, or overpayments related to a purchasing transaction. A `VendorCredit` can be applied to `Accounts Payable` Invoices to decrease the overall amount of the `Invoice`. - - ### Usage Example - Fetch from the `GET VendorCredit` endpoint and view a company's vendor credits. - properties: - number: - type: string - nullable: true - description: The vendor credit's number. - example: '6' - transaction_date: - type: string - format: date-time - nullable: true - description: The vendor credit's transaction date. - example: '2020-03-31T00:00:00Z' - vendor: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The vendor that owes the gift or refund. - example: 3d263469-51a1-4766-9205-f6c997826be1 - x-merge-expands-to: Contact - total_amount: - type: number - format: double - nullable: true - description: The vendor credit's total amount. - example: 10000 - currency: - oneOf: - - $ref: '#/components/schemas/TransactionCurrencyEnum' - - type: string - nullable: true - description: |- - The vendor credit's currency. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - exchange_rate: - type: string - format: decimal - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - nullable: true - description: The vendor credit's exchange rate. - example: '2.9' - inclusive_of_tax: - type: boolean - nullable: true - description: If the transaction is inclusive or exclusive of tax. `True` - if inclusive, `False` if exclusive. - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/CompanyInfo' - nullable: true - description: The company the vendor credit belongs to. - example: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - x-merge-expands-to: CompanyInfo - tracking_categories: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/TrackingCategory' - nullable: true - example: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - x-merge-expands-to: TrackingCategory - applied_to_lines: - type: array - items: - $ref: '#/components/schemas/VendorCreditApplyLineForVendorCreditRequest' - description: A list of VendorCredit Applied to Lines objects. - example: - - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - accounting_period: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AccountingPeriod' - nullable: true - description: The accounting period that the VendorCredit was generated in. - example: 9b840d2-686a-465a-8a8e-7b028498f8e4 - x-merge-expands-to: AccountingPeriod - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"accounting_period": "AccountingPeriod", "company": "CompanyInfo", - "lines": "VendorCreditLine", "tracking_categories": "TrackingCategory", "vendor": - "Contact"}' - x-merge-category: accounting - VendorCreditResponse: - type: object - properties: - model: - $ref: '#/components/schemas/VendorCredit' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: accounting - WarningValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /age - title: - type: string - example: Unrecognized Field - detail: - type: string - example: An unrecognized field, age, was passed in with request data. - problem_type: - type: string - example: UNRECOGNIZED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: accounting - WebhookReceiver: - type: object - properties: - event: - type: string - is_active: - type: boolean - key: - type: string - required: - - event - - is_active - x-merge-category: accounting - WebhookReceiverRequest: - type: object - properties: - event: - type: string - minLength: 1 - is_active: - type: boolean - key: - type: string - minLength: 1 - required: - - event - - is_active - x-merge-category: accounting - securitySchemes: - tokenAuth: - type: http - scheme: bearer - description: Token-based authentication with required prefix "Bearer" - x-fern-token-variable-name: api_key -servers: -- url: https://api.merge.dev/api/accounting/v1 - description: Production - x-fern-server-name: Production -- url: https://api-sandbox.merge.dev/api/accounting/v1 - description: Sandbox - x-fern-server-name: Sandbox -- url: https://api-eu.merge.dev/api/accounting/v1 - description: Production EU - x-fern-server-name: ProductionEU -- url: https://api-ap.merge.dev/api/accounting/v1 - description: Production APSE1 - x-fern-server-name: ProductionAPSE1 diff --git a/.mock/ats_v3.yml b/.mock/ats_v3.yml deleted file mode 100644 index c478403cd..000000000 --- a/.mock/ats_v3.yml +++ /dev/null @@ -1,10845 +0,0 @@ -openapi: 3.0.3 -info: - title: Merge ATS API - version: '1.0' - description: The unified API for building rich integrations with multiple Applicant - Tracking System platforms. - contact: - name: Merge Team - url: https://www.merge.dev/ - email: hello@merge.dev -paths: - /ats/v1/account-details: - get: - operationId: account_details_retrieve - description: Get details for a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - account-details - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountDetails' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/account-token/{public_token}: - get: - operationId: account_token_retrieve - description: Returns the account token for the end user with the provided public - token. - parameters: - - in: path - name: public_token - schema: - type: string - required: true - tags: - - account-token - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/activities: - get: - operationId: activities_list - description: Returns a list of `Activity` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - user - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandUser: - value: user - summary: Expand User - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - activity_type - - activity_type,visibility - - visibility - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesActivityType,Visibility: - value: activity_type,visibility - summary: Original Enum Values Activity_type, Visibility - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - activity_type - - activity_type,visibility - - visibility - description: 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) - examples: - OriginalEnumValuesActivityType,Visibility: - value: activity_type,visibility - summary: Original Enum Values Activity_type, Visibility - - in: query - name: user_id - schema: - type: string - description: If provided, will only return activities done by this user. - examples: - UserId: - summary: user_id - tags: - - activities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedActivityList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: activities_create - description: Creates an `Activity` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - activities - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ActivityEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ActivityEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ActivityResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/activities/{id}: - get: - operationId: activities_retrieve - description: Returns an `Activity` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - user - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandUser: - value: user - summary: Expand User - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - activity_type - - activity_type,visibility - - visibility - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesActivityType,Visibility: - value: activity_type,visibility - summary: Original Enum Values Activity_type, Visibility - - in: query - name: show_enum_origins - schema: - type: string - enum: - - activity_type - - activity_type,visibility - - visibility - description: 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) - examples: - OriginalEnumValuesActivityType,Visibility: - value: activity_type,visibility - summary: Original Enum Values Activity_type, Visibility - tags: - - activities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Activity' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/activities/meta/post: - get: - operationId: activities_meta_post_retrieve - description: Returns metadata for `Activity` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - activities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/applications: - get: - operationId: applications_list - description: Returns a list of `Application` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: candidate_id - schema: - type: string - description: If provided, will only return applications for this candidate. - examples: - CandidateId: - summary: candidate_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: credited_to_id - schema: - type: string - description: If provided, will only return applications credited to this user. - examples: - CreditedToId: - summary: credited_to_id - - in: query - name: current_stage_id - schema: - type: string - description: If provided, will only return applications at this interview - stage. - examples: - CurrentStageId: - summary: current_stage_id - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - candidate - - credited_to - - current_stage - - job - - offers - - reject_reason - - screening_question_answers - - screening_question_answers.question - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOffers,ScreeningQuestionAnswers,ScreeningQuestionAnswers.question,Candidate,Job,CreditedTo,CurrentStage,RejectReason: - value: - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - summary: Expand Offers, Screening_question_answers, Screening_question_answers.question, - Candidate, Job, Credited_to, Current_stage, Reject_reason - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: job_id - schema: - type: string - description: If provided, will only return applications for this job. - examples: - JobId: - summary: job_id - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: reject_reason_id - schema: - type: string - description: If provided, will only return applications with this reject reason. - examples: - RejectReasonId: - summary: reject_reason_id - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: source - schema: - type: string - nullable: true - description: If provided, will only return applications with this source. - tags: - - applications - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedApplicationList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: applications_create - description: | - Creates an `Application` object with the given values. - For certain integrations, but not all, our API detects duplicate candidates and will associate applications with existing records in the third-party. New candidates are created and automatically linked to the application. - - See our [Help Center article](https://help.merge.dev/en/articles/10012366-updates-to-post-applications-oct-2024) for detailed support per integration. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - applications - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ApplicationEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ApplicationEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ApplicationEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ApplicationResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/applications/{id}: - get: - operationId: applications_retrieve - description: Returns an `Application` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - candidate - - credited_to - - current_stage - - job - - offers - - reject_reason - - screening_question_answers - - screening_question_answers.question - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOffers,ScreeningQuestionAnswers,ScreeningQuestionAnswers.question,Candidate,Job,CreditedTo,CurrentStage,RejectReason: - value: - offers,screening_question_answers,screening_question_answers.question,candidate,job,credited_to,current_stage,reject_reason - summary: Expand Offers, Screening_question_answers, Screening_question_answers.question, - Candidate, Job, Credited_to, Current_stage, Reject_reason - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - applications - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Application' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/applications/{id}/change-stage: - post: - operationId: applications_change_stage_create - description: Updates the `current_stage` field of an `Application` object - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - applications - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateApplicationStageRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UpdateApplicationStageRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UpdateApplicationStageRequest' - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ApplicationResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/applications/meta/post: - get: - operationId: applications_meta_post_retrieve - description: Returns metadata for `Application` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: application_remote_template_id - schema: - type: string - description: The template ID associated with the nested application in the - request. - tags: - - applications - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/async-passthrough: - post: - operationId: async_passthrough_create - description: Asynchronously pull data from an endpoint not currently supported - by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - async-passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncPassthroughReciept' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/async-passthrough/{async_passthrough_receipt_id}: - get: - operationId: async_passthrough_retrieve - description: Retrieves data from earlier async-passthrough POST request - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: async_passthrough_receipt_id - schema: - type: string - format: uuid - required: true - tags: - - async-passthrough - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/RemoteResponse' - - type: string - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/attachments: - get: - operationId: attachments_list - description: Returns a list of `Attachment` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: candidate_id - schema: - type: string - description: If provided, will only return attachments for this candidate. - examples: - CandidateId: - summary: candidate_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - candidate - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCandidate: - value: candidate - summary: Expand Candidate - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - attachment_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesAttachmentType: - value: attachment_type - summary: Original Enum Values Attachment_type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - attachment_type - description: 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) - examples: - OriginalEnumValuesAttachmentType: - value: attachment_type - summary: Original Enum Values Attachment_type - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAttachmentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: attachments_create - description: Creates an `Attachment` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - attachments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AttachmentEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/AttachmentEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/AttachmentEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/AttachmentResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/attachments/{id}: - get: - operationId: attachments_retrieve - description: Returns an `Attachment` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - candidate - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCandidate: - value: candidate - summary: Expand Candidate - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - attachment_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesAttachmentType: - value: attachment_type - summary: Original Enum Values Attachment_type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - attachment_type - description: 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) - examples: - OriginalEnumValuesAttachmentType: - value: attachment_type - summary: Original Enum Values Attachment_type - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Attachment' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/attachments/meta/post: - get: - operationId: attachments_meta_post_retrieve - description: Returns metadata for `Attachment` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/audit-trail: - get: - operationId: audit_trail_list - description: Gets a list of audit trail events. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include audit trail events that occurred - before this time - - in: query - name: event_type - schema: - type: string - description: '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`' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include audit trail events that occurred - after this time - - in: query - name: user_email - schema: - type: string - description: 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. - tags: - - audit-trail - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAuditLogEventList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/available-actions: - get: - operationId: available_actions_retrieve - description: Returns a list of models and actions available for an account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - available-actions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AvailableActions' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/candidates: - get: - operationId: candidates_list - description: Returns a list of `Candidate` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email_addresses - schema: - type: string - description: If provided, will only return candidates with these email addresses; - multiple addresses can be separated by commas. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - applications - - attachments - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandApplications,Attachments: - value: applications,attachments - summary: Expand Applications, Attachments - explode: false - - in: query - name: first_name - schema: - type: string - nullable: true - description: If provided, will only return candidates with this first name. - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: last_name - schema: - type: string - nullable: true - description: If provided, will only return candidates with this last name. - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: tags - schema: - type: string - description: If provided, will only return candidates with these tags; multiple - tags can be separated by commas. - tags: - - candidates - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCandidateList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: candidates_create - description: Creates a `Candidate` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - candidates - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CandidateEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CandidateEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CandidateEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CandidateResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/candidates/{id}: - get: - operationId: candidates_retrieve - description: Returns a `Candidate` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - applications - - attachments - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandApplications,Attachments: - value: applications,attachments - summary: Expand Applications, Attachments - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - candidates - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Candidate' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: candidates_partial_update - description: Updates a `Candidate` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - candidates - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedCandidateEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedCandidateEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedCandidateEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CandidateResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/candidates/ignore/{model_id}: - post: - operationId: candidates_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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: model_id - schema: - type: string - format: uuid - required: true - tags: - - candidates - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-extra-tags: - - ignore-model - /ats/v1/candidates/meta/patch/{id}: - get: - operationId: candidates_meta_patch_retrieve - description: Returns metadata for `Candidate` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - candidates - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/candidates/meta/post: - get: - operationId: candidates_meta_post_retrieve - description: Returns metadata for `Candidate` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - candidates - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/default-scopes: - get: - operationId: default_scopes_retrieve - description: 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). - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/delete-account: - post: - operationId: delete_account_delete - description: Delete a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - delete-account - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/departments: - get: - operationId: departments_list - description: Returns a list of `Department` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - departments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDepartmentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/departments/{id}: - get: - operationId: departments_retrieve - description: Returns a `Department` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - departments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Department' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/eeocs: - get: - operationId: eeocs_list - description: Returns a list of `EEOC` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: candidate_id - schema: - type: string - description: If provided, will only return EEOC info for this candidate. - examples: - CandidateId: - summary: candidate_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - candidate - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCandidate: - value: candidate - summary: Expand Candidate - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - disability_status - - disability_status,gender - - disability_status,gender,race - - disability_status,gender,race,veteran_status - - disability_status,gender,veteran_status - - disability_status,race - - disability_status,race,veteran_status - - disability_status,veteran_status - - gender - - gender,race - - gender,race,veteran_status - - gender,veteran_status - - race - - race,veteran_status - - veteran_status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesDisabilityStatus,Gender,Race,VeteranStatus: - value: disability_status,gender,race,veteran_status - summary: Original Enum Values Disability_status, Gender, Race, Veteran_status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - disability_status - - disability_status,gender - - disability_status,gender,race - - disability_status,gender,race,veteran_status - - disability_status,gender,veteran_status - - disability_status,race - - disability_status,race,veteran_status - - disability_status,veteran_status - - gender - - gender,race - - gender,race,veteran_status - - gender,veteran_status - - race - - race,veteran_status - - veteran_status - description: 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) - examples: - OriginalEnumValuesDisabilityStatus,Gender,Race,VeteranStatus: - value: disability_status,gender,race,veteran_status - summary: Original Enum Values Disability_status, Gender, Race, Veteran_status - tags: - - eeocs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEEOCList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/eeocs/{id}: - get: - operationId: eeocs_retrieve - description: Returns an `EEOC` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - candidate - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandCandidate: - value: candidate - summary: Expand Candidate - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - disability_status - - disability_status,gender - - disability_status,gender,race - - disability_status,gender,race,veteran_status - - disability_status,gender,veteran_status - - disability_status,race - - disability_status,race,veteran_status - - disability_status,veteran_status - - gender - - gender,race - - gender,race,veteran_status - - gender,veteran_status - - race - - race,veteran_status - - veteran_status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesDisabilityStatus,Gender,Race,VeteranStatus: - value: disability_status,gender,race,veteran_status - summary: Original Enum Values Disability_status, Gender, Race, Veteran_status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - disability_status - - disability_status,gender - - disability_status,gender,race - - disability_status,gender,race,veteran_status - - disability_status,gender,veteran_status - - disability_status,race - - disability_status,race,veteran_status - - disability_status,veteran_status - - gender - - gender,race - - gender,race,veteran_status - - gender,veteran_status - - race - - race,veteran_status - - veteran_status - description: 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) - examples: - OriginalEnumValuesDisabilityStatus,Gender,Race,VeteranStatus: - value: disability_status,gender,race,veteran_status - summary: Original Enum Values Disability_status, Gender, Race, Veteran_status - tags: - - eeocs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EEOC' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/field-mappings: - get: - operationId: field_mappings_retrieve - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingApiInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: field_mappings_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/field-mappings/{field_mapping_id}: - patch: - operationId: field_mappings_partial_update - 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - delete: - operationId: field_mappings_destroy - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '204': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/generate-key: - post: - operationId: generate_key_create - description: Create a remote key. - tags: - - generate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/interviews: - get: - operationId: interviews_list - description: Returns a list of `ScheduledInterview` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: application_id - schema: - type: string - description: If provided, will only return interviews for this application. - examples: - ApplicationId: - summary: application_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - application - - interviewers - - job_interview_stage - - organizer - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandInterviewers,Organizer,Application,JobInterviewStage: - value: interviewers,organizer,application,job_interview_stage - summary: Expand Interviewers, Organizer, Application, Job_interview_stage - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: job_id - schema: - type: string - description: If provided, wll only return interviews organized for this job. - examples: - JobId: - summary: job_id - - in: query - name: job_interview_stage_id - schema: - type: string - description: If provided, will only return interviews at this stage. - examples: - JobInterviewStageId: - summary: job_interview_stage_id - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: organizer_id - schema: - type: string - description: If provided, will only return interviews organized by this user. - examples: - OrganizerId: - summary: organizer_id - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - interviews - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedScheduledInterviewList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: interviews_create - description: Creates a `ScheduledInterview` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - interviews - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ScheduledInterviewEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ScheduledInterviewEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ScheduledInterviewEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ScheduledInterviewResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/interviews/{id}: - get: - operationId: interviews_retrieve - description: Returns a `ScheduledInterview` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - application - - interviewers - - job_interview_stage - - organizer - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandInterviewers,Organizer,Application,JobInterviewStage: - value: interviewers,organizer,application,job_interview_stage - summary: Expand Interviewers, Organizer, Application, Job_interview_stage - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - interviews - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ScheduledInterview' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/interviews/meta/post: - get: - operationId: interviews_meta_post_retrieve - description: Returns metadata for `ScheduledInterview` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - interviews - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/issues: - get: - operationId: issues_list - description: Gets all issues for Organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: account_token - schema: - type: string - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred before this time - - in: query - name: end_user_organization_name - schema: - type: string - - in: query - name: first_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was after this datetime. - - in: query - name: first_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was before this datetime. - - in: query - name: include_muted - schema: - type: string - description: If true, will include muted issues - - in: query - name: integration_name - schema: - type: string - - in: query - name: last_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was after this datetime. - - in: query - name: last_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was before this datetime. - - in: query - name: linked_account_id - schema: - type: string - description: If provided, will only include issues pertaining to the linked - account passed in. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred after this time - - in: query - name: status - schema: - type: string - enum: - - ONGOING - - RESOLVED - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedIssueList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/issues/{id}: - get: - operationId: issues_retrieve - description: Get a specific issue. - parameters: - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Issue' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/job-interview-stages: - get: - operationId: job_interview_stages_list - description: Returns a list of `JobInterviewStage` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - job - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandJob: - value: job - summary: Expand Job - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: job_id - schema: - type: string - description: If provided, will only return interview stages for this job. - examples: - JobId: - summary: job_id - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - job-interview-stages - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedJobInterviewStageList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/job-interview-stages/{id}: - get: - operationId: job_interview_stages_retrieve - description: Returns a `JobInterviewStage` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - job - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandJob: - value: job - summary: Expand Job - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - job-interview-stages - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/JobInterviewStage' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/job-postings: - get: - operationId: job_postings_list - description: Returns a list of `JobPosting` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - job - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandJob: - value: job - summary: Expand Job - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: status - schema: - type: string - nullable: true - enum: - - CLOSED - - DRAFT - - INTERNAL - - PENDING - - PUBLISHED - description: |- - If provided, will only return Job Postings with this status. Options: ('PUBLISHED', 'CLOSED', 'DRAFT', 'INTERNAL', 'PENDING') - - * `PUBLISHED` - PUBLISHED - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `INTERNAL` - INTERNAL - * `PENDING` - PENDING - tags: - - job-postings - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedJobPostingList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/job-postings/{id}: - get: - operationId: job_postings_retrieve - description: Returns a `JobPosting` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - job - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandJob: - value: job - summary: Expand Job - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - job-postings - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/JobPosting' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/jobs: - get: - operationId: jobs_list - description: Returns a list of `Job` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: code - schema: - type: string - nullable: true - description: If provided, will only return jobs with this code. - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - departments - - hiring_managers - - job_postings - - offices - - recruiters - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandDepartments,Offices,HiringManagers,JobPostings,Recruiters: - value: departments,offices,hiring_managers,job_postings,recruiters - summary: Expand Departments, Offices, Hiring_managers, Job_postings, Recruiters - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: offices - schema: - type: string - description: If provided, will only return jobs for this office; multiple - offices can be separated by commas. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: status - schema: - type: string - nullable: true - enum: - - ARCHIVED - - CLOSED - - DRAFT - - OPEN - - PENDING - description: |- - If provided, will only return jobs with this status. Options: ('OPEN', 'CLOSED', 'DRAFT', 'ARCHIVED', 'PENDING') - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `ARCHIVED` - ARCHIVED - * `PENDING` - PENDING - tags: - - jobs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedJobList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/jobs/{id}: - get: - operationId: jobs_retrieve - description: Returns a `Job` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - departments - - hiring_managers - - job_postings - - offices - - recruiters - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandDepartments,Offices,HiringManagers,JobPostings,Recruiters: - value: departments,offices,hiring_managers,job_postings,recruiters - summary: Expand Departments, Offices, Hiring_managers, Job_postings, Recruiters - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - jobs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Job' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/jobs/{job_id}/screening-questions: - get: - operationId: jobs_screening_questions_list - description: Returns a list of `ScreeningQuestion` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - job - - options - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOptions,Job: - value: options,job - summary: Expand Options, Job - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: path - name: job_id - schema: - type: string - format: uuid - required: true - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - jobs - - screening-questions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedScreeningQuestionList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/link-token: - post: - operationId: link_token_create - description: Creates a link token to be used when linking a new end user. - tags: - - link-token - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LinkToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/linked-account-scopes: - get: - operationId: linked_account_scopes_retrieve - 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). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: linked_account_scopes_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ats/v1/linked-accounts: - get: - operationId: linked_accounts_list - description: List linked accounts for your organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: category - schema: - type: string - nullable: true - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - description: |- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` - - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_user_email_address - schema: - type: string - description: If provided, will only return linked accounts associated with - the given email address. - - in: query - name: end_user_organization_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given organization name. - - in: query - name: end_user_origin_id - schema: - type: string - description: If provided, will only return linked accounts associated with - the given origin ID. - - in: query - name: end_user_origin_ids - schema: - type: string - description: Comma-separated list of EndUser origin IDs, making it possible - to specify multiple EndUsers at once. - - in: query - name: id - schema: - type: string - format: uuid - - in: query - name: ids - schema: - type: string - description: Comma-separated list of LinkedAccount IDs, making it possible - to specify multiple LinkedAccounts at once. - - in: query - name: include_duplicates - schema: - type: boolean - description: 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. - - in: query - name: integration_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given integration name. - - in: query - name: is_test_account - schema: - type: string - description: If included, will only include test linked accounts. If not included, - will only include non-test linked accounts. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: status - schema: - type: string - description: 'Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, - `RELINK_NEEDED`' - tags: - - linked-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountDetailsAndActionsList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/offers: - get: - operationId: offers_list - description: Returns a list of `Offer` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: application_id - schema: - type: string - description: If provided, will only return offers for this application. - examples: - ApplicationId: - summary: application_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: creator_id - schema: - type: string - description: If provided, will only return offers created by this user. - examples: - CreatorId: - summary: creator_id - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - application - - creator - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandApplication,Creator: - value: application,creator - summary: Expand Application, Creator - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - offers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedOfferList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/offers/{id}: - get: - operationId: offers_retrieve - description: Returns an `Offer` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - application - - creator - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandApplication,Creator: - value: application,creator - summary: Expand Application, Creator - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - offers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Offer' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/offices: - get: - operationId: offices_list - description: Returns a list of `Office` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - offices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedOfficeList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/offices/{id}: - get: - operationId: offices_retrieve - description: Returns an `Office` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - offices - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Office' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/passthrough: - post: - operationId: passthrough_create - description: Pull data from an endpoint not currently supported by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/regenerate-key: - post: - operationId: regenerate_key_create - description: Exchange remote keys. - tags: - - regenerate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/reject-reasons: - get: - operationId: reject_reasons_list - description: Returns a list of `RejectReason` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - reject-reasons - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRejectReasonList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/reject-reasons/{id}: - get: - operationId: reject_reasons_retrieve - description: Returns a `RejectReason` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - reject-reasons - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RejectReason' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/remote-fields: - get: - operationId: 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: common_models - schema: - type: string - description: A comma seperated list of Common Model names. If included, will - only return Remote Fields for those Common Models. - - in: query - name: include_example_values - schema: - type: string - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/scorecards: - get: - operationId: scorecards_list - description: Returns a list of `Scorecard` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: application_id - schema: - type: string - description: If provided, will only return scorecards for this application. - examples: - ApplicationId: - summary: application_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - application - - interview - - interviewer - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandApplication,Interview,Interviewer: - value: application,interview,interviewer - summary: Expand Application, Interview, Interviewer - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: interview_id - schema: - type: string - description: If provided, will only return scorecards for this interview. - examples: - InterviewId: - summary: interview_id - - in: query - name: interviewer_id - schema: - type: string - description: If provided, will only return scorecards for this interviewer. - examples: - InterviewerId: - summary: interviewer_id - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - overall_recommendation - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesOverallRecommendation: - value: overall_recommendation - summary: Original Enum Values Overall_recommendation - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - overall_recommendation - description: 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) - examples: - OriginalEnumValuesOverallRecommendation: - value: overall_recommendation - summary: Original Enum Values Overall_recommendation - tags: - - scorecards - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedScorecardList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/scorecards/{id}: - get: - operationId: scorecards_retrieve - description: Returns a `Scorecard` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - application - - interview - - interviewer - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandApplication,Interview,Interviewer: - value: application,interview,interviewer - summary: Expand Application, Interview, Interviewer - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - overall_recommendation - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesOverallRecommendation: - value: overall_recommendation - summary: Original Enum Values Overall_recommendation - - in: query - name: show_enum_origins - schema: - type: string - enum: - - overall_recommendation - description: 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) - examples: - OriginalEnumValuesOverallRecommendation: - value: overall_recommendation - summary: Original Enum Values Overall_recommendation - tags: - - scorecards - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Scorecard' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/sync-status: - get: - operationId: 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). - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - sync-status - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedSyncStatusList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/sync-status/resync: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - force-resync - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/tags: - get: - operationId: tags_list - description: Returns a list of `Tag` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - tags - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTagList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/target-fields: - get: - operationId: target_fields_retrieve - 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalTargetFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/users: - get: - operationId: users_list - description: Returns a list of `RemoteUser` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email - schema: - type: string - format: email - nullable: true - description: If provided, will only return remote users with the given email - address - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - access_role - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesAccessRole: - value: access_role - summary: Original Enum Values Access_role - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - access_role - description: 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) - examples: - OriginalEnumValuesAccessRole: - value: access_role - summary: Original Enum Values Access_role - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteUserList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/users/{id}: - get: - operationId: users_retrieve - description: Returns a `RemoteUser` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - access_role - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesAccessRole: - value: access_role - summary: Original Enum Values Access_role - - in: query - name: show_enum_origins - schema: - type: string - enum: - - access_role - description: 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) - examples: - OriginalEnumValuesAccessRole: - value: access_role - summary: Original Enum Values Access_role - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteUser' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ats/v1/webhook-receivers: - get: - operationId: webhook_receivers_list - description: Returns a list of `WebhookReceiver` objects. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: webhook_receivers_create - description: Creates a `WebhookReceiver` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC -components: - schemas: - AccessRoleEnum: - enum: - - SUPER_ADMIN - - ADMIN - - TEAM_MEMBER - - LIMITED_TEAM_MEMBER - - INTERVIEWER - type: string - description: |- - * `SUPER_ADMIN` - SUPER_ADMIN - * `ADMIN` - ADMIN - * `TEAM_MEMBER` - TEAM_MEMBER - * `LIMITED_TEAM_MEMBER` - LIMITED_TEAM_MEMBER - * `INTERVIEWER` - INTERVIEWER - x-merge-category: ats - AccountDetails: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - integration: - type: string - readOnly: true - example: BambooHR - integration_slug: - type: string - readOnly: true - example: bamboohr - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - nullable: true - example: hris - end_user_origin_id: - type: string - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - end_user_organization_name: - type: string - readOnly: true - example: Waystar Royco - end_user_email_address: - type: string - format: email - readOnly: true - example: kendall.roy@waystar-royco.com - status: - type: string - readOnly: true - example: COMPLETE - webhook_listener_url: - type: string - format: uri - readOnly: true - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - readOnly: true - description: 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. - example: true - account_type: - type: string - readOnly: true - example: PRODUCTION - completed_at: - type: string - format: date-time - nullable: true - description: The time at which account completes the linking flow. - example: '2024-08-26T20:11:19.277118Z' - x-merge-category: ats - AccountDetailsAndActions: - type: object - description: |- - # 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: - type: string - example: e59b1821-f85c-4e28-a6b3-1804156f3563 - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - example: hris - status: - oneOf: - - $ref: '#/components/schemas/AccountDetailsAndActionsStatusEnum' - - type: string - example: INCOMPLETE - status_detail: - type: string - example: Invalid login credentials - end_user_origin_id: - type: string - example: 3ac95cde-6c7f-4eef-afec-be710b42308d - end_user_organization_name: - type: string - example: Foo Bar, LLC - end_user_email_address: - type: string - example: hradmin@foobar.dev - subdomain: - type: string - description: The tenant or domain the customer has provided access to. - example: foobar - webhook_listener_url: - type: string - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - description: 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. - example: true - integration: - $ref: '#/components/schemas/AccountDetailsAndActionsIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - 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: - type: string - example: PRODUCTION - completed_at: - type: string - format: date-time - example: '2024-08-26T20:11:19.277118Z' - required: - - account_type - - completed_at - - end_user_email_address - - end_user_organization_name - - id - - status - - webhook_listener_url - x-merge-sample-json: '{"id": "e59b1821-f85c-4e28-a6b3-1804156f3563", "category": - "hris", "status": "INCOMPLETE", "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", "webhook_listener_url": - "https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4", - "is_duplicate": true, "integration": {"name": "SAP SuccessFactors", "categories": - ["hris", "ats"], "image": "https://cdn.merge.dev/SuccessFactors_Logo.png", - "square_image": "https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg", "color": - "#F6A704", "slug": "sap-successfactors", "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"]}]}}' - x-merge-category: ats - AccountDetailsAndActionsIntegration: - type: object - properties: - name: - type: string - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - image: - type: string - square_image: - type: string - color: - type: string - slug: - type: string - passthrough_available: - type: boolean - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - required: - - categories - - color - - name - - passthrough_available - - slug - x-merge-category: ats - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - type: string - description: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - x-merge-category: ats - AccountIntegration: - type: object - properties: - name: - type: string - description: Company name. - abbreviated_name: - type: string - nullable: true - description: "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: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: Category or categories this integration belongs to. Multiple - categories should be comma separated, i.e. [ats, hris]. - readOnly: true - image: - type: string - format: uri - nullable: true - description: Company logo in rectangular shape. - square_image: - type: string - format: uri - nullable: true - description: Company logo in square shape. - color: - type: string - description: The color of this integration used for buttons and text throughout - the app and landing pages. Choose a darker, saturated color. - pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ - maxLength: 18 - slug: - type: string - readOnly: true - api_endpoints_to_documentation_urls: - type: object - additionalProperties: {} - description: "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: string - nullable: true - description: Setup guide URL for third party webhook creation. Exposed in - Merge Docs. - category_beta_status: - type: object - description: Category or categories this integration is in beta status for. - readOnly: true - required: - - name - x-merge-category: ats - AccountToken: - type: object - properties: - account_token: - type: string - example: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB - integration: - $ref: '#/components/schemas/AccountIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - id: - type: string - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - required: - - account_token - - id - - integration - x-merge-category: ats - Activity: - type: object - description: |- - # The Activity Object - ### Description - The `Activity` object is used to represent an activity for a candidate performed by a user. - ### Usage Example - Fetch from the `LIST Activities` endpoint and filter by `ID` to show all activities. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '198123' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - user: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The user that performed the action. - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: RemoteUser - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's activity was created. - example: '2021-10-15T00:00:00Z' - activity_type: - oneOf: - - $ref: '#/components/schemas/ActivityTypeEnum' - - type: string - nullable: true - description: |- - The activity's type. - - * `NOTE` - NOTE - * `EMAIL` - EMAIL - * `OTHER` - OTHER - example: NOTE - subject: - type: string - nullable: true - description: The activity's subject. - example: Gil Feig's interview - body: - type: string - nullable: true - description: The activity's body. - example: Candidate loves integrations! - visibility: - oneOf: - - $ref: '#/components/schemas/VisibilityEnum' - - type: string - nullable: true - description: |- - The activity's visibility. - - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - example: PRIVATE - candidate: - type: string - format: uuid - nullable: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"user": "RemoteUser"}' - x-merge-category: ats - ActivityEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ActivityRequest' - remote_user_id: - type: string - required: - - model - - remote_user_id - x-merge-category: ats - ActivityRequest: - type: object - description: |- - # The Activity Object - ### Description - The `Activity` object is used to represent an activity for a candidate performed by a user. - ### Usage Example - Fetch from the `LIST Activities` endpoint and filter by `ID` to show all activities. - properties: - user: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The user that performed the action. - example: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - x-merge-expands-to: RemoteUser - activity_type: - nullable: true - description: |- - The activity's type. - - * `NOTE` - NOTE - * `EMAIL` - EMAIL - * `OTHER` - OTHER - example: NOTE - $ref: '#/components/schemas/ActivityTypeEnum' - subject: - type: string - nullable: true - description: The activity's subject. - example: Gil Feig's interview - body: - type: string - nullable: true - description: The activity's body. - example: Candidate loves integrations! - visibility: - oneOf: - - $ref: '#/components/schemas/VisibilityEnum' - - type: string - nullable: true - description: |- - The activity's visibility. - - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - example: PRIVATE - candidate: - type: string - format: uuid - nullable: true - example: 550e8400-e29b-41d4-a716-446655440000 - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"user": "RemoteUser"}' - x-merge-category: ats - ActivityResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Activity' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ats - ActivityTypeEnum: - enum: - - NOTE - - EMAIL - - OTHER - type: string - description: |- - * `NOTE` - NOTE - * `EMAIL` - EMAIL - * `OTHER` - OTHER - x-merge-category: ats - AdvancedMetadata: - type: object - properties: - id: - type: string - format: uuid - display_name: - type: string - description: - type: string - is_required: - type: boolean - is_custom: - type: boolean - field_choices: - type: array - items: {} - required: - - id - x-merge-category: ats - Application: - type: object - description: |- - # The Application Object - ### Description - The Application Object is used to represent a candidate's journey through a particular Job's recruiting process. If a Candidate applies for multiple Jobs, there will be a separate Application for each Job if the third-party integration allows it. - - ### Usage Example - Fetch from the `LIST Applications` endpoint and filter by `ID` to show all applications. - properties: - id: - type: string - format: uuid - readOnly: true - example: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '98796' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - candidate: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Candidate' - nullable: true - description: The candidate applying. - example: 2872ba14-4084-492b-be96-e5eee6fc33ef - x-merge-expands-to: Candidate - job: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Job' - nullable: true - description: The job being applied for. - example: 52bf9b5e-0beb-4f6f-8a72-cd4dca7ca633 - x-merge-expands-to: Job - applied_at: - type: string - format: date-time - nullable: true - description: When the application was submitted. - example: '2021-10-15T00:00:00Z' - rejected_at: - type: string - format: date-time - nullable: true - description: When the application was rejected. - example: '2021-11-15T00:00:00Z' - offers: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Offer' - nullable: true - example: - - e9b5c11d-c588-468e-8567-cd6992e42b62 - x-merge-expands-to: Offer - source: - type: string - nullable: true - description: The application's source. - example: Campus recruiting event - credited_to: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The user credited for this application. - example: 58166795-8d68-4b30-9bfb-bfd402479484 - x-merge-expands-to: RemoteUser - screening_question_answers: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/ScreeningQuestionAnswer' - example: - - question: 0238cbc6-6040-430a-848e-aaiehfhdbadf4ae - answer: 5+ years experience - - question: 59982bf6-7c54-4ff8-ab60-ced0bb644b84 - answer: New york city - x-merge-expands-to: ScreeningQuestionAnswer - current_stage: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/JobInterviewStage' - nullable: true - description: The application's current stage. - example: d578dfdc-7b0a-4ab6-a2b0-4b40f20eb9ea - x-merge-expands-to: JobInterviewStage - reject_reason: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RejectReason' - nullable: true - description: The application's reason for rejection. - example: 59b25f2b-da02-40f5-9656-9fa0db555784 - x-merge-expands-to: RejectReason - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /candidacies - data: - - Varies by platform - x-merge-nested-write-allowed: true - x-merge-expands: '{"candidate": "Candidate", "credited_to": "RemoteUser", "current_stage": - "JobInterviewStage", "job": "Job", "offers": "Offer", "reject_reason": "RejectReason", - "screening_question_answers": "ScreeningQuestionAnswer", "screening_question_answers.question": - "ScreeningQuestion"}' - x-merge-category: ats - ApplicationEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ApplicationRequest' - remote_user_id: - type: string - required: - - model - - remote_user_id - x-merge-category: ats - ApplicationRequest: - type: object - description: |- - # The Application Object - ### Description - The Application Object is used to represent a candidate's journey through a particular Job's recruiting process. If a Candidate applies for multiple Jobs, there will be a separate Application for each Job if the third-party integration allows it. - - ### Usage Example - Fetch from the `LIST Applications` endpoint and filter by `ID` to show all applications. - properties: - candidate: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Candidate' - nullable: true - description: The candidate applying. - example: 2872ba14-4084-492b-be96-e5eee6fc33ef - x-merge-expands-to: Candidate - job: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Job' - nullable: true - description: The job being applied for. - example: 52bf9b5e-0beb-4f6f-8a72-cd4dca7ca633 - x-merge-expands-to: Job - applied_at: - type: string - format: date-time - nullable: true - description: When the application was submitted. - example: '2021-10-15T00:00:00Z' - rejected_at: - type: string - format: date-time - nullable: true - description: When the application was rejected. - example: '2021-11-15T00:00:00Z' - offers: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Offer' - nullable: true - example: - - e9b5c11d-c588-468e-8567-cd6992e42b62 - x-merge-expands-to: Offer - source: - type: string - nullable: true - description: The application's source. - example: Campus recruiting event - credited_to: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The user credited for this application. - example: 58166795-8d68-4b30-9bfb-bfd402479484 - x-merge-expands-to: RemoteUser - screening_question_answers: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/ScreeningQuestionAnswerRequest' - example: - - question: 0238cbc6-6040-430a-848e-aaiehfhdbadf4ae - answer: 5+ years experience - - question: 59982bf6-7c54-4ff8-ab60-ced0bb644b84 - answer: New york city - x-merge-expands-to: ScreeningQuestionAnswer - current_stage: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/JobInterviewStage' - nullable: true - description: The application's current stage. - example: d578dfdc-7b0a-4ab6-a2b0-4b40f20eb9ea - x-merge-expands-to: JobInterviewStage - reject_reason: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RejectReason' - nullable: true - description: The application's reason for rejection. - example: 59b25f2b-da02-40f5-9656-9fa0db555784 - x-merge-expands-to: RejectReason - remote_template_id: - type: string - writeOnly: true - nullable: true - minLength: 1 - example: '92830948203' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"candidate": "Candidate", "credited_to": "RemoteUser", "current_stage": - "JobInterviewStage", "job": "Job", "offers": "Offer", "reject_reason": "RejectReason", - "screening_question_answers": "ScreeningQuestionAnswer", "screening_question_answers.question": - "ScreeningQuestion"}' - x-merge-category: ats - ApplicationResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Application' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ats - AsyncPassthroughReciept: - type: object - properties: - async_passthrough_receipt_id: - type: string - format: uuid - example: fd29020f-2695-445e-922e-dcd5e81903fd - required: - - async_passthrough_receipt_id - x-merge-category: ats - Attachment: - type: object - description: |- - # The Attachment Object - ### Description - The `Attachment` object is used to represent a file attached to a candidate. - ### Usage Example - Fetch from the `LIST Attachments` endpoint and view attachments accessible by a company. - properties: - id: - type: string - format: uuid - readOnly: true - example: c640b80b-fac9-409f-aa19-1f9221aec445 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '11167' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - file_name: - type: string - nullable: true - description: The attachment's name. - example: Candidate Resume - file_url: - type: string - format: uri - nullable: true - maxLength: 2000 - example: http://alturl.com/p749b - description: The attachment's url. - candidate: - type: string - format: uuid - nullable: true - description: '' - example: 2872ba14-4084-492b-be96-e5eee6fc33ef - attachment_type: - oneOf: - - $ref: '#/components/schemas/AttachmentTypeEnum' - - type: string - nullable: true - description: |- - The attachment's type. - - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - example: RESUME - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /attachments - data: - - Varies by platform - x-merge-nested-write-allowed: true - x-merge-expands: '{"ticket": "Ticket"}' - x-merge-category: ats - AttachmentEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/AttachmentRequest' - remote_user_id: - type: string - required: - - model - - remote_user_id - x-merge-category: ats - AttachmentRequest: - type: object - description: |- - # The Attachment Object - ### Description - The `Attachment` object is used to represent a file attached to a candidate. - ### Usage Example - Fetch from the `LIST Attachments` endpoint and view attachments accessible by a company. - properties: - file_name: - type: string - nullable: true - description: The attachment's name. - example: Candidate Resume - file_url: - type: string - format: uri - nullable: true - maxLength: 2000 - example: http://alturl.com/p749b - description: The attachment's url. - candidate: - type: string - format: uuid - nullable: true - description: '' - example: 2872ba14-4084-492b-be96-e5eee6fc33ef - attachment_type: - oneOf: - - $ref: '#/components/schemas/AttachmentTypeEnum' - - type: string - nullable: true - description: |- - The attachment's type. - - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - example: RESUME - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"ticket": "Ticket"}' - x-merge-category: ats - AttachmentResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Attachment' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ats - AttachmentTypeEnum: - enum: - - RESUME - - COVER_LETTER - - OFFER_LETTER - - OTHER - type: string - description: |- - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - x-merge-category: ats - AuditLogEvent: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: b5ceea2a-7171-47ce-8090-165cfce5572c - user_name: - type: string - nullable: true - description: The User's full name at the time of this Event occurring. - maxLength: 200 - example: Gil Feig - user_email: - type: string - format: email - nullable: true - description: The User's email at the time of this Event occurring. - maxLength: 254 - example: hello@merge.dev - role: - oneOf: - - $ref: '#/components/schemas/RoleEnum' - - type: string - description: |- - 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 - example: ADMIN - ip_address: - type: string - maxLength: 45 - example: 192.0.2.123 - event_type: - oneOf: - - $ref: '#/components/schemas/EventTypeEnum' - - type: string - description: |- - 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 - example: CHANGED_SCOPES - event_description: - type: string - example: Organization-wide Scopes for model hris.Employee updated from Read - to Read+Write - created_at: - type: string - format: date-time - readOnly: true - required: - - event_description - - event_type - - ip_address - - role - x-merge-category: ats - AvailableActions: - type: object - description: |- - # 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: - $ref: '#/components/schemas/AccountIntegration' - example: - name: Lever - categories: - - ats - image: https://merge-api-production.s3.amazonaws.com/media/Lever_Logo.png - square_image: https://merge-api-production.s3.amazonaws.com/media/Lever_Square_Logo.png - color: '#262A34' - is_in_beta: 'true' - api_endpoints_to_documentation_urls: "{'GET': [('/common-model-scopes', - 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve')], - 'POST': []}" - passthrough_available: - type: boolean - example: true - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - example: - - model_name: Candidate - available_operations: - - FETCH - - CREATE - required_post_parameters: - - remote_user_id - supported_fields: - - first_name - - last_name - - company - - title - required: - - integration - - passthrough_available - x-merge-category: ats - Candidate: - type: object - description: |- - # The Candidate Object - ### Description - The `Candidate` object is used to represent profile information about a given Candidate. Because it is specific to a Candidate, this information stays constant across applications. - ### Usage Example - Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all candidates. - properties: - id: - type: string - format: uuid - readOnly: true - example: 521b18c2-4d01-4297-b451-19858d07c133 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '21198' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - first_name: - type: string - nullable: true - description: The candidate's first name. - example: Gil - last_name: - type: string - nullable: true - description: The candidate's last name. - example: Feig - company: - type: string - nullable: true - description: The candidate's current company. - example: Columbia Dining App. - title: - type: string - nullable: true - description: The candidate's current title. - example: Software Engineer - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's candidate was created. - example: '2021-10-15T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's candidate was updated. - example: '2021-10-16T00:00:00Z' - last_interaction_at: - type: string - format: date-time - nullable: true - description: When the most recent interaction with the candidate occurred. - example: '2021-10-17T00:00:00Z' - is_private: - type: boolean - nullable: true - description: Whether or not the candidate is private. - example: true - can_email: - type: boolean - nullable: true - description: Whether or not the candidate can be emailed. - example: true - locations: - type: array - items: - type: string - nullable: true - description: The candidate's locations. - nullable: true - description: The candidate's locations. - example: - - San Francisco - - New York - - Miami - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumber' - example: - - value: '+1234567890' - phone_number_type: MOBILE - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddress' - example: - - value: hello@merge.dev - email_address_type: PERSONAL - urls: - type: array - items: - $ref: '#/components/schemas/Url' - example: - - value: http://alturl.com/p749b - url_type: BLOG - tags: - type: array - items: - type: string - nullable: true - description: The tag's name. - example: - - High-Priority - description: Array of `Tag` names as strings. - applications: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Application' - nullable: true - example: - - 29eb9867-ce2a-403f-b8ce-f2844b89f078 - - b4d08e5c-de00-4d64-a29f-66addac9af99 - - 4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56 - description: Array of `Application` object IDs. - x-merge-expands-to: Application - attachments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Attachment' - nullable: true - example: - - bea08964-32b4-4a20-8bb4-2612ba09de1d - description: Array of `Attachment` object IDs. - x-merge-expands-to: Attachment - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /candidates - data: - - Varies by platform - x-merge-nested-write-allowed: true - x-merge-expands: '{"applications": "Application", "attachments": "Attachment"}' - x-merge-category: ats - CandidateEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/CandidateRequest' - remote_user_id: - type: string - required: - - model - - remote_user_id - x-merge-category: ats - CandidateRequest: - type: object - description: |- - # The Candidate Object - ### Description - The `Candidate` object is used to represent profile information about a given Candidate. Because it is specific to a Candidate, this information stays constant across applications. - ### Usage Example - Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all candidates. - properties: - first_name: - type: string - nullable: true - description: The candidate's first name. - example: Gil - last_name: - type: string - nullable: true - description: The candidate's last name. - example: Feig - company: - type: string - nullable: true - description: The candidate's current company. - example: Columbia Dining App. - title: - type: string - nullable: true - description: The candidate's current title. - example: Software Engineer - last_interaction_at: - type: string - format: date-time - nullable: true - description: When the most recent interaction with the candidate occurred. - example: '2021-10-17T00:00:00Z' - is_private: - type: boolean - nullable: true - description: Whether or not the candidate is private. - example: true - can_email: - type: boolean - nullable: true - description: Whether or not the candidate can be emailed. - example: true - locations: - type: array - items: - type: string - nullable: true - description: The candidate's locations. - nullable: true - description: The candidate's locations. - example: - - San Francisco - - New York - - Miami - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumberRequest' - example: - - value: '+1234567890' - phone_number_type: MOBILE - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddressRequest' - example: - - value: hello@merge.dev - email_address_type: PERSONAL - urls: - type: array - items: - $ref: '#/components/schemas/UrlRequest' - example: - - value: http://alturl.com/p749b - url_type: BLOG - tags: - type: array - items: - type: string - nullable: true - description: The tag's name. - example: - - High-Priority - description: Array of `Tag` names as strings. - applications: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Application' - nullable: true - example: - - 29eb9867-ce2a-403f-b8ce-f2844b89f078 - - b4d08e5c-de00-4d64-a29f-66addac9af99 - - 4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56 - description: Array of `Application` object IDs. - x-merge-expands-to: Application - attachments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Attachment' - nullable: true - example: - - bea08964-32b4-4a20-8bb4-2612ba09de1d - description: Array of `Attachment` object IDs. - x-merge-expands-to: Attachment - remote_template_id: - type: string - writeOnly: true - nullable: true - minLength: 1 - example: '92830948203' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"applications": "Application", "attachments": "Attachment"}' - x-merge-category: ats - CandidateResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Candidate' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ats - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: ats - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: ats - CommonModelScopeAPI: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializer' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: ats - CommonModelScopesBodyRequest: - type: object - properties: - model_id: - type: string - minLength: 1 - example: hris.Employee - enabled_actions: - type: array - items: - $ref: '#/components/schemas/EnabledActionsEnum' - example: - - READ - - WRITE - disabled_fields: - type: array - items: - type: string - minLength: 1 - example: - - first_name - required: - - disabled_fields - - enabled_actions - - model_id - x-merge-category: ats - CreateFieldMappingRequest: - type: object - properties: - target_field_name: - type: string - minLength: 1 - description: The name of the target field you want this remote field to - map to. - example: example_target_field_name - target_field_description: - type: string - minLength: 1 - description: The description of the target field you want this remote field - to map to. - example: this is a example description of the target field - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - common_model_name: - type: string - minLength: 1 - description: The name of the Common Model that the remote field corresponds - to in a given category. - example: ExampleCommonModel - required: - - common_model_name - - remote_field_traversal_path - - remote_method - - remote_url_path - - target_field_description - - target_field_name - x-merge-category: ats - DataPassthroughRequest: - type: object - description: |- - # 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: - allOf: - - $ref: '#/components/schemas/MethodEnum' - example: POST - path: - type: string - minLength: 1 - description: The path of the request in the third party's platform. - example: /scooters - base_url_override: - type: string - nullable: true - minLength: 1 - description: An optional override of the third party's base url for the - request. - example: https://api.example.com - data: - type: string - nullable: true - minLength: 1 - description: The data with the request. You must include a `request_format` - parameter matching the data's format - example: '{"company": "Lime", "model": "Gen 2.5"}' - multipart_form_data: - type: array - items: - $ref: '#/components/schemas/MultipartFormFieldRequest' - nullable: true - description: Pass an array of `MultipartFormField` objects in here instead - of using the `data` param if `request_format` is set to `MULTIPART`. - headers: - type: object - additionalProperties: {} - nullable: true - description: 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. - example: - EXTRA-HEADER: value - request_format: - allOf: - - $ref: '#/components/schemas/RequestFormatEnum' - nullable: true - example: JSON - normalize_response: - type: boolean - description: '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`.' - required: - - method - - path - x-merge-category: ats - DebugModeLog: - type: object - properties: - log_id: - type: string - example: 99433219-8017-4acd-bb3c-ceb23d663832 - dashboard_view: - type: string - example: https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 - log_summary: - $ref: '#/components/schemas/DebugModelLogSummary' - example: - url: www.exampleintegration.com/api/v1/exampleapi - method: POST - status_code: 200 - required: - - dashboard_view - - log_id - - log_summary - x-merge-sample-json: '{"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}}' - x-merge-category: ats - DebugModelLogSummary: - type: object - properties: - url: - type: string - example: www.exampleintegration.com/api/v1/exampleapi - method: - type: string - example: POST - status_code: - type: integer - example: 200 - required: - - method - - status_code - - url - x-merge-sample-json: '{"url": "www.exampleintegration.com/api/v1/exampleapi", - "method": "POST", "status_code": 200}' - x-merge-category: ats - Department: - type: object - description: |- - # The Department Object - ### Description - The `Department` object is used to represent a department within a company. - ### Usage Example - Fetch from the `LIST Departments` endpoint and view the departments within a company. - properties: - id: - type: string - format: uuid - readOnly: true - example: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '23456' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The department's name. - example: Engineering - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /departments - data: - - Varies by platform - x-merge-category: ats - DisabilityStatusEnum: - enum: - - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - - NO_I_DONT_HAVE_A_DISABILITY - - I_DONT_WISH_TO_ANSWER - type: string - description: |- - * `YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY` - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - * `NO_I_DONT_HAVE_A_DISABILITY` - NO_I_DONT_HAVE_A_DISABILITY - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - x-merge-category: ats - EEOC: - type: object - description: |- - # The EEOC Object - ### Description - The `EEOC` object is used to represent the Equal Employment Opportunity Commission information for a candidate (race, gender, veteran status, disability status). - ### Usage Example - Fetch from the `LIST EEOCs` endpoint and filter by `candidate` to show all EEOC information for a candidate. - properties: - id: - type: string - format: uuid - readOnly: true - example: f7dd7b4f-237e-4772-8bd4-3246384c6c58 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '76' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - candidate: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Candidate' - nullable: true - description: The candidate being represented. - example: f963f34d-3d2f-4f77-b557-cf36bc7e6498 - x-merge-expands-to: Candidate - submitted_at: - type: string - format: date-time - nullable: true - description: When the information was submitted. - example: '2021-10-15T00:00:00Z' - race: - oneOf: - - $ref: '#/components/schemas/RaceEnum' - - type: string - nullable: true - description: |- - The candidate's race. - - * `AMERICAN_INDIAN_OR_ALASKAN_NATIVE` - AMERICAN_INDIAN_OR_ALASKAN_NATIVE - * `ASIAN` - ASIAN - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - * `WHITE` - WHITE - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - example: HISPANIC_OR_LATINO - gender: - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - type: string - nullable: true - description: |- - The candidate's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - example: FEMALE - veteran_status: - oneOf: - - $ref: '#/components/schemas/VeteranStatusEnum' - - type: string - nullable: true - description: |- - The candidate's veteran status. - - * `I_AM_NOT_A_PROTECTED_VETERAN` - I_AM_NOT_A_PROTECTED_VETERAN - * `I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN` - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - example: I_AM_NOT_A_PROTECTED_VETERAN - disability_status: - oneOf: - - $ref: '#/components/schemas/DisabilityStatusEnum' - - type: string - nullable: true - description: |- - The candidate's disability status. - - * `YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY` - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - * `NO_I_DONT_HAVE_A_DISABILITY` - NO_I_DONT_HAVE_A_DISABILITY - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - example: I_DONT_WISH_TO_ANSWER - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /eeoc - data: - - Varies by platform - x-merge-expands: '{"candidate": "Candidate"}' - x-merge-category: ats - EmailAddress: - type: object - description: |- - # The EmailAddress Object - ### Description - The `EmailAddress` object is used to represent a candidate's email address. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their email addresses. - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - value: - type: string - format: email - nullable: true - description: The email address. - maxLength: 254 - example: merge_is_hiring@merge.dev - email_address_type: - oneOf: - - $ref: '#/components/schemas/EmailAddressTypeEnum' - - type: string - nullable: true - description: |- - The type of email address. - - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - example: PERSONAL - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-category: ats - EmailAddressRequest: - type: object - description: |- - # The EmailAddress Object - ### Description - The `EmailAddress` object is used to represent a candidate's email address. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their email addresses. - properties: - value: - type: string - format: email - nullable: true - description: The email address. - maxLength: 254 - example: merge_is_hiring@merge.dev - email_address_type: - oneOf: - - $ref: '#/components/schemas/EmailAddressTypeEnum' - - type: string - nullable: true - description: |- - The type of email address. - - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - example: PERSONAL - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: ats - EmailAddressTypeEnum: - enum: - - PERSONAL - - WORK - - OTHER - type: string - description: |- - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - x-merge-category: ats - EnabledActionsEnum: - enum: - - READ - - WRITE - type: string - description: |- - * `READ` - READ - * `WRITE` - WRITE - x-merge-category: ats - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - type: string - description: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - x-merge-category: ats - EndUserDetailsRequest: - type: object - properties: - end_user_email_address: - type: string - minLength: 1 - description: Your end user's email address. This is purely for identification - purposes - setting this value will not cause any emails to be sent. - maxLength: 100 - example: example@gmail.com - end_user_organization_name: - type: string - minLength: 1 - description: Your end user's organization. - maxLength: 100 - example: Test Organization - end_user_origin_id: - type: string - minLength: 1 - description: 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. - maxLength: 100 - example: '12345' - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: The integration categories to show in Merge Link. - example: - - hris - - ats - integration: - type: string - nullable: true - minLength: 1 - description: 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/. - example: bamboohr - link_expiry_mins: - type: integer - maximum: 10080 - minimum: 30 - default: 30 - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: array - items: - $ref: '#/components/schemas/CommonModelScopesBodyRequest' - nullable: true - description: 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: object - additionalProperties: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - nullable: true - description: 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. - example: - hris: - - model_name: Employee - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - first_name - - last_name - - personal_email - disabled_fields: - - preferred_name - - model_name: Employment - model_permissions: - READ: - is_enabled: false - WRITE: - is_enabled: false - field_permissions: - enabled_fields: - - effective_date - ats: - - model_name: Job - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - name - disabled_fields: - - description - - model_name: Department - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - language: - oneOf: - - $ref: '#/components/schemas/LanguageEnum' - - type: string - nullable: true - description: |- - The following subset of IETF language tags can be used to configure localization. - - * `en` - en - * `de` - de - example: en - are_syncs_disabled: - type: boolean - nullable: true - default: false - description: The boolean that indicates whether initial, periodic, and force - syncs will be disabled. - integration_specific_config: - type: object - additionalProperties: {} - nullable: true - description: A JSON object containing integration-specific configuration - options. - example: - rippling: - oauth_code: 3h1jj8ssdf31dfji3o1jjdfjasd - required: - - categories - - end_user_email_address - - end_user_organization_name - - end_user_origin_id - x-merge-category: ats - ErrorValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /model/custom_fields - title: - type: string - example: Missing Required Field - detail: - type: string - example: custom_fields is a required field on model. - problem_type: - type: string - example: MISSING_REQUIRED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: ats - 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 - type: string - description: |- - * `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 - x-merge-category: ats - ExternalTargetFieldAPI: - type: object - properties: - name: - type: string - nullable: true - readOnly: true - example: example_target_field_name - description: - type: string - nullable: true - readOnly: true - example: this is a example description of a target field - is_mapped: - type: string - nullable: true - readOnly: true - example: true - x-merge-category: ats - ExternalTargetFieldAPIResponse: - type: object - properties: - Activity: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Application: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Attachment: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Candidate: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Department: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - EEOC: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - ScheduledInterview: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Job: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - JobPosting: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - JobInterviewStage: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Offer: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Office: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - RejectReason: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Scorecard: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Tag: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - RemoteUser: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - x-merge-category: ats - FieldMappingApiInstance: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - is_integration_wide: - type: boolean - readOnly: true - target_field: - type: object - properties: - name: - type: string - description: - type: string - is_organization_wide: - type: boolean - required: - - description - - is_organization_wide - - name - nullable: true - readOnly: true - example: - name: example_target_field_name - description: this is a example description of a target field - is_organization_wide: true - remote_field: - type: object - properties: - remote_key_name: - type: string - nullable: true - schema: - type: object - additionalProperties: {} - nullable: true - remote_endpoint_info: - type: object - properties: - method: - type: string - nullable: true - url_path: - type: string - nullable: true - field_traversal_path: - type: array - items: - type: string - nullable: true - required: - - field_traversal_path - - method - - url_path - required: - - remote_endpoint_info - - remote_key_name - - schema - nullable: true - readOnly: true - example: - 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 - x-merge-category: ats - FieldMappingApiInstanceResponse: - type: object - properties: - Activity: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Application: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Attachment: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Candidate: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Department: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - EEOC: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - ScheduledInterview: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Job: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - JobPosting: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - JobInterviewStage: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Offer: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Office: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - RejectReason: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Scorecard: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Tag: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - RemoteUser: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - x-merge-category: ats - FieldMappingInstanceResponse: - type: object - properties: - model: - $ref: '#/components/schemas/FieldMappingApiInstance' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ats - FieldPermissionDeserializer: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: ats - FieldPermissionDeserializerRequest: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: ats - GenderEnum: - enum: - - MALE - - FEMALE - - NON-BINARY - - OTHER - - DECLINE_TO_SELF_IDENTIFY - type: string - description: |- - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - x-merge-category: ats - GenerateRemoteKeyRequest: - type: object - description: |- - # The GenerateRemoteKey Object - ### Description - The `GenerateRemoteKey` object is used to represent a request for a new remote key. - - ### Usage Example - Post a `GenerateRemoteKey` to create a new remote key. - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: ats - IgnoreCommonModelRequest: - type: object - properties: - reason: - oneOf: - - $ref: '#/components/schemas/ReasonEnum' - - type: string - example: GENERAL_CUSTOMER_REQUEST - message: - type: string - minLength: 1 - maxLength: 256 - example: deletion request by user id 51903790-7dfe-4053-8d63-5a10cc4ffd39 - required: - - reason - x-merge-category: ats - IndividualCommonModelScopeDeserializer: - type: object - properties: - model_name: - type: string - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializer' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializer' - required: - - model_name - x-merge-category: ats - IndividualCommonModelScopeDeserializerRequest: - type: object - properties: - model_name: - type: string - minLength: 1 - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializerRequest' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializerRequest' - required: - - model_name - x-merge-category: ats - Issue: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - status: - oneOf: - - $ref: '#/components/schemas/IssueStatusEnum' - - type: string - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - example: ONGOING - error_description: - type: string - example: Missing Permissions - end_user: - type: object - additionalProperties: {} - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - first_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - last_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - is_muted: - type: boolean - readOnly: true - example: true - error_details: - type: array - items: - type: string - readOnly: true - example: - - Missing employee permissions. - - Missing time off permissions. - required: - - error_description - x-merge-category: ats - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - type: string - description: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - x-merge-category: ats - Job: - type: object - description: |- - # The Job Object - ### Description - The `Job` object can be used to track any jobs that are currently or will be open/closed for applications. - ### Usage Example - Fetch from the `LIST Jobs` endpoint to show all job postings. - properties: - id: - type: string - format: uuid - readOnly: true - example: 022a2bef-57e5-4def-8ed2-7c41bd9a5ed8 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '8765432' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The job's name. - example: Software Engineer (Merge is actually hiring btw) - description: - type: string - nullable: true - description: The job's description. - example: If you're reading this documentation, you might be a good fit - for Merge! - code: - type: string - nullable: true - description: The job's code. Typically an additional identifier used to - reference the particular job that is displayed on the ATS. - example: C0025 - status: - oneOf: - - $ref: '#/components/schemas/JobStatusEnum' - - type: string - nullable: true - description: |- - The job's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `ARCHIVED` - ARCHIVED - * `PENDING` - PENDING - example: OPEN - type: - oneOf: - - $ref: '#/components/schemas/JobTypeEnum' - - type: string - nullable: true - description: |- - The job's type. - - * `POSTING` - POSTING - * `REQUISITION` - REQUISITION - * `PROFILE` - PROFILE - example: POSTING - job_postings: - type: array - items: - type: string - format: uuid - nullable: true - example: - - 2r3c1341-a20f-4e51-b72c-f3830a16c97b - - 543ed912-33ec-444e-a215-8d71cc42fc12 - description: IDs of `JobPosting` objects that serve as job postings for - this `Job`. - x-merge-expands-to: JobPosting - job_posting_urls: - type: array - items: - $ref: '#/components/schemas/Url' - example: - - value: https://merge.dev/careers - url_type: JOB_POSTING - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's job was created. - example: '2021-10-15T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's job was updated. - example: '2021-10-16T00:00:00Z' - confidential: - type: boolean - nullable: true - description: Whether the job is confidential. - example: true - departments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Department' - nullable: true - example: - - 5b3c1341-a20f-4e51-b72c-f3830a16c97b - - d6e687d6-0c36-48a1-8114-35324b5cb38f - description: IDs of `Department` objects for this `Job`. - x-merge-expands-to: Department - offices: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Office' - nullable: true - example: - - 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - description: IDs of `Office` objects for this `Job`. - x-merge-expands-to: Office - hiring_managers: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - example: - - 787ed912-33ec-444e-a215-8d71cc42fc12 - description: IDs of `RemoteUser` objects that serve as hiring managers for - this `Job`. - x-merge-expands-to: RemoteUser - recruiters: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - example: - - 787ed912-33ec-444e-a215-8d71cc42fc12 - description: IDs of `RemoteUser` objects that serve as recruiters for this - `Job`. - x-merge-expands-to: RemoteUser - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /positions - data: - - Varies by platform - x-merge-sample-json: "{\"id\": \"022a2bef-57e5-4def-8ed2-7c41bd9a5ed8\", \"\ - remote_id\": \"8765432\", \"name\": \"Software Engineer (Merge is actually - hiring btw)\", \"description\": \"If you're reading this documentation, - you might be a good fit for Merge!\", \"code\": \"C0025\", \"status\" - : \"OPEN\", \"job_posting_urls\": [{\"value\": \"https://merge.dev/careers\"\ - , \"url_type\": \"JOB_POSTING\"}], \"remote_created_at\": \"2021-10-15T00:00:00Z\"\ - , \"remote_updated_at\": \"2021-10-16T00:00:00Z\", \"confidential\": true, - \"departments\": [\"5b3c1341-a20f-4e51-b72c-f3830a16c97b\", \"d6e687d6-0c36-48a1-8114-35324b5cb38f\"\ - ], \"offices\": [\"9871b4a9-f5d2-4f3b-a66b-dfedbed42c46\"], \"hiring_managers\"\ - : [\"787ed912-33ec-444e-a215-8d71cc42fc12\"], \"remote_data\": [{\"path\" - : \"/positions\", \"data\": {\"example\": \"Varies by platform\"}}]}" - x-merge-expands: '{"departments": "Department", "hiring_managers": "RemoteUser", - "job_postings": "JobPosting", "offices": "Office", "recruiters": "RemoteUser"}' - x-merge-category: ats - JobInterviewStage: - type: object - description: |- - # The JobInterviewStage Object - ### Description - The `JobInterviewStage` object is used to represent a particular recruiting stage for an `Application`. A given `Application` typically has the `JobInterviewStage` object represented in the current_stage field. - ### Usage Example - Fetch from the `LIST JobInterviewStages` endpoint and view the job interview stages used by a company. - properties: - id: - type: string - format: uuid - readOnly: true - example: f9813dd5-e70b-484c-91d8-00acd6065b07 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '876556788' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: Standard stage names are offered by ATS systems but can be - modified by users. - example: Phone Screen - job: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Job' - nullable: true - description: This field is populated only if the stage is specific to a - particular job. If the stage is generic, this field will not be populated. - example: ba7d9648-5316-4a80-8d73-4e636cef5a90 - x-merge-expands-to: Job - stage_order: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The stage’s order, with the lowest values ordered first. If - the third-party does not return details on the order of stages, this field - will not be populated. - example: 2 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /interview-stages - data: - - Varies by platform - x-merge-expands: '{"job": "Job"}' - x-merge-category: ats - JobPosting: - type: object - description: |- - # The JobPosting Object - ### Description - The `JobPosting` object represents an external announcement on a job board created by an organization to attract qualified candidates to apply for a specific `Job` opening - ### Usage Example - Fetch from the `LIST JobPostings` endpoint to show all job postings. - properties: - id: - type: string - format: uuid - readOnly: true - example: 156a2bef-57e5-4def-8ed2-7c41bd9a554t - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '1341324' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - title: - type: string - nullable: true - description: The job posting’s title. - example: Platform - NYC - job_posting_urls: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Url' - example: - - value: https://merge.dev/careers - url_type: JOB_POSTING - description: The Url object is used to represent hyperlinks for a candidate - to apply to a given job. - job: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Job' - nullable: true - description: ID of `Job` object for this `JobPosting`. - example: 022a2bef-57e5-4def-8ed2-7c41bd9a5ed8 - x-merge-expands-to: Job - status: - oneOf: - - $ref: '#/components/schemas/JobPostingStatusEnum' - - type: string - nullable: true - description: |- - The job posting's status. - - * `PUBLISHED` - PUBLISHED - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `INTERNAL` - INTERNAL - * `PENDING` - PENDING - example: PUBLISHED - content: - type: string - nullable: true - description: The job posting’s content. - example: Apply at https://merge.dev/careers - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's job posting was created. - example: '2021-10-15T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's job posting was updated. - example: '2021-10-16T00:00:00Z' - is_internal: - type: boolean - nullable: true - description: Indicates whether the job posting is internal or external. - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /positions - data: - - Varies by platform - x-merge-expands: '{"job": "Job"}' - x-merge-category: ats - JobPostingStatusEnum: - enum: - - PUBLISHED - - CLOSED - - DRAFT - - INTERNAL - - PENDING - type: string - description: |- - * `PUBLISHED` - PUBLISHED - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `INTERNAL` - INTERNAL - * `PENDING` - PENDING - x-merge-category: ats - JobStatusEnum: - enum: - - OPEN - - CLOSED - - DRAFT - - ARCHIVED - - PENDING - type: string - description: |- - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `ARCHIVED` - ARCHIVED - * `PENDING` - PENDING - x-merge-category: ats - JobTypeEnum: - enum: - - POSTING - - REQUISITION - - PROFILE - type: string - description: |- - * `POSTING` - POSTING - * `REQUISITION` - REQUISITION - * `PROFILE` - PROFILE - x-merge-category: ats - LanguageEnum: - enum: - - en - - de - type: string - description: |- - * `en` - en - * `de` - de - x-merge-category: ats - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: ats - LinkToken: - type: object - properties: - link_token: - type: string - example: necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0 - integration_name: - type: string - example: Lever - magic_link_url: - type: string - example: https://link.merge.dev/asdfjkl12345jsndfgi2i83n - required: - - link_token - x-merge-category: ats - LinkedAccountCommonModelScopeDeserializerRequest: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: ats - LinkedAccountStatus: - type: object - properties: - linked_account_status: - type: string - can_make_request: - type: boolean - required: - - can_make_request - - linked_account_status - x-merge-category: ats - MetaResponse: - type: object - properties: - request_schema: - type: object - additionalProperties: {} - example: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - type: object - additionalProperties: {} - status: - $ref: '#/components/schemas/LinkedAccountStatus' - example: - linked_account_status: COMPLETE - can_make_request: true - has_conditional_params: - type: boolean - has_required_linked_account_params: - type: boolean - required: - - has_conditional_params - - has_required_linked_account_params - - request_schema - x-merge-category: ats - MethodEnum: - enum: - - GET - - OPTIONS - - HEAD - - POST - - PUT - - PATCH - - DELETE - type: string - description: |- - * `GET` - GET - * `OPTIONS` - OPTIONS - * `HEAD` - HEAD - * `POST` - POST - * `PUT` - PUT - * `PATCH` - PATCH - * `DELETE` - DELETE - x-merge-category: ats - ModelOperation: - type: object - description: |- - # 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: - type: string - example: Candidate - available_operations: - type: array - items: - type: string - example: - - FETCH - - CREATE - required_post_parameters: - type: array - items: - type: string - example: - - remote_user_id - supported_fields: - type: array - items: - type: string - example: - - first_name - - last_name - - company - - title - required: - - available_operations - - model_name - - required_post_parameters - - supported_fields - x-merge-category: ats - ModelPermissionDeserializer: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: ats - ModelPermissionDeserializerRequest: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: ats - MultipartFormFieldRequest: - type: object - description: |- - # 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 - minLength: 1 - description: The name of the form field - example: resume - data: - type: string - minLength: 1 - description: The data for the form field. - example: SW50ZWdyYXRlIGZhc3QKSW50ZWdyYXRlIG9uY2U= - encoding: - oneOf: - - $ref: '#/components/schemas/EncodingEnum' - - type: string - nullable: true - default: RAW - description: |- - The encoding of the value of `data`. Defaults to `RAW` if not defined. - - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - example: BASE64 - file_name: - type: string - nullable: true - minLength: 1 - description: The file name of the form field, if the field is for a file. - example: resume.pdf - content_type: - type: string - nullable: true - minLength: 1 - description: The MIME type of the file, if the field is for a file. - example: application/pdf - required: - - data - - name - x-merge-category: ats - Offer: - type: object - description: |- - # The Offer Object - ### Description - The `Offer` object is used to represent an offer for a candidate's application specific to a job. - ### Usage Example - Fetch from the `LIST Offers` endpoint and filter by `ID` to show all offers. - properties: - id: - type: string - format: uuid - readOnly: true - example: dd85625c-6a59-446f-a317-6de64d83bae7 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '9876' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - application: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Application' - nullable: true - description: The application who is receiving the offer. - example: 2872ba14-4084-492b-be96-e5eee6fc33ef - x-merge-expands-to: Application - creator: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The user who created the offer. - example: 52bf9b5e-0beb-4f6f-8a72-cd4dca7ca633 - x-merge-expands-to: RemoteUser - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's offer was created. - example: '2021-10-15T00:00:00Z' - closed_at: - type: string - format: date-time - nullable: true - description: When the offer was closed. - example: '2021-10-16T00:00:00Z' - sent_at: - type: string - format: date-time - nullable: true - description: When the offer was sent. - example: '2021-10-15T00:00:00Z' - start_date: - type: string - format: date-time - nullable: true - description: The employment start date on the offer. - example: '2021-11-15T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/OfferStatusEnum' - - type: string - nullable: true - description: |- - The offer's status. - - * `DRAFT` - DRAFT - * `APPROVAL-SENT` - APPROVAL-SENT - * `APPROVED` - APPROVED - * `SENT` - SENT - * `SENT-MANUALLY` - SENT-MANUALLY - * `OPENED` - OPENED - * `DENIED` - DENIED - * `SIGNED` - SIGNED - * `DEPRECATED` - DEPRECATED - example: SENT - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /offers - data: - - Varies by platform - x-merge-expands: '{"application": "Application", "creator": "RemoteUser"}' - x-merge-category: ats - OfferStatusEnum: - enum: - - DRAFT - - APPROVAL-SENT - - APPROVED - - SENT - - SENT-MANUALLY - - OPENED - - DENIED - - SIGNED - - DEPRECATED - type: string - description: |- - * `DRAFT` - DRAFT - * `APPROVAL-SENT` - APPROVAL-SENT - * `APPROVED` - APPROVED - * `SENT` - SENT - * `SENT-MANUALLY` - SENT-MANUALLY - * `OPENED` - OPENED - * `DENIED` - DENIED - * `SIGNED` - SIGNED - * `DEPRECATED` - DEPRECATED - x-merge-category: ats - Office: - type: object - description: |- - # The Office Object - ### Description - The `Office` object is used to represent an office within a company. A given `Job` has the `Office` ID in its offices field. - ### Usage Example - Fetch from the `LIST Offices` endpoint and view the offices within a company. - properties: - id: - type: string - format: uuid - readOnly: true - example: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '876556788' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The office's name. - example: SF Office - location: - type: string - nullable: true - description: The office's location. - example: Embarcadero Center 2 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /locations - data: - - Varies by platform - x-merge-sample-json: '{"id": "9871b4a9-f5d2-4f3b-a66b-dfedbed42c46", "remote_id": - "876556788", "name": "SF Office", "location": "Embarcadero Center 2", "remote_data": - [{"path": "/locations", "data": {"example": "Varies by platform"}}]}' - x-merge-category: ats - OverallRecommendationEnum: - enum: - - DEFINITELY_NO - - NO - - YES - - STRONG_YES - - NO_DECISION - type: string - description: |- - * `DEFINITELY_NO` - DEFINITELY_NO - * `NO` - NO - * `YES` - YES - * `STRONG_YES` - STRONG_YES - * `NO_DECISION` - NO_DECISION - x-merge-category: ats - PaginatedAccountDetailsAndActionsList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountDetailsAndActions' - x-merge-category: ats - PaginatedActivityList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Activity' - x-merge-category: ats - PaginatedApplicationList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Application' - x-merge-category: ats - PaginatedAttachmentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Attachment' - x-merge-category: ats - PaginatedAuditLogEventList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AuditLogEvent' - x-merge-category: ats - PaginatedCandidateList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Candidate' - x-merge-category: ats - PaginatedDepartmentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Department' - x-merge-category: ats - PaginatedEEOCList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/EEOC' - x-merge-category: ats - PaginatedIssueList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Issue' - x-merge-category: ats - PaginatedJobInterviewStageList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/JobInterviewStage' - x-merge-category: ats - PaginatedJobList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Job' - x-merge-category: ats - PaginatedJobPostingList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/JobPosting' - x-merge-category: ats - PaginatedOfferList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Offer' - x-merge-category: ats - PaginatedOfficeList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Office' - x-merge-category: ats - PaginatedRejectReasonList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/RejectReason' - x-merge-category: ats - PaginatedRemoteUserList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/RemoteUser' - x-merge-category: ats - PaginatedScheduledInterviewList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/ScheduledInterview' - x-merge-category: ats - PaginatedScorecardList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Scorecard' - x-merge-category: ats - PaginatedScreeningQuestionList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/ScreeningQuestion' - x-merge-category: ats - PaginatedSyncStatusList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - x-merge-category: ats - PaginatedTagList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Tag' - x-merge-category: ats - PatchedCandidateEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedCandidateRequest' - remote_user_id: - type: string - required: - - model - - remote_user_id - x-merge-category: ats - PatchedCandidateRequest: - type: object - description: |- - # The Candidate Object - ### Description - The `Candidate` object is used to represent profile information about a given Candidate. Because it is specific to a Candidate, this information stays constant across applications. - ### Usage Example - Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all candidates. - properties: - first_name: - type: string - nullable: true - description: The candidate's first name. - example: Gil - last_name: - type: string - nullable: true - description: The candidate's last name. - example: Feig - company: - type: string - nullable: true - description: The candidate's current company. - example: Columbia Dining App. - title: - type: string - nullable: true - description: The candidate's current title. - example: Software Engineer - last_interaction_at: - type: string - format: date-time - nullable: true - description: When the most recent interaction with the candidate occurred. - example: '2021-10-17T00:00:00Z' - is_private: - type: boolean - nullable: true - description: Whether or not the candidate is private. - example: true - can_email: - type: boolean - nullable: true - description: Whether or not the candidate can be emailed. - example: true - locations: - type: array - items: - type: string - nullable: true - description: The candidate's locations. - nullable: true - description: The candidate's locations. - example: - - San Francisco - - New York - - Miami - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumberRequest' - example: - - value: '+1234567890' - phone_number_type: MOBILE - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddressRequest' - example: - - value: hello@merge.dev - email_address_type: PERSONAL - urls: - type: array - items: - $ref: '#/components/schemas/UrlRequest' - example: - - value: http://alturl.com/p749b - url_type: BLOG - tags: - type: array - items: - type: string - nullable: true - description: The tag's name. - example: - - High-Priority - description: Array of `Tag` names as strings. - applications: - type: array - items: - type: string - format: uuid - nullable: true - example: - - 29eb9867-ce2a-403f-b8ce-f2844b89f078 - - b4d08e5c-de00-4d64-a29f-66addac9af99 - - 4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56 - description: Array of `Application` object IDs. - attachments: - type: array - items: - type: string - format: uuid - nullable: true - example: - - bea08964-32b4-4a20-8bb4-2612ba09de1d - description: Array of `Attachment` object IDs. - remote_template_id: - type: string - writeOnly: true - nullable: true - minLength: 1 - example: '92830948203' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: ats - PatchedEditFieldMappingRequest: - type: object - properties: - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field_name - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - x-merge-category: ats - PhoneNumber: - type: object - description: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent a candidate's phone number. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their phone numbers. - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - value: - type: string - nullable: true - description: The phone number. - example: '+3198675309' - phone_number_type: - oneOf: - - $ref: '#/components/schemas/PhoneNumberTypeEnum' - - type: string - nullable: true - description: |- - The type of phone number. - - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - example: HOME - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-category: ats - PhoneNumberRequest: - type: object - description: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent a candidate's phone number. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their phone numbers. - properties: - value: - type: string - nullable: true - description: The phone number. - example: '+3198675309' - phone_number_type: - oneOf: - - $ref: '#/components/schemas/PhoneNumberTypeEnum' - - type: string - nullable: true - description: |- - The type of phone number. - - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - example: HOME - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: ats - PhoneNumberTypeEnum: - enum: - - HOME - - WORK - - MOBILE - - SKYPE - - OTHER - type: string - description: |- - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - x-merge-category: ats - RaceEnum: - enum: - - AMERICAN_INDIAN_OR_ALASKAN_NATIVE - - ASIAN - - BLACK_OR_AFRICAN_AMERICAN - - HISPANIC_OR_LATINO - - WHITE - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - TWO_OR_MORE_RACES - - DECLINE_TO_SELF_IDENTIFY - type: string - description: |- - * `AMERICAN_INDIAN_OR_ALASKAN_NATIVE` - AMERICAN_INDIAN_OR_ALASKAN_NATIVE - * `ASIAN` - ASIAN - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - * `WHITE` - WHITE - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - x-merge-category: ats - ReasonEnum: - enum: - - GENERAL_CUSTOMER_REQUEST - - GDPR - - OTHER - type: string - description: |- - * `GENERAL_CUSTOMER_REQUEST` - GENERAL_CUSTOMER_REQUEST - * `GDPR` - GDPR - * `OTHER` - OTHER - x-merge-category: ats - RejectReason: - type: object - description: |- - # The RejectReason Object - ### Description - The `RejectReason` object is used to represent a reason for rejecting an application. These can typically be configured within an ATS system. - ### Usage Example - Fetch from the `LIST RejectReasons` endpoint and filter by `ID` to show all reasons. - properties: - id: - type: string - format: uuid - readOnly: true - example: 8be99a4a-f8d4-4339-bf1e-30eac970e217 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '876556788' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The rejection reason’s name. - example: Not passionate enough about APIs. - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /rejection-reasons - data: - - Varies by platform - x-merge-category: ats - RemoteData: - type: object - description: |- - # 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 - description: The third-party API path that is being called. - example: /platform-endpoint - data: - readOnly: true - description: The data returned from the third-party for this object in its - original, unnormalized format. - example: - - Varies by platform - required: - - path - x-merge-category: ats - RemoteEndpointInfo: - type: object - properties: - method: - type: string - example: GET - url_path: - type: string - example: /example-url-path - field_traversal_path: - type: array - items: {} - example: - - example_key_name - required: - - field_traversal_path - - method - - url_path - x-merge-category: ats - RemoteFieldAPI: - type: object - properties: - schema: - type: object - additionalProperties: {} - example: - type: string - remote_key_name: - type: string - example: example_remote_key_name - remote_endpoint_info: - $ref: '#/components/schemas/RemoteEndpointInfo' - example: - method: GET - url_path: /example-url-path - field_traversal_path: - - example_key_name - example_values: - type: array - items: {} - nullable: true - example: - - example - advanced_metadata: - allOf: - - $ref: '#/components/schemas/AdvancedMetadata' - nullable: true - coverage: - oneOf: - - type: integer - - type: number - format: double - nullable: true - readOnly: true - example: 0.33 - required: - - advanced_metadata - - remote_endpoint_info - - remote_key_name - - schema - x-merge-category: ats - RemoteFieldAPIResponse: - type: object - properties: - Activity: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Application: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Attachment: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Candidate: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Department: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - EEOC: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - ScheduledInterview: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Job: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - JobPosting: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - JobInterviewStage: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Offer: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Office: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - RejectReason: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Scorecard: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Tag: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - RemoteUser: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - x-merge-category: ats - RemoteKey: - type: object - description: |- - # 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: - type: string - example: Remote Deployment Key 1 - key: - type: string - example: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA - required: - - key - - name - x-merge-category: ats - RemoteKeyForRegenerationRequest: - type: object - description: |- - # The RemoteKeyForRegeneration Object - ### Description - The `RemoteKeyForRegeneration` object is used to exchange an old remote key for a new one - - ### Usage Example - Post a `RemoteKeyForRegeneration` to swap out an old remote key for a new one - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: ats - RemoteResponse: - type: object - description: |- - # 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: - type: string - example: GET - path: - type: string - example: /scooters - status: - type: integer - example: 200 - response: - example: - scooters: - - company: Lime - model: Gen 2.5 - - company: Bird - model: Bird Zero - response_headers: - type: object - additionalProperties: {} - example: - X-Page-Token: value - response_type: - oneOf: - - $ref: '#/components/schemas/ResponseTypeEnum' - - type: string - example: JSON - headers: - type: object - additionalProperties: {} - example: - EXTRA-HEADER: value - Authorization: - required: - - method - - path - - response - - status - x-merge-category: ats - RemoteUser: - type: object - description: |- - # The RemoteUser Object - ### Description - The `RemoteUser` object is used to represent a user with a login to the ATS system. - ### Usage Example - Fetch from the `LIST RemoteUsers` endpoint to show all users for a third party. - properties: - id: - type: string - format: uuid - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '344321' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - first_name: - type: string - nullable: true - description: The user's first name. - example: Shensi - last_name: - type: string - nullable: true - description: The user's last name. - example: Ding - email: - type: string - format: email - nullable: true - description: The user's email. - maxLength: 254 - example: hello@merge.dev - disabled: - type: boolean - nullable: true - description: Whether the user's account had been disabled. - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's user was created. - example: '2020-11-10T00:00:00Z' - access_role: - oneOf: - - $ref: '#/components/schemas/AccessRoleEnum' - - type: string - nullable: true - description: |- - The user's role. - - * `SUPER_ADMIN` - SUPER_ADMIN - * `ADMIN` - ADMIN - * `TEAM_MEMBER` - TEAM_MEMBER - * `LIMITED_TEAM_MEMBER` - LIMITED_TEAM_MEMBER - * `INTERVIEWER` - INTERVIEWER - example: SUPER_ADMIN - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /users - data: - - Varies by platform - x-merge-sample-json: '{"id": "b82302de-852e-4e60-b050-edf9da3b7c02", "remote_id": - "344321", "first_name": "Shensi", "last_name": "Ding", "email": "hello@merge.dev", - "disabled": false, "remote_created_at": "2020-11-10T00:00:00Z", "access_role": - "SUPER_ADMIN", "remote_data": [{"path": "/users", "data": {"example": "Varies - by platform"}}]}' - x-merge-category: ats - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - type: string - description: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - x-merge-category: ats - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - type: string - description: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - x-merge-category: ats - RoleEnum: - enum: - - ADMIN - - DEVELOPER - - MEMBER - - API - - SYSTEM - - MERGE_TEAM - type: string - description: |- - * `ADMIN` - ADMIN - * `DEVELOPER` - DEVELOPER - * `MEMBER` - MEMBER - * `API` - API - * `SYSTEM` - SYSTEM - * `MERGE_TEAM` - MERGE_TEAM - x-merge-category: ats - ScheduledInterview: - type: object - description: |- - # The ScheduledInterview Object - ### Description - The `ScheduledInterview` object is used to represent a scheduled interview for a given candidate’s application to a job. An `Application` can have multiple `ScheduledInterview`s depending on the particular hiring process. - ### Usage Example - Fetch from the `LIST ScheduledInterviews` endpoint and filter by `interviewers` to show all office locations. - properties: - id: - type: string - format: uuid - readOnly: true - example: b8faf072-98b9-4445-8a9a-6b4950efca19 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '3' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - application: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Application' - nullable: true - description: The application being interviewed. - example: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - x-merge-expands-to: Application - job_interview_stage: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/JobInterviewStage' - nullable: true - description: The stage of the interview. - example: 2f7adb59-3fe6-4b5b-aef6-563f72bd13dc - x-merge-expands-to: JobInterviewStage - organizer: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The user organizing the interview. - example: 52bf9b5e-0beb-4f6f-8a72-cd4dca7ca633 - x-merge-expands-to: RemoteUser - interviewers: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - example: - - f9813dd5-e70b-484c-91d8-00acd6065b07 - - 89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c - description: Array of `RemoteUser` IDs. - x-merge-expands-to: RemoteUser - location: - type: string - nullable: true - description: The interview's location. - example: Embarcadero Center 2 - start_at: - type: string - format: date-time - nullable: true - description: When the interview was started. - example: '2021-10-15T00:00:00Z' - end_at: - type: string - format: date-time - nullable: true - description: When the interview was ended. - example: '2021-10-15T02:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's interview was created. - example: '2021-10-15T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's interview was updated. - example: '2021-10-15T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/ScheduledInterviewStatusEnum' - - type: string - nullable: true - description: |- - The interview's status. - - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - example: SCHEDULED - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /interviews - data: - - Varies by platform - x-merge-expands: '{"application": "Application", "interviewers": "RemoteUser", - "job_interview_stage": "JobInterviewStage", "organizer": "RemoteUser"}' - x-merge-category: ats - ScheduledInterviewEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ScheduledInterviewRequest' - remote_user_id: - type: string - required: - - model - - remote_user_id - x-merge-category: ats - ScheduledInterviewRequest: - type: object - description: |- - # The ScheduledInterview Object - ### Description - The `ScheduledInterview` object is used to represent a scheduled interview for a given candidate’s application to a job. An `Application` can have multiple `ScheduledInterview`s depending on the particular hiring process. - ### Usage Example - Fetch from the `LIST ScheduledInterviews` endpoint and filter by `interviewers` to show all office locations. - properties: - application: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Application' - nullable: true - description: The application being interviewed. - example: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - x-merge-expands-to: Application - job_interview_stage: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/JobInterviewStage' - nullable: true - description: The stage of the interview. - example: 2f7adb59-3fe6-4b5b-aef6-563f72bd13dc - x-merge-expands-to: JobInterviewStage - organizer: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The user organizing the interview. - example: 52bf9b5e-0beb-4f6f-8a72-cd4dca7ca633 - x-merge-expands-to: RemoteUser - interviewers: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - example: - - f9813dd5-e70b-484c-91d8-00acd6065b07 - - 89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c - description: Array of `RemoteUser` IDs. - x-merge-expands-to: RemoteUser - location: - type: string - nullable: true - description: The interview's location. - example: Embarcadero Center 2 - start_at: - type: string - format: date-time - nullable: true - description: When the interview was started. - example: '2021-10-15T00:00:00Z' - end_at: - type: string - format: date-time - nullable: true - description: When the interview was ended. - example: '2021-10-15T02:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/ScheduledInterviewStatusEnum' - - type: string - nullable: true - description: |- - The interview's status. - - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - example: SCHEDULED - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"application": "Application", "interviewers": "RemoteUser", - "job_interview_stage": "JobInterviewStage", "organizer": "RemoteUser"}' - x-merge-category: ats - ScheduledInterviewResponse: - type: object - properties: - model: - $ref: '#/components/schemas/ScheduledInterview' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ats - ScheduledInterviewStatusEnum: - enum: - - SCHEDULED - - AWAITING_FEEDBACK - - COMPLETE - type: string - description: |- - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - x-merge-category: ats - Scorecard: - type: object - description: |- - # The Scorecard Object - ### Description - The `Scorecard` object is used to represent an interviewer's candidate recommendation based on a particular interview. - ### Usage Example - Fetch from the `LIST Scorecards` endpoint and filter by `application` to show all scorecard for an applicant. - properties: - id: - type: string - format: uuid - readOnly: true - example: 3eab2f17-eeb1-450d-97f0-029d8be1e06f - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '22234' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - application: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Application' - nullable: true - description: The application being scored. - example: 2872ba14-4084-492b-be96-e5eee6fc33ef - x-merge-expands-to: Application - interview: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/ScheduledInterview' - nullable: true - description: The interview being scored. - example: 52bf9b5e-0beb-4f6f-8a72-cd4dca7ca633 - x-merge-expands-to: ScheduledInterview - interviewer: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteUser' - nullable: true - description: The interviewer doing the scoring. - example: bbb519a3-246e-4b95-b6b3-dba16107ba6b - x-merge-expands-to: RemoteUser - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's scorecard was created. - example: '2021-10-15T00:00:00Z' - submitted_at: - type: string - format: date-time - nullable: true - description: When the scorecard was submitted. - example: '2021-10-15T00:00:00Z' - overall_recommendation: - oneOf: - - $ref: '#/components/schemas/OverallRecommendationEnum' - - type: string - nullable: true - description: |- - The inteviewer's recommendation. - - * `DEFINITELY_NO` - DEFINITELY_NO - * `NO` - NO - * `YES` - YES - * `STRONG_YES` - STRONG_YES - * `NO_DECISION` - NO_DECISION - example: STRONG_YES - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /ratings - data: - - Varies by platform - x-merge-expands: '{"application": "Application", "interview": "ScheduledInterview", - "interviewer": "RemoteUser"}' - x-merge-category: ats - ScreeningQuestion: - type: object - description: |- - # The ScreeningQuestion Object - ### Description - The `ScreeningQuestion` object is used to represent questions asked to screen candidates for a job. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 0238cbc6-6040-430a-848e-aaiehfhdbadf4ae - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '23729392' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - job: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Job' - nullable: true - description: The job associated with the screening question. - example: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - x-merge-expands-to: Job - description: - type: string - nullable: true - description: The description of the screening question - maxLength: 500 - example: Are you currently authorized to work for any employer in the country - outlined for this role? - title: - type: string - nullable: true - description: The title of the screening question - maxLength: 2500 - example: Work Authorisation - type: - oneOf: - - $ref: '#/components/schemas/ScreeningQuestionTypeEnum' - - type: string - nullable: true - description: |- - The data type for the screening question. - - * `DATE` - DATE - * `FILE` - FILE - * `SINGLE_SELECT` - SINGLE_SELECT - * `MULTI_SELECT` - MULTI_SELECT - * `SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT - * `MULTI_LINE_TEXT` - MULTI_LINE_TEXT - * `NUMERIC` - NUMERIC - * `BOOLEAN` - BOOLEAN - example: SINGLE_SELECT - required: - type: boolean - nullable: true - description: Whether or not the screening question is required. - example: true - options: - type: array - items: - oneof: - - type: string - format: uuid - - $ref: '#/components/schemas/ScreeningQuestionOption' - example: - - remote_id: '19281' - label: I am currently authorised - - remote_id: '38372' - label: I am currently not eligible - x-merge-expands-to: ScreeningQuestionOption - remote_was_deleted: - type: boolean - description: 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/). - x-merge-expands: '{"job": "Job", "options": "ScreeningQuestionOption"}' - x-merge-category: ats - ScreeningQuestionAnswer: - type: object - description: |- - # The ScreeningQuestionAnswer Object - ### Description - The `ScreeningQuestionAnswer` object is used to represent candidate responses to a screening question, for a specific application. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - question: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/ScreeningQuestion' - nullable: true - example: 0238cbc6-6040-430a-848e-aaiehfhdbadf4ae - description: The screening question associated with the candidate’s answer. - To determine the data type of the answer, you can expand on the screening - question by adding `screening_question_answers.question` to the `expand` - query parameter. - x-merge-expands-to: ScreeningQuestion - answer: - type: string - nullable: true - description: The candidate’s response to the screening question. - maxLength: 10000 - example: 5+ years experience - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-expands: '{"question": "ScreeningQuestion"}' - x-merge-category: ats - ScreeningQuestionAnswerRequest: - type: object - description: |- - # The ScreeningQuestionAnswer Object - ### Description - The `ScreeningQuestionAnswer` object is used to represent candidate responses to a screening question, for a specific application. - - ### Usage Example - TODO - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - question: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/ScreeningQuestion' - nullable: true - example: 0238cbc6-6040-430a-848e-aaiehfhdbadf4ae - description: The screening question associated with the candidate’s answer. - To determine the data type of the answer, you can expand on the screening - question by adding `screening_question_answers.question` to the `expand` - query parameter. - x-merge-expands-to: ScreeningQuestion - answer: - type: string - nullable: true - description: The candidate’s response to the screening question. - maxLength: 10000 - example: 5+ years experience - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"question": "ScreeningQuestion"}' - x-merge-category: ats - ScreeningQuestionOption: - type: object - description: |- - # The ScreeningQuestionOption Object - ### Description - The `ScreeningQuestionOption` object is used to represent options for a `ScreeningQuestion` object - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - label: - type: string - nullable: true - description: Available response options - maxLength: 300 - example: 5+ years experience - remote_was_deleted: - type: boolean - description: 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/). - x-merge-nested-write-allowed: true - x-merge-category: ats - ScreeningQuestionTypeEnum: - enum: - - DATE - - FILE - - SINGLE_SELECT - - MULTI_SELECT - - SINGLE_LINE_TEXT - - MULTI_LINE_TEXT - - NUMERIC - - BOOLEAN - type: string - description: |- - * `DATE` - DATE - * `FILE` - FILE - * `SINGLE_SELECT` - SINGLE_SELECT - * `MULTI_SELECT` - MULTI_SELECT - * `SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT - * `MULTI_LINE_TEXT` - MULTI_LINE_TEXT - * `NUMERIC` - NUMERIC - * `BOOLEAN` - BOOLEAN - x-merge-category: ats - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - type: string - description: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - x-merge-category: ats - StatusFd5Enum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: ats - SyncStatus: - type: object - description: |- - # 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: - type: string - example: Candidate - model_id: - type: string - example: ats.Candidate - last_sync_start: - type: string - format: date-time - example: '2021-03-30T19:44:18.695973Z' - next_sync_start: - type: string - format: date-time - example: '2021-03-30T20:44:18.662942Z' - last_sync_result: - oneOf: - - $ref: '#/components/schemas/LastSyncResultEnum' - - type: string - example: DONE - last_sync_finished: - type: string - format: date-time - example: '2021-03-30T19:55:18.695973Z' - status: - oneOf: - - $ref: '#/components/schemas/StatusFd5Enum' - - type: string - example: SYNCING - is_initial_sync: - type: boolean - example: true - selective_sync_configurations_usage: - $ref: '#/components/schemas/SelectiveSyncConfigurationsUsageEnum' - required: - - is_initial_sync - - model_id - - model_name - - status - x-merge-sample-json: '{"model_name": "Candidate", "model_id": "ats.Candidate", - "last_sync_start": "2021-03-30T19:44:18.695973Z", "next_sync_start": "2021-03-30T20:44:18.662942Z", - "status": "SYNCING", "is_initial_sync": true}' - x-merge-category: ats - Tag: - type: object - description: |- - # The Tag Object - ### Description - The `Tag` object is used to represent a tag for a candidate. - ### Usage Example - Fetch from the `LIST Tags` endpoint and view the tags used within a company. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '4567' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The tag's name. - example: High-Priority - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - type: object - additionalProperties: {} - nullable: true - description: The full data pulled from the third-party API for an object. - nullable: true - example: - - path: /tags - data: - - Varies by platform - x-merge-category: ats - UpdateApplicationStageRequest: - type: object - properties: - job_interview_stage: - type: string - format: uuid - nullable: true - description: The interview stage to move the application to. - remote_user_id: - type: string - minLength: 1 - x-merge-category: ats - Url: - type: object - description: |- - # The Url Object - ### Description - The `Url` object is used to represent hyperlinks associated with the parent model. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their website urls. - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - value: - type: string - format: uri - nullable: true - description: The site's url. - maxLength: 2000 - example: http://alturl.com/p749b - url_type: - oneOf: - - $ref: '#/components/schemas/UrlTypeEnum' - - type: string - nullable: true - description: |- - The type of site. - - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - example: PERSONAL - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - x-merge-nested-write-allowed: true - x-merge-category: ats - UrlRequest: - type: object - description: |- - # The Url Object - ### Description - The `Url` object is used to represent hyperlinks associated with the parent model. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their website urls. - properties: - value: - type: string - format: uri - nullable: true - description: The site's url. - maxLength: 2000 - example: http://alturl.com/p749b - url_type: - oneOf: - - $ref: '#/components/schemas/UrlTypeEnum' - - type: string - nullable: true - description: |- - The type of site. - - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - example: PERSONAL - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: ats - UrlTypeEnum: - enum: - - PERSONAL - - COMPANY - - PORTFOLIO - - BLOG - - SOCIAL_MEDIA - - OTHER - - JOB_POSTING - type: string - description: |- - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - x-merge-category: ats - ValidationProblemSource: - type: object - properties: - pointer: - type: string - required: - - pointer - x-merge-category: ats - VeteranStatusEnum: - enum: - - I_AM_NOT_A_PROTECTED_VETERAN - - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - - I_DONT_WISH_TO_ANSWER - type: string - description: |- - * `I_AM_NOT_A_PROTECTED_VETERAN` - I_AM_NOT_A_PROTECTED_VETERAN - * `I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN` - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - x-merge-category: ats - VisibilityEnum: - enum: - - ADMIN_ONLY - - PUBLIC - - PRIVATE - type: string - description: |- - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - x-merge-category: ats - WarningValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /age - title: - type: string - example: Unrecognized Field - detail: - type: string - example: An unrecognized field, age, was passed in with request data. - problem_type: - type: string - example: UNRECOGNIZED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: ats - WebhookReceiver: - type: object - properties: - event: - type: string - is_active: - type: boolean - key: - type: string - required: - - event - - is_active - x-merge-category: ats - WebhookReceiverRequest: - type: object - properties: - event: - type: string - minLength: 1 - is_active: - type: boolean - key: - type: string - minLength: 1 - required: - - event - - is_active - x-merge-category: ats - securitySchemes: - tokenAuth: - type: http - scheme: bearer - description: Token-based authentication with required prefix "Bearer" - x-fern-token-variable-name: api_key -servers: -- url: https://api.merge.dev/api/ats/v1 - description: Production - x-fern-server-name: Production -- url: https://api-sandbox.merge.dev/api/ats/v1 - description: Sandbox - x-fern-server-name: Sandbox -- url: https://api-eu.merge.dev/api/ats/v1 - description: Production EU - x-fern-server-name: ProductionEU -- url: https://api-ap.merge.dev/api/ats/v1 - description: Production APSE1 - x-fern-server-name: ProductionAPSE1 diff --git a/.mock/crm_v3.yml b/.mock/crm_v3.yml deleted file mode 100644 index 4e754eb5f..000000000 --- a/.mock/crm_v3.yml +++ /dev/null @@ -1,12652 +0,0 @@ -openapi: 3.0.3 -info: - title: Merge CRM API - version: '1.0' - description: The unified API for building rich integrations with multiple CRM platforms. - contact: - name: Merge Team - url: https://www.merge.dev/ - email: hello@merge.dev -paths: - /crm/v1/account-details: - get: - operationId: account_details_retrieve - description: Get details for a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - account-details - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountDetails' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/account-token/{public_token}: - get: - operationId: account_token_retrieve - description: Returns the account token for the end user with the provided public - token. - parameters: - - in: path - name: public_token - schema: - type: string - required: true - tags: - - account-token - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/accounts: - get: - operationId: accounts_list - description: Returns a list of `Account` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner: - value: owner - summary: Expand Owner - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return accounts with this name. - - in: query - name: owner_id - schema: - type: string - description: If provided, will only return accounts with this owner. - examples: - OwnerId: - summary: owner_id - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: accounts_create - description: Creates an `Account` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - accounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CRMAccountEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CRMAccountEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CRMAccountEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CRMAccountResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/accounts/{id}: - get: - operationId: accounts_retrieve - description: Returns an `Account` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner: - value: owner - summary: Expand Owner - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Account' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: accounts_partial_update - description: Updates an `Account` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - accounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedCRMAccountEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedCRMAccountEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedCRMAccountEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CRMAccountResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/accounts/meta/patch/{id}: - get: - operationId: accounts_meta_patch_retrieve - description: Returns metadata for `CRMAccount` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/accounts/meta/post: - get: - operationId: accounts_meta_post_retrieve - description: Returns metadata for `CRMAccount` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/accounts/remote-field-classes: - get: - operationId: accounts_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/async-passthrough: - post: - operationId: async_passthrough_create - description: Asynchronously pull data from an endpoint not currently supported - by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - async-passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncPassthroughReciept' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/async-passthrough/{async_passthrough_receipt_id}: - get: - operationId: async_passthrough_retrieve - description: Retrieves data from earlier async-passthrough POST request - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: async_passthrough_receipt_id - schema: - type: string - format: uuid - required: true - tags: - - async-passthrough - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/RemoteResponse' - - type: string - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/audit-trail: - get: - operationId: audit_trail_list - description: Gets a list of audit trail events. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include audit trail events that occurred - before this time - - in: query - name: event_type - schema: - type: string - description: '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`' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include audit trail events that occurred - after this time - - in: query - name: user_email - schema: - type: string - description: 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. - tags: - - audit-trail - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAuditLogEventList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/available-actions: - get: - operationId: available_actions_retrieve - description: Returns a list of models and actions available for an account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - available-actions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AvailableActions' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/contacts: - get: - operationId: contacts_list - description: Returns a list of `Contact` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: account_id - schema: - type: string - description: If provided, will only return contacts with this account. - examples: - AccountId: - summary: account_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email_addresses - schema: - type: string - description: If provided, will only return contacts matching the email addresses; - multiple email_addresses can be separated by commas. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAccount,Owner: - value: account,owner - summary: Expand Account, Owner - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: phone_numbers - schema: - type: string - description: If provided, will only return contacts matching the phone numbers; - multiple phone numbers can be separated by commas. - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedContactList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: contacts_create - description: Creates a `Contact` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - contacts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CRMContactEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CRMContactEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CRMContactEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CRMContactResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/contacts/{id}: - get: - operationId: contacts_retrieve - description: Returns a `Contact` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAccount,Owner: - value: account,owner - summary: Expand Account, Owner - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Contact' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: contacts_partial_update - description: Updates a `Contact` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - contacts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedCRMContactEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedCRMContactEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedCRMContactEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CRMContactResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/contacts/ignore/{model_id}: - post: - operationId: contacts_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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: model_id - schema: - type: string - format: uuid - required: true - tags: - - contacts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-extra-tags: - - ignore-model - /crm/v1/contacts/meta/patch/{id}: - get: - operationId: contacts_meta_patch_retrieve - description: Returns metadata for `CRMContact` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/contacts/meta/post: - get: - operationId: contacts_meta_post_retrieve - description: Returns metadata for `CRMContact` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/contacts/remote-field-classes: - get: - operationId: contacts_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes: - get: - operationId: custom_object_classes_list - description: Returns a list of `CustomObjectClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - fields - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandFields: - value: fields - summary: Expand Fields - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - custom-object-classes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCustomObjectClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/{custom_object_class_id}/association-types: - get: - operationId: custom_object_classes_association_types_list - description: Returns a list of `AssociationType` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - target_object_classes - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTargetObjectClasses: - value: target_object_classes - summary: Expand Target_object_classes - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - association-types - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAssociationTypeList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - post: - operationId: custom_object_classes_association_types_create - description: Creates an `AssociationType` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - association-types - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CRMAssociationTypeEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CRMAssociationTypeEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CRMAssociationTypeEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CRMAssociationTypeResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/{custom_object_class_id}/association-types/{id}: - get: - operationId: custom_object_classes_association_types_retrieve - description: Returns an `AssociationType` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - target_object_classes - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTargetObjectClasses: - value: target_object_classes - summary: Expand Target_object_classes - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - association-types - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AssociationType' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/{custom_object_class_id}/association-types/meta/post: - get: - operationId: custom_object_classes_association_types_meta_post_retrieve - description: Returns metadata for `CRMAssociationType` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - tags: - - association-types - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects: - get: - operationId: custom_object_classes_custom_objects_list - description: Returns a list of `CustomObject` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - custom-objects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCustomObjectList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - post: - operationId: custom_object_classes_custom_objects_create - description: Creates a `CustomObject` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - custom-objects - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CRMCustomObjectEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CRMCustomObjectEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CRMCustomObjectEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CRMCustomObjectResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{id}: - get: - operationId: custom_object_classes_custom_objects_retrieve - description: Returns a `CustomObject` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - custom-objects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomObject' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{object_id}/associations: - get: - operationId: custom_object_classes_custom_objects_associations_list - description: Returns a list of `Association` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: association_type_id - schema: - type: string - description: If provided, will only return opportunities with this association_type. - examples: - AssociationTypeId: - summary: association_type_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - association_type - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAssociationType: - value: association_type - summary: Expand Association_type - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: path - name: object_id - schema: - type: string - format: uuid - required: true - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - associations - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAssociationList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/meta/post: - get: - operationId: custom_object_classes_custom_objects_meta_post_retrieve - description: Returns metadata for `CRMCustomObject` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: custom_object_class_id - schema: - type: string - format: uuid - required: true - tags: - - custom-objects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/{id}: - get: - operationId: custom_object_classes_retrieve - description: Returns a `CustomObjectClass` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - fields - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandFields: - value: fields - summary: Expand Fields - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - custom-object-classes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomObjectClass' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - ? /crm/v1/custom-object-classes/{source_class_id}/custom-objects/{source_object_id}/associations/{target_class_id}/{target_object_id}/{association_type_id} - : put: - operationId: custom_object_classes_custom_objects_associations_update - description: Creates an Association between `source_object_id` and `target_object_id` - of type `association_type_id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: association_type_id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - - in: path - name: source_class_id - schema: - type: string - format: uuid - required: true - - in: path - name: source_object_id - schema: - type: string - format: uuid - required: true - - in: path - name: target_class_id - schema: - type: string - required: true - - in: path - name: target_object_id - schema: - type: string - format: uuid - required: true - tags: - - associations - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Association' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/custom-object-classes/custom-objects/remote-field-classes: - get: - operationId: custom_object_classes_custom_objects_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - custom-objects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/default-scopes: - get: - operationId: default_scopes_retrieve - description: 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). - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/delete-account: - post: - operationId: delete_account_delete - description: Delete a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - delete-account - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/engagement-types: - get: - operationId: engagement_types_list - description: Returns a list of `EngagementType` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - engagement-types - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEngagementTypeList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/engagement-types/{id}: - get: - operationId: engagement_types_retrieve - description: Returns an `EngagementType` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - engagement-types - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EngagementType' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/engagement-types/remote-field-classes: - get: - operationId: engagement_types_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - engagement-types - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/engagements: - get: - operationId: engagements_list - description: Returns a list of `Engagement` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - contacts - - engagement_type - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandContacts,Owner,Account,EngagementType: - value: contacts,owner,account,engagement_type - summary: Expand Contacts, Owner, Account, Engagement_type - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: started_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return engagements started after this - datetime. - - in: query - name: started_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return engagements started before this - datetime. - tags: - - engagements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEngagementList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: engagements_create - description: Creates an `Engagement` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - engagements - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EngagementEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EngagementEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EngagementEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/EngagementResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/engagements/{id}: - get: - operationId: engagements_retrieve - description: Returns an `Engagement` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - contacts - - engagement_type - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandContacts,Owner,Account,EngagementType: - value: contacts,owner,account,engagement_type - summary: Expand Contacts, Owner, Account, Engagement_type - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - engagements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Engagement' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: engagements_partial_update - description: Updates an `Engagement` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - engagements - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEngagementEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEngagementEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEngagementEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EngagementResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/engagements/meta/patch/{id}: - get: - operationId: engagements_meta_patch_retrieve - description: Returns metadata for `Engagement` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - engagements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/engagements/meta/post: - get: - operationId: engagements_meta_post_retrieve - description: Returns metadata for `Engagement` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - engagements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/engagements/remote-field-classes: - get: - operationId: engagements_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - engagements - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/field-mappings: - get: - operationId: field_mappings_retrieve - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingApiInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: field_mappings_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/field-mappings/{field_mapping_id}: - patch: - operationId: field_mappings_partial_update - 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - delete: - operationId: field_mappings_destroy - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '204': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/generate-key: - post: - operationId: generate_key_create - description: Create a remote key. - tags: - - generate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/issues: - get: - operationId: issues_list - description: Gets all issues for Organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: account_token - schema: - type: string - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred before this time - - in: query - name: end_user_organization_name - schema: - type: string - - in: query - name: first_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was after this datetime. - - in: query - name: first_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was before this datetime. - - in: query - name: include_muted - schema: - type: string - description: If true, will include muted issues - - in: query - name: integration_name - schema: - type: string - - in: query - name: last_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was after this datetime. - - in: query - name: last_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was before this datetime. - - in: query - name: linked_account_id - schema: - type: string - description: If provided, will only include issues pertaining to the linked - account passed in. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred after this time - - in: query - name: status - schema: - type: string - enum: - - ONGOING - - RESOLVED - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedIssueList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/issues/{id}: - get: - operationId: issues_retrieve - description: Get a specific issue. - parameters: - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Issue' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/leads: - get: - operationId: leads_list - description: Returns a list of `Lead` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: converted_account_id - schema: - type: string - description: If provided, will only return leads with this account. - examples: - ConvertedAccountId: - summary: converted_account_id - - in: query - name: converted_contact_id - schema: - type: string - description: If provided, will only return leads with this contact. - examples: - ConvertedContactId: - summary: converted_contact_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email_addresses - schema: - type: string - description: If provided, will only return contacts matching the email addresses; - multiple email_addresses can be separated by commas. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - converted_account - - converted_contact - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,ConvertedContact,ConvertedAccount: - value: owner,converted_contact,converted_account - summary: Expand Owner, Converted_contact, Converted_account - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: owner_id - schema: - type: string - description: If provided, will only return leads with this owner. - examples: - OwnerId: - summary: owner_id - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: phone_numbers - schema: - type: string - description: If provided, will only return contacts matching the phone numbers; - multiple phone numbers can be separated by commas. - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - leads - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedLeadList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: leads_create - description: Creates a `Lead` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - leads - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LeadEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/LeadEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/LeadEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/LeadResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/leads/{id}: - get: - operationId: leads_retrieve - description: Returns a `Lead` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - converted_account - - converted_contact - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,ConvertedContact,ConvertedAccount: - value: owner,converted_contact,converted_account - summary: Expand Owner, Converted_contact, Converted_account - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - leads - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Lead' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/leads/meta/post: - get: - operationId: leads_meta_post_retrieve - description: Returns metadata for `Lead` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - leads - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/leads/remote-field-classes: - get: - operationId: leads_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - leads - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/link-token: - post: - operationId: link_token_create - description: Creates a link token to be used when linking a new end user. - tags: - - link-token - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LinkToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/linked-account-scopes: - get: - operationId: linked_account_scopes_retrieve - 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). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: linked_account_scopes_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/linked-accounts: - get: - operationId: linked_accounts_list - description: List linked accounts for your organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: category - schema: - type: string - nullable: true - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - description: |- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` - - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_user_email_address - schema: - type: string - description: If provided, will only return linked accounts associated with - the given email address. - - in: query - name: end_user_organization_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given organization name. - - in: query - name: end_user_origin_id - schema: - type: string - description: If provided, will only return linked accounts associated with - the given origin ID. - - in: query - name: end_user_origin_ids - schema: - type: string - description: Comma-separated list of EndUser origin IDs, making it possible - to specify multiple EndUsers at once. - - in: query - name: id - schema: - type: string - format: uuid - - in: query - name: ids - schema: - type: string - description: Comma-separated list of LinkedAccount IDs, making it possible - to specify multiple LinkedAccounts at once. - - in: query - name: include_duplicates - schema: - type: boolean - description: 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. - - in: query - name: integration_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given integration name. - - in: query - name: is_test_account - schema: - type: string - description: If included, will only include test linked accounts. If not included, - will only include non-test linked accounts. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: status - schema: - type: string - description: 'Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, - `RELINK_NEEDED`' - tags: - - linked-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountDetailsAndActionsList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/notes: - get: - operationId: notes_list - description: Returns a list of `Note` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: account_id - schema: - type: string - description: If provided, will only return notes with this account. - examples: - AccountId: - summary: account_id - - in: query - name: contact_id - schema: - type: string - description: If provided, will only return notes with this contact. - examples: - ContactId: - summary: contact_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - contact - - opportunity - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,Contact,Account,Opportunity: - value: owner,contact,account,opportunity - summary: Expand Owner, Contact, Account, Opportunity - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: opportunity_id - schema: - type: string - description: If provided, will only return notes with this opportunity. - examples: - OpportunityId: - summary: opportunity_id - - in: query - name: owner_id - schema: - type: string - description: If provided, will only return notes with this owner. - examples: - OwnerId: - summary: owner_id - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - notes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedNoteList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: notes_create - description: Creates a `Note` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - notes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/NoteEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/NoteEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/NoteEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/NoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/notes/{id}: - get: - operationId: notes_retrieve - description: Returns a `Note` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - contact - - opportunity - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,Contact,Account,Opportunity: - value: owner,contact,account,opportunity - summary: Expand Owner, Contact, Account, Opportunity - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - notes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Note' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/notes/meta/post: - get: - operationId: notes_meta_post_retrieve - description: Returns metadata for `Note` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - notes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/notes/remote-field-classes: - get: - operationId: notes_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - notes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/opportunities: - get: - operationId: opportunities_list - description: Returns a list of `Opportunity` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: account_id - schema: - type: string - description: If provided, will only return opportunities with this account. - examples: - AccountId: - summary: account_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - owner - - stage - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,Stage,Account: - value: owner,stage,account - summary: Expand Owner, Stage, Account - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: owner_id - schema: - type: string - description: If provided, will only return opportunities with this owner. - examples: - OwnerId: - summary: owner_id - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_created_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return opportunities created in the third - party platform after this datetime. - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: stage_id - schema: - type: string - description: If provided, will only return opportunities with this stage. - examples: - StageId: - summary: stage_id - - in: query - name: status - schema: - type: string - nullable: true - enum: - - LOST - - OPEN - - WON - description: |- - If provided, will only return opportunities with this status. Options: ('OPEN', 'WON', 'LOST') - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - tags: - - opportunities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedOpportunityList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: opportunities_create - description: Creates an `Opportunity` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - opportunities - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpportunityEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/OpportunityEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/OpportunityEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/OpportunityResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/opportunities/{id}: - get: - operationId: opportunities_retrieve - description: Returns an `Opportunity` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - owner - - stage - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,Stage,Account: - value: owner,stage,account - summary: Expand Owner, Stage, Account - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - status - description: 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) - examples: - OriginalEnumValuesStatus: - value: status - summary: Original Enum Values Status - tags: - - opportunities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Opportunity' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: opportunities_partial_update - description: Updates an `Opportunity` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - opportunities - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedOpportunityEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedOpportunityEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedOpportunityEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OpportunityResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/opportunities/meta/patch/{id}: - get: - operationId: opportunities_meta_patch_retrieve - description: Returns metadata for `Opportunity` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - opportunities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/opportunities/meta/post: - get: - operationId: opportunities_meta_post_retrieve - description: Returns metadata for `Opportunity` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - opportunities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/opportunities/remote-field-classes: - get: - operationId: opportunities_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - opportunities - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/passthrough: - post: - operationId: passthrough_create - description: Pull data from an endpoint not currently supported by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/regenerate-key: - post: - operationId: regenerate_key_create - description: Exchange remote keys. - tags: - - regenerate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/remote-fields: - get: - operationId: 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: common_models - schema: - type: string - description: A comma seperated list of Common Model names. If included, will - only return Remote Fields for those Common Models. - - in: query - name: include_example_values - schema: - type: string - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/stages: - get: - operationId: stages_list - description: Returns a list of `Stage` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - stages - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedStageList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/stages/{id}: - get: - operationId: stages_retrieve - description: Returns a `Stage` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - stages - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Stage' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/stages/remote-field-classes: - get: - operationId: stages_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - stages - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/sync-status: - get: - operationId: 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). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - sync-status - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedSyncStatusList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/sync-status/resync: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - force-resync - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/target-fields: - get: - operationId: target_fields_retrieve - 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalTargetFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/tasks: - get: - operationId: tasks_list - description: Returns a list of `Task` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - opportunity - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,Account,Opportunity: - value: owner,account,opportunity - summary: Expand Owner, Account, Opportunity - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - tasks - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTaskList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: tasks_create - description: Creates a `Task` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - tasks - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TaskEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TaskEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/TaskEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TaskResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/tasks/{id}: - get: - operationId: tasks_retrieve - description: Returns a `Task` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - opportunity - - owner - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandOwner,Account,Opportunity: - value: owner,account,opportunity - summary: Expand Owner, Account, Opportunity - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - tasks - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Task' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: tasks_partial_update - description: Updates a `Task` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - tasks - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedTaskEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedTaskEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedTaskEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TaskResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/tasks/meta/patch/{id}: - get: - operationId: tasks_meta_patch_retrieve - description: Returns metadata for `Task` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - tasks - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/tasks/meta/post: - get: - operationId: tasks_meta_post_retrieve - description: Returns metadata for `Task` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - tasks - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/tasks/remote-field-classes: - get: - operationId: tasks_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - tasks - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/users: - get: - operationId: users_list - description: Returns a list of `User` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email - schema: - type: string - nullable: true - description: If provided, will only return users with this email. - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/users/{id}: - get: - operationId: users_retrieve - description: Returns a `User` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /crm/v1/users/ignore/{model_id}: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: model_id - schema: - type: string - format: uuid - required: true - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-extra-tags: - - ignore-model - /crm/v1/users/remote-field-classes: - get: - operationId: users_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /crm/v1/webhook-receivers: - get: - operationId: webhook_receivers_list - description: Returns a list of `WebhookReceiver` objects. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: webhook_receivers_create - description: Creates a `WebhookReceiver` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC -components: - schemas: - Account: - type: object - description: |- - # The Account Object - ### Description - The `Account` object is used to represent a company in a CRM system. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The account's owner. - example: 0258cbc6-6020-430a-848e-aafacbadf4ae - x-merge-expands-to: User - name: - type: string - nullable: true - description: The account's name. - example: Merge API - description: - type: string - nullable: true - description: The account's description. - example: One API for all integrations - industry: - type: string - nullable: true - description: The account's industry. - example: API's - website: - type: string - format: uri - nullable: true - description: The account's website. - maxLength: 2000 - example: https://merge.dev/ - number_of_employees: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The account's number of employees. - example: 276000 - addresses: - type: array - items: - $ref: '#/components/schemas/Address' - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumber' - readOnly: true - example: - - phone_number: '+16788879833' - phone_number_type: Mobile - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - last_activity_at: - type: string - format: date-time - nullable: true - description: The last date (either most recent or furthest in the future) - of when an activity occurs in an account. - example: '2022-02-10T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the CRM system account data was last modified by a user - with a login. - example: '2022-01-09T00:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's account was created. - example: '2021-11-10T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /accounts - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"owner": "User"}' - x-merge-category: crm - AccountDetails: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - integration: - type: string - readOnly: true - example: BambooHR - integration_slug: - type: string - readOnly: true - example: bamboohr - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - nullable: true - example: hris - end_user_origin_id: - type: string - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - end_user_organization_name: - type: string - readOnly: true - example: Waystar Royco - end_user_email_address: - type: string - format: email - readOnly: true - example: kendall.roy@waystar-royco.com - status: - type: string - readOnly: true - example: COMPLETE - webhook_listener_url: - type: string - format: uri - readOnly: true - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - readOnly: true - description: 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. - example: true - account_type: - type: string - readOnly: true - example: PRODUCTION - completed_at: - type: string - format: date-time - nullable: true - description: The time at which account completes the linking flow. - example: '2024-08-26T20:11:19.277118Z' - x-merge-category: crm - AccountDetailsAndActions: - type: object - description: |- - # 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: - type: string - example: e59b1821-f85c-4e28-a6b3-1804156f3563 - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - example: hris - status: - oneOf: - - $ref: '#/components/schemas/AccountDetailsAndActionsStatusEnum' - - type: string - example: INCOMPLETE - status_detail: - type: string - example: Invalid login credentials - end_user_origin_id: - type: string - example: 3ac95cde-6c7f-4eef-afec-be710b42308d - end_user_organization_name: - type: string - example: Foo Bar, LLC - end_user_email_address: - type: string - example: hradmin@foobar.dev - subdomain: - type: string - description: The tenant or domain the customer has provided access to. - example: foobar - webhook_listener_url: - type: string - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - description: 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. - example: true - integration: - $ref: '#/components/schemas/AccountDetailsAndActionsIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - 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: - type: string - example: PRODUCTION - completed_at: - type: string - format: date-time - example: '2024-08-26T20:11:19.277118Z' - required: - - account_type - - completed_at - - end_user_email_address - - end_user_organization_name - - id - - status - - webhook_listener_url - x-merge-sample-json: '{"id": "e59b1821-f85c-4e28-a6b3-1804156f3563", "category": - "hris", "status": "INCOMPLETE", "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", "webhook_listener_url": - "https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4", - "is_duplicate": true, "integration": {"name": "SAP SuccessFactors", "categories": - ["hris", "ats"], "image": "https://cdn.merge.dev/SuccessFactors_Logo.png", - "square_image": "https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg", "color": - "#F6A704", "slug": "sap-successfactors", "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"]}]}}' - x-merge-category: crm - AccountDetailsAndActionsIntegration: - type: object - properties: - name: - type: string - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - image: - type: string - square_image: - type: string - color: - type: string - slug: - type: string - passthrough_available: - type: boolean - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - required: - - categories - - color - - name - - passthrough_available - - slug - x-merge-category: crm - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - type: string - description: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - x-merge-category: crm - AccountIntegration: - type: object - properties: - name: - type: string - description: Company name. - abbreviated_name: - type: string - nullable: true - description: "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: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: Category or categories this integration belongs to. Multiple - categories should be comma separated, i.e. [ats, hris]. - readOnly: true - image: - type: string - format: uri - nullable: true - description: Company logo in rectangular shape. - square_image: - type: string - format: uri - nullable: true - description: Company logo in square shape. - color: - type: string - description: The color of this integration used for buttons and text throughout - the app and landing pages. Choose a darker, saturated color. - pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ - maxLength: 18 - slug: - type: string - readOnly: true - api_endpoints_to_documentation_urls: - type: object - additionalProperties: {} - description: "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: string - nullable: true - description: Setup guide URL for third party webhook creation. Exposed in - Merge Docs. - category_beta_status: - type: object - description: Category or categories this integration is in beta status for. - readOnly: true - required: - - name - x-merge-category: crm - AccountRequest: - type: object - description: |- - # The Account Object - ### Description - The `Account` object is used to represent a company in a CRM system. - ### Usage Example - TODO - properties: - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The account's owner. - example: 0258cbc6-6020-430a-848e-aafacbadf4ae - x-merge-expands-to: User - name: - type: string - nullable: true - description: The account's name. - example: Merge API - description: - type: string - nullable: true - description: The account's description. - example: One API for all integrations - industry: - type: string - nullable: true - description: The account's industry. - example: API's - website: - type: string - format: uri - nullable: true - description: The account's website. - maxLength: 2000 - example: https://merge.dev/ - number_of_employees: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The account's number of employees. - example: 276000 - addresses: - type: array - items: - $ref: '#/components/schemas/AddressRequest' - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - last_activity_at: - type: string - format: date-time - nullable: true - description: The last date (either most recent or furthest in the future) - of when an activity occurs in an account. - example: '2022-02-10T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"owner": "User"}' - x-merge-category: crm - AccountToken: - type: object - properties: - account_token: - type: string - example: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB - integration: - $ref: '#/components/schemas/AccountIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - id: - type: string - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - required: - - account_token - - id - - integration - x-merge-category: crm - ActivityTypeEnum: - enum: - - CALL - - MEETING - - EMAIL - type: string - description: |- - * `CALL` - CALL - * `MEETING` - MEETING - * `EMAIL` - EMAIL - x-merge-category: crm - Address: - type: object - description: |- - # The Address Object - ### Description - The `Address` object is used to represent an entity's address. - ### Usage Example - TODO - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - street_1: - type: string - nullable: true - description: Line 1 of the address's street. - example: 50 Bowling Green Dr - street_2: - type: string - nullable: true - description: Line 2 of the address's street. - example: Golden Gate Park - city: - type: string - nullable: true - description: The address's city. - example: San Francisco - state: - type: string - nullable: true - description: The address's state. - example: CA - postal_code: - type: string - nullable: true - description: The address's postal code. - example: '94122' - country: - oneOf: - - $ref: '#/components/schemas/CountryEnum' - - type: string - nullable: true - description: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - example: US - address_type: - oneOf: - - $ref: '#/components/schemas/AddressTypeEnum' - - type: string - nullable: true - description: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - example: Shipping - x-merge-nested-write-allowed: true - x-merge-category: crm - AddressRequest: - type: object - description: |- - # The Address Object - ### Description - The `Address` object is used to represent an entity's address. - ### Usage Example - TODO - properties: - street_1: - type: string - nullable: true - description: Line 1 of the address's street. - example: 50 Bowling Green Dr - street_2: - type: string - nullable: true - description: Line 2 of the address's street. - example: Golden Gate Park - city: - type: string - nullable: true - description: The address's city. - example: San Francisco - state: - type: string - nullable: true - description: The address's state. - example: CA - postal_code: - type: string - nullable: true - description: The address's postal code. - example: '94122' - country: - oneOf: - - $ref: '#/components/schemas/CountryEnum' - - type: string - nullable: true - description: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - example: US - address_type: - oneOf: - - $ref: '#/components/schemas/AddressTypeEnum' - - type: string - nullable: true - description: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - example: Shipping - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: crm - AddressTypeEnum: - enum: - - BILLING - - SHIPPING - type: string - description: |- - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - x-merge-category: crm - AdvancedMetadata: - type: object - properties: - id: - type: string - format: uuid - display_name: - type: string - description: - type: string - is_required: - type: boolean - is_custom: - type: boolean - field_choices: - type: array - items: {} - required: - - id - x-merge-category: crm - Association: - type: object - description: |- - # The Association Object - ### Description - The `Association` record refers to an instance of an Association Type. - ### Usage Example - TODO - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - source_object: - type: string - format: uuid - readOnly: true - example: a8f5d29f-4e50-473f-8f12-27128ffcd37a - target_object: - type: string - format: uuid - readOnly: true - example: da0b1963-be70-469c-9f8c-06a81d0fe759 - association_type: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/AssociationType' - nullable: true - description: The association type the association belongs to. - example: 88a71b5c-a3cc-4bce-84ff-d18b049a4081 - x-merge-expands-to: AssociationType - x-merge-expands: '{"association_type": "AssociationType"}' - x-merge-category: crm - AssociationSubType: - type: object - properties: - id: - type: string - nullable: true - readOnly: true - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - origin_type: - type: string - nullable: true - readOnly: true - x-merge-category: crm - AssociationType: - type: object - description: |- - # The AssociationType Object - ### Description - The `Association Type` object represents the relationship between two objects. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 5bb73c32-3c6c-4757-ab7d-7d3540a1be31 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '93' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - source_object_class: - type: object - additionalProperties: {} - readOnly: true - description: The class of the source object (Custom Object or Common Model) - for the association type. - example: - id: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - origin_type: CUSTOM_OBJECT - target_object_classes: - type: array - items: - $ref: '#/components/schemas/AssociationSubType' - readOnly: true - example: - - id: Opportunity - origin_type: COMMON_MODEL - x-merge-expands-to: AssociationSubType - remote_key_name: - type: string - nullable: true - example: order_to_opportunity - display_name: - type: string - nullable: true - example: Order to Opportunity - cardinality: - oneOf: - - $ref: '#/components/schemas/CardinalityEnum' - - type: string - nullable: true - example: ONE_TO_MANY - is_required: - type: boolean - x-merge-expands: '{"target_object_classes": "AssociationSubType"}' - x-merge-category: crm - AssociationTypeRequestRequest: - type: object - properties: - source_object_class: - $ref: '#/components/schemas/ObjectClassDescriptionRequest' - target_object_classes: - type: array - items: - $ref: '#/components/schemas/ObjectClassDescriptionRequest' - x-merge-expands-to: AssociationSubType - remote_key_name: - type: string - minLength: 1 - display_name: - type: string - minLength: 1 - cardinality: - $ref: '#/components/schemas/CardinalityEnum' - is_required: - type: boolean - default: false - required: - - remote_key_name - - source_object_class - - target_object_classes - x-merge-expands: '{"target_object_classes": "AssociationSubType"}' - x-merge-category: crm - AsyncPassthroughReciept: - type: object - properties: - async_passthrough_receipt_id: - type: string - format: uuid - example: fd29020f-2695-445e-922e-dcd5e81903fd - required: - - async_passthrough_receipt_id - x-merge-category: crm - AuditLogEvent: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: b5ceea2a-7171-47ce-8090-165cfce5572c - user_name: - type: string - nullable: true - description: The User's full name at the time of this Event occurring. - maxLength: 200 - example: Gil Feig - user_email: - type: string - format: email - nullable: true - description: The User's email at the time of this Event occurring. - maxLength: 254 - example: hello@merge.dev - role: - oneOf: - - $ref: '#/components/schemas/RoleEnum' - - type: string - description: |- - 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 - example: ADMIN - ip_address: - type: string - maxLength: 45 - example: 192.0.2.123 - event_type: - oneOf: - - $ref: '#/components/schemas/EventTypeEnum' - - type: string - description: |- - 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 - example: CHANGED_SCOPES - event_description: - type: string - example: Organization-wide Scopes for model hris.Employee updated from Read - to Read+Write - created_at: - type: string - format: date-time - readOnly: true - required: - - event_description - - event_type - - ip_address - - role - x-merge-category: crm - AvailableActions: - type: object - description: |- - # 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: - $ref: '#/components/schemas/AccountIntegration' - example: - name: Lever - categories: - - ats - image: https://merge-api-production.s3.amazonaws.com/media/Lever_Logo.png - square_image: https://merge-api-production.s3.amazonaws.com/media/Lever_Square_Logo.png - color: '#262A34' - is_in_beta: 'true' - api_endpoints_to_documentation_urls: "{'GET': [('/common-model-scopes', - 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve')], - 'POST': []}" - passthrough_available: - type: boolean - example: true - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - example: - - model_name: Candidate - available_operations: - - FETCH - - CREATE - required_post_parameters: - - remote_user_id - supported_fields: - - first_name - - last_name - - company - - title - required: - - integration - - passthrough_available - x-merge-category: crm - CRMAccountEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/AccountRequest' - required: - - model - x-merge-category: crm - CRMAccountResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Account' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - CRMAssociationTypeEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/AssociationTypeRequestRequest' - required: - - model - x-merge-category: crm - CRMAssociationTypeResponse: - type: object - properties: - model: - $ref: '#/components/schemas/AssociationType' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - CRMContactEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ContactRequest' - required: - - model - x-merge-category: crm - CRMContactResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Contact' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - CRMCustomObjectEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/CustomObjectRequest' - required: - - model - x-merge-category: crm - CRMCustomObjectResponse: - type: object - properties: - model: - $ref: '#/components/schemas/CustomObject' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - CardinalityEnum: - enum: - - ONE_TO_ONE - - MANY_TO_ONE - - MANY_TO_MANY - - ONE_TO_MANY - type: string - description: |- - * `ONE_TO_ONE` - ONE_TO_ONE - * `MANY_TO_ONE` - MANY_TO_ONE - * `MANY_TO_MANY` - MANY_TO_MANY - * `ONE_TO_MANY` - ONE_TO_MANY - x-merge-category: crm - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: crm - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: crm - CommonModelScopeAPI: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializer' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: crm - CommonModelScopesBodyRequest: - type: object - properties: - model_id: - type: string - minLength: 1 - example: hris.Employee - enabled_actions: - type: array - items: - $ref: '#/components/schemas/EnabledActionsEnum' - example: - - READ - - WRITE - disabled_fields: - type: array - items: - type: string - minLength: 1 - example: - - first_name - required: - - disabled_fields - - enabled_actions - - model_id - x-merge-category: crm - Contact: - type: object - description: |- - # The Contact Object - ### Description - The `Contact` object is used to represent an existing point of contact at a company in a CRM system. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - first_name: - type: string - nullable: true - description: The contact's first name. - example: Gil - last_name: - type: string - nullable: true - description: The contact's last name. - example: Feig - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The contact's account. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Account - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The contact's owner. - example: b8fbfc30-0982-420e-8c20-dab07b70b9d6 - addresses: - type: array - items: - $ref: '#/components/schemas/Address' - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddress' - example: - - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumber' - example: - - phone_number: '+13785579223' - phone_number_type: Mobile - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - last_activity_at: - type: string - format: date-time - nullable: true - description: When the contact's last activity occurred. - example: '2022-02-10T00:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's contact was created. - example: '2021-11-10T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /contacts - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account"}' - x-merge-category: crm - ContactRequest: - type: object - description: |- - # The Contact Object - ### Description - The `Contact` object is used to represent an existing point of contact at a company in a CRM system. - ### Usage Example - TODO - properties: - first_name: - type: string - nullable: true - description: The contact's first name. - example: Gil - last_name: - type: string - nullable: true - description: The contact's last name. - example: Feig - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The contact's account. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Account - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The contact's owner. - example: b8fbfc30-0982-420e-8c20-dab07b70b9d6 - addresses: - type: array - items: - $ref: '#/components/schemas/AddressRequest' - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddressRequest' - example: - - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumberRequest' - example: - - phone_number: '+13785579223' - phone_number_type: Mobile - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - last_activity_at: - type: string - format: date-time - nullable: true - description: When the contact's last activity occurred. - example: '2022-02-10T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account"}' - x-merge-category: crm - CountryEnum: - enum: - - AF - - AX - - AL - - DZ - - AS - - AD - - AO - - AI - - AQ - - AG - - AR - - AM - - AW - - AU - - AT - - AZ - - BS - - BH - - BD - - BB - - BY - - BE - - BZ - - BJ - - BM - - BT - - BO - - BQ - - BA - - BW - - BV - - BR - - IO - - BN - - BG - - BF - - BI - - CV - - KH - - CM - - CA - - KY - - CF - - TD - - CL - - CN - - CX - - CC - - CO - - KM - - CG - - CD - - CK - - CR - - CI - - HR - - CU - - CW - - CY - - CZ - - DK - - DJ - - DM - - DO - - EC - - EG - - SV - - GQ - - ER - - EE - - SZ - - ET - - FK - - FO - - FJ - - FI - - FR - - GF - - PF - - TF - - GA - - GM - - GE - - DE - - GH - - GI - - GR - - GL - - GD - - GP - - GU - - GT - - GG - - GN - - GW - - GY - - HT - - HM - - VA - - HN - - HK - - HU - - IS - - IN - - ID - - IR - - IQ - - IE - - IM - - IL - - IT - - JM - - JP - - JE - - JO - - KZ - - KE - - KI - - KW - - KG - - LA - - LV - - LB - - LS - - LR - - LY - - LI - - LT - - LU - - MO - - MG - - MW - - MY - - MV - - ML - - MT - - MH - - MQ - - MR - - MU - - YT - - MX - - FM - - MD - - MC - - MN - - ME - - MS - - MA - - MZ - - MM - - NA - - NR - - NP - - NL - - NC - - NZ - - NI - - NE - - NG - - NU - - NF - - KP - - MK - - MP - - NO - - OM - - PK - - PW - - PS - - PA - - PG - - PY - - PE - - PH - - PN - - PL - - PT - - PR - - QA - - RE - - RO - - RU - - RW - - BL - - SH - - KN - - LC - - MF - - PM - - VC - - WS - - SM - - ST - - SA - - SN - - RS - - SC - - SL - - SG - - SX - - SK - - SI - - SB - - SO - - ZA - - GS - - KR - - SS - - ES - - LK - - SD - - SR - - SJ - - SE - - CH - - SY - - TW - - TJ - - TZ - - TH - - TL - - TG - - TK - - TO - - TT - - TN - - TR - - TM - - TC - - TV - - UG - - UA - - AE - - GB - - UM - - US - - UY - - UZ - - VU - - VE - - VN - - VG - - VI - - WF - - EH - - YE - - ZM - - ZW - type: string - description: |- - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - x-merge-category: crm - CreateFieldMappingRequest: - type: object - properties: - target_field_name: - type: string - minLength: 1 - description: The name of the target field you want this remote field to - map to. - example: example_target_field_name - target_field_description: - type: string - minLength: 1 - description: The description of the target field you want this remote field - to map to. - example: this is a example description of the target field - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - common_model_name: - type: string - minLength: 1 - description: The name of the Common Model that the remote field corresponds - to in a given category. - example: ExampleCommonModel - required: - - common_model_name - - remote_field_traversal_path - - remote_method - - remote_url_path - - target_field_description - - target_field_name - x-merge-category: crm - CustomObject: - type: object - description: |- - # The CustomObject Object - ### Description - The `Custom Object` record refers to an instance of a Custom Object Class. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: da0b1963-be70-469c-9f8c-06a81d0fe759 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '4183634295' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - object_class: - type: string - format: uuid - nullable: true - description: The custom object class the custom object record belongs to. - example: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - fields: - type: object - additionalProperties: {} - readOnly: true - description: The fields and values contained within the custom object record. - example: - order_id: '4183634295' - order_quantity: 50 - customer_type: Returning - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-category: crm - CustomObjectClass: - type: object - description: |- - # The Custom Object Class Object - ### Description - The `Custom Object Class` object is used to represent a Custom Object Schema in the remote system. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '9579977' - created_at: - type: string - format: date-time - readOnly: true - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The custom object class's name. - example: order - description: - type: string - nullable: true - description: The custom object class's description. - example: Order object - labels: - type: object - additionalProperties: - type: string - nullable: true - readOnly: true - description: The custom object class's singular and plural labels. - example: - singular: Order - plural: Orders - fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldClassForCustomObjectClass' - readOnly: true - example: - - display_name: Order ID - remote_key_name: order_id - description: The unique ID for the order. - is_required: true - is_nested_list: false - field_type: string - field_format: string - field_choices: [] - item_schema: string - - display_name: Order Quantity - remote_key_name: order_quantity - description: The number of items ordered. - is_required: true - is_nested_list: false - field_type: number - field_format: number - field_choices: [] - item_schema: string - - display_name: Customer Type - remote_key_name: customer_type - description: The type of customer. - is_required: true - is_nested_list: false - field_type: string - field_format: enumeration - field_choices: - - New - - Returning - item_schema: - x-merge-expands-to: RemoteFieldClassForCustomObjectClass - association_types: - type: array - items: - type: object - additionalProperties: {} - nullable: true - readOnly: true - description: The types of associations with other models that the custom - object class can have. - x-merge-expands: '{"fields": "RemoteFieldClassForCustomObjectClass"}' - x-merge-category: crm - CustomObjectRequest: - type: object - properties: - fields: - type: object - additionalProperties: {} - example: - test_field: hello - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - required: - - fields - x-merge-category: crm - DataPassthroughRequest: - type: object - description: |- - # 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: - allOf: - - $ref: '#/components/schemas/MethodEnum' - example: POST - path: - type: string - minLength: 1 - description: The path of the request in the third party's platform. - example: /scooters - base_url_override: - type: string - nullable: true - minLength: 1 - description: An optional override of the third party's base url for the - request. - example: https://api.example.com - data: - type: string - nullable: true - minLength: 1 - description: The data with the request. You must include a `request_format` - parameter matching the data's format - example: '{"company": "Lime", "model": "Gen 2.5"}' - multipart_form_data: - type: array - items: - $ref: '#/components/schemas/MultipartFormFieldRequest' - nullable: true - description: Pass an array of `MultipartFormField` objects in here instead - of using the `data` param if `request_format` is set to `MULTIPART`. - headers: - type: object - additionalProperties: {} - nullable: true - description: 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. - example: - EXTRA-HEADER: value - request_format: - allOf: - - $ref: '#/components/schemas/RequestFormatEnum' - nullable: true - example: JSON - normalize_response: - type: boolean - description: '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`.' - required: - - method - - path - x-merge-category: crm - DebugModeLog: - type: object - properties: - log_id: - type: string - example: 99433219-8017-4acd-bb3c-ceb23d663832 - dashboard_view: - type: string - example: https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 - log_summary: - $ref: '#/components/schemas/DebugModelLogSummary' - example: - url: www.exampleintegration.com/api/v1/exampleapi - method: POST - status_code: 200 - required: - - dashboard_view - - log_id - - log_summary - x-merge-sample-json: '{"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}}' - x-merge-category: crm - DebugModelLogSummary: - type: object - properties: - url: - type: string - example: www.exampleintegration.com/api/v1/exampleapi - method: - type: string - example: POST - status_code: - type: integer - example: 200 - required: - - method - - status_code - - url - x-merge-sample-json: '{"url": "www.exampleintegration.com/api/v1/exampleapi", - "method": "POST", "status_code": 200}' - x-merge-category: crm - DirectionEnum: - enum: - - INBOUND - - OUTBOUND - type: string - description: |- - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - x-merge-category: crm - EmailAddress: - type: object - description: |- - # The EmailAddress Object - ### Description - The `EmailAddress` object is used to represent an entity's email address. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their email addresses. - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - email_address: - type: string - nullable: true - description: The email address. - example: merge_is_hiring@merge.dev - email_address_type: - type: string - nullable: true - description: The email address's type. - example: Work - x-merge-nested-write-allowed: true - x-merge-category: crm - EmailAddressRequest: - type: object - description: |- - # The EmailAddress Object - ### Description - The `EmailAddress` object is used to represent an entity's email address. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their email addresses. - properties: - email_address: - type: string - nullable: true - description: The email address. - example: merge_is_hiring@merge.dev - email_address_type: - type: string - nullable: true - description: The email address's type. - example: Work - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: crm - EnabledActionsEnum: - enum: - - READ - - WRITE - type: string - description: |- - * `READ` - READ - * `WRITE` - WRITE - x-merge-category: crm - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - type: string - description: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - x-merge-category: crm - EndUserDetailsRequest: - type: object - properties: - end_user_email_address: - type: string - minLength: 1 - description: Your end user's email address. This is purely for identification - purposes - setting this value will not cause any emails to be sent. - maxLength: 100 - example: example@gmail.com - end_user_organization_name: - type: string - minLength: 1 - description: Your end user's organization. - maxLength: 100 - example: Test Organization - end_user_origin_id: - type: string - minLength: 1 - description: 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. - maxLength: 100 - example: '12345' - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: The integration categories to show in Merge Link. - example: - - hris - - ats - integration: - type: string - nullable: true - minLength: 1 - description: 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/. - example: bamboohr - link_expiry_mins: - type: integer - maximum: 10080 - minimum: 30 - default: 30 - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: array - items: - $ref: '#/components/schemas/CommonModelScopesBodyRequest' - nullable: true - description: 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: object - additionalProperties: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - nullable: true - description: 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. - example: - hris: - - model_name: Employee - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - first_name - - last_name - - personal_email - disabled_fields: - - preferred_name - - model_name: Employment - model_permissions: - READ: - is_enabled: false - WRITE: - is_enabled: false - field_permissions: - enabled_fields: - - effective_date - ats: - - model_name: Job - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - name - disabled_fields: - - description - - model_name: Department - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - language: - oneOf: - - $ref: '#/components/schemas/LanguageEnum' - - type: string - nullable: true - description: |- - The following subset of IETF language tags can be used to configure localization. - - * `en` - en - * `de` - de - example: en - are_syncs_disabled: - type: boolean - nullable: true - default: false - description: The boolean that indicates whether initial, periodic, and force - syncs will be disabled. - integration_specific_config: - type: object - additionalProperties: {} - nullable: true - description: A JSON object containing integration-specific configuration - options. - example: - rippling: - oauth_code: 3h1jj8ssdf31dfji3o1jjdfjasd - required: - - categories - - end_user_email_address - - end_user_organization_name - - end_user_origin_id - x-merge-category: crm - Engagement: - type: object - description: |- - # The Engagement Object - ### Description - The `Engagement` object is used to represent an interaction noted in a CRM system. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The engagement's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - content: - type: string - nullable: true - description: The engagement's content. - example: Call for negotiation - subject: - type: string - nullable: true - description: The engagement's subject. - example: Call from customer - direction: - oneOf: - - $ref: '#/components/schemas/DirectionEnum' - - type: string - nullable: true - description: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - example: INBOUND - engagement_type: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/EngagementType' - nullable: true - description: The engagement type of the engagement. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: EngagementType - start_time: - type: string - format: date-time - nullable: true - description: The time at which the engagement started. - example: '2022-02-10T00:00:00Z' - end_time: - type: string - format: date-time - nullable: true - description: The time at which the engagement ended. - example: '2022-02-10T00:05:00Z' - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account of the engagement. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - x-merge-expands-to: Account - contacts: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - example: - - a7c55bc6-2940-c80a-848e-bbfacbfdf4fg - x-merge-expands-to: Contact - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /engagements - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account", "contacts": "Contact", "engagement_type": - "EngagementType", "owner": "User"}' - x-merge-category: crm - EngagementEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/EngagementRequest' - required: - - model - x-merge-category: crm - EngagementRequest: - type: object - description: |- - # The Engagement Object - ### Description - The `Engagement` object is used to represent an interaction noted in a CRM system. - ### Usage Example - TODO - properties: - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The engagement's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - content: - type: string - nullable: true - description: The engagement's content. - example: Call for negotiation - subject: - type: string - nullable: true - description: The engagement's subject. - example: Call from customer - direction: - oneOf: - - $ref: '#/components/schemas/DirectionEnum' - - type: string - nullable: true - description: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - example: INBOUND - engagement_type: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/EngagementType' - nullable: true - description: The engagement type of the engagement. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: EngagementType - start_time: - type: string - format: date-time - nullable: true - description: The time at which the engagement started. - example: '2022-02-10T00:00:00Z' - end_time: - type: string - format: date-time - nullable: true - description: The time at which the engagement ended. - example: '2022-02-10T00:05:00Z' - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account of the engagement. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - x-merge-expands-to: Account - contacts: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - example: - - a7c55bc6-2940-c80a-848e-bbfacbfdf4fg - x-merge-expands-to: Contact - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "contacts": "Contact", "engagement_type": - "EngagementType", "owner": "User"}' - x-merge-category: crm - EngagementResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Engagement' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - EngagementType: - type: object - description: |- - # The Engagement Type Object - ### Description - The `Engagement Type` object is used to represent an interaction activity. A given `Engagement` typically has an `Engagement Type` object represented in the engagement_type field. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - activity_type: - oneOf: - - $ref: '#/components/schemas/ActivityTypeEnum' - - type: string - nullable: true - description: |- - The engagement type's activity type. - - * `CALL` - CALL - * `MEETING` - MEETING - * `EMAIL` - EMAIL - example: CALL - name: - type: string - nullable: true - description: The engagement type's name. - example: First Call - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-category: crm - ErrorValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /model/custom_fields - title: - type: string - example: Missing Required Field - detail: - type: string - example: custom_fields is a required field on model. - problem_type: - type: string - example: MISSING_REQUIRED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: crm - 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 - type: string - description: |- - * `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 - x-merge-category: crm - ExternalTargetFieldAPI: - type: object - properties: - name: - type: string - nullable: true - readOnly: true - example: example_target_field_name - description: - type: string - nullable: true - readOnly: true - example: this is a example description of a target field - is_mapped: - type: string - nullable: true - readOnly: true - example: true - x-merge-category: crm - ExternalTargetFieldAPIResponse: - type: object - properties: - Account: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Contact: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Lead: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Note: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Opportunity: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Stage: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - User: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Task: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Engagement: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - x-merge-category: crm - FieldFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: crm - FieldMappingApiInstance: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - is_integration_wide: - type: boolean - readOnly: true - target_field: - type: object - properties: - name: - type: string - description: - type: string - is_organization_wide: - type: boolean - required: - - description - - is_organization_wide - - name - nullable: true - readOnly: true - example: - name: example_target_field_name - description: this is a example description of a target field - is_organization_wide: true - remote_field: - type: object - properties: - remote_key_name: - type: string - nullable: true - schema: - type: object - additionalProperties: {} - nullable: true - remote_endpoint_info: - type: object - properties: - method: - type: string - nullable: true - url_path: - type: string - nullable: true - field_traversal_path: - type: array - items: - type: string - nullable: true - required: - - field_traversal_path - - method - - url_path - required: - - remote_endpoint_info - - remote_key_name - - schema - nullable: true - readOnly: true - example: - 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 - x-merge-category: crm - FieldMappingApiInstanceResponse: - type: object - properties: - Account: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Contact: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Lead: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Note: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Opportunity: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Stage: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - User: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Task: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Engagement: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - x-merge-category: crm - FieldMappingInstanceResponse: - type: object - properties: - model: - $ref: '#/components/schemas/FieldMappingApiInstance' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - FieldPermissionDeserializer: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: crm - FieldPermissionDeserializerRequest: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: crm - FieldTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: crm - GenerateRemoteKeyRequest: - type: object - description: |- - # The GenerateRemoteKey Object - ### Description - The `GenerateRemoteKey` object is used to represent a request for a new remote key. - - ### Usage Example - Post a `GenerateRemoteKey` to create a new remote key. - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: crm - IgnoreCommonModelRequest: - type: object - properties: - reason: - oneOf: - - $ref: '#/components/schemas/ReasonEnum' - - type: string - example: GENERAL_CUSTOMER_REQUEST - message: - type: string - minLength: 1 - maxLength: 256 - example: deletion request by user id 51903790-7dfe-4053-8d63-5a10cc4ffd39 - required: - - reason - x-merge-category: crm - IndividualCommonModelScopeDeserializer: - type: object - properties: - model_name: - type: string - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializer' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializer' - required: - - model_name - x-merge-category: crm - IndividualCommonModelScopeDeserializerRequest: - type: object - properties: - model_name: - type: string - minLength: 1 - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializerRequest' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializerRequest' - required: - - model_name - x-merge-category: crm - Issue: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - status: - oneOf: - - $ref: '#/components/schemas/IssueStatusEnum' - - type: string - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - example: ONGOING - error_description: - type: string - example: Missing Permissions - end_user: - type: object - additionalProperties: {} - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - first_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - last_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - is_muted: - type: boolean - readOnly: true - example: true - error_details: - type: array - items: - type: string - readOnly: true - example: - - Missing employee permissions. - - Missing time off permissions. - required: - - error_description - x-merge-category: crm - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - type: string - description: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - x-merge-category: crm - ItemFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - uuid - * `number` - url - * `date` - email - * `datetime` - phone - * `bool` - currency - * `list` - decimal - x-merge-category: crm - ItemSchema: - type: object - properties: - item_type: - $ref: '#/components/schemas/ItemTypeEnum' - item_format: - $ref: '#/components/schemas/ItemFormatEnum' - item_choices: - type: array - items: - type: string - x-merge-category: crm - ItemTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: crm - LanguageEnum: - enum: - - en - - de - type: string - description: |- - * `en` - en - * `de` - de - x-merge-category: crm - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: crm - Lead: - type: object - description: |- - # The Lead Object - ### Description - The `Lead` object is used to represent an individual who is a potential customer. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The lead's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - lead_source: - type: string - nullable: true - description: The lead's source. - example: API Blogger - title: - type: string - nullable: true - description: The lead's title. - example: Co-Founder - company: - type: string - nullable: true - description: The lead's company. - example: Merge API - first_name: - type: string - nullable: true - description: The lead's first name. - example: Gil - last_name: - type: string - nullable: true - description: The lead's last name. - example: Feig - addresses: - type: array - items: - $ref: '#/components/schemas/Address' - readOnly: true - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddress' - readOnly: true - example: - - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumber' - readOnly: true - example: - - phone_number: '+16789932455' - phone_number_type: Mobile - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's lead was updated. - example: '2022-02-10T00:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's lead was created. - example: '2021-11-10T00:00:00Z' - converted_date: - type: string - format: date-time - nullable: true - description: When the lead was converted. - example: '2022-03-10T00:00:00Z' - converted_contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The contact of the converted lead. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - x-merge-expands-to: Contact - converted_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account of the converted lead. - example: 9c9de072-29cf-48e3-9578-1ca5b145b40e - x-merge-expands-to: Account - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /leads - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"converted_account": "Account", "converted_contact": "Contact", - "owner": "User"}' - x-merge-category: crm - LeadEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/LeadRequest' - required: - - model - x-merge-category: crm - LeadRequest: - type: object - description: |- - # The Lead Object - ### Description - The `Lead` object is used to represent an individual who is a potential customer. - ### Usage Example - TODO - properties: - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The lead's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - lead_source: - type: string - nullable: true - description: The lead's source. - example: API Blogger - title: - type: string - nullable: true - description: The lead's title. - example: Co-Founder - company: - type: string - nullable: true - description: The lead's company. - example: Merge API - first_name: - type: string - nullable: true - description: The lead's first name. - example: Gil - last_name: - type: string - nullable: true - description: The lead's last name. - example: Feig - addresses: - type: array - items: - $ref: '#/components/schemas/AddressRequest' - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddressRequest' - example: - - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumberRequest' - example: - - phone_number: '+16789932455' - phone_number_type: Mobile - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - converted_date: - type: string - format: date-time - nullable: true - description: When the lead was converted. - example: '2022-03-10T00:00:00Z' - converted_contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The contact of the converted lead. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - x-merge-expands-to: Contact - converted_account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account of the converted lead. - example: 9c9de072-29cf-48e3-9578-1ca5b145b40e - x-merge-expands-to: Account - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"converted_account": "Account", "converted_contact": "Contact", - "owner": "User"}' - x-merge-category: crm - LeadResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Lead' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - LinkToken: - type: object - properties: - link_token: - type: string - example: necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0 - integration_name: - type: string - example: Lever - magic_link_url: - type: string - example: https://link.merge.dev/asdfjkl12345jsndfgi2i83n - required: - - link_token - x-merge-category: crm - LinkedAccountCommonModelScopeDeserializerRequest: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: crm - LinkedAccountStatus: - type: object - properties: - linked_account_status: - type: string - can_make_request: - type: boolean - required: - - can_make_request - - linked_account_status - x-merge-category: crm - MetaResponse: - type: object - properties: - request_schema: - type: object - additionalProperties: {} - example: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - type: object - additionalProperties: {} - status: - $ref: '#/components/schemas/LinkedAccountStatus' - example: - linked_account_status: COMPLETE - can_make_request: true - has_conditional_params: - type: boolean - has_required_linked_account_params: - type: boolean - required: - - has_conditional_params - - has_required_linked_account_params - - request_schema - x-merge-category: crm - MethodEnum: - enum: - - GET - - OPTIONS - - HEAD - - POST - - PUT - - PATCH - - DELETE - type: string - description: |- - * `GET` - GET - * `OPTIONS` - OPTIONS - * `HEAD` - HEAD - * `POST` - POST - * `PUT` - PUT - * `PATCH` - PATCH - * `DELETE` - DELETE - x-merge-category: crm - ModelOperation: - type: object - description: |- - # 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: - type: string - example: Candidate - available_operations: - type: array - items: - type: string - example: - - FETCH - - CREATE - required_post_parameters: - type: array - items: - type: string - example: - - remote_user_id - supported_fields: - type: array - items: - type: string - example: - - first_name - - last_name - - company - - title - required: - - available_operations - - model_name - - required_post_parameters - - supported_fields - x-merge-category: crm - ModelPermissionDeserializer: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: crm - ModelPermissionDeserializerRequest: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: crm - MultipartFormFieldRequest: - type: object - description: |- - # 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 - minLength: 1 - description: The name of the form field - example: resume - data: - type: string - minLength: 1 - description: The data for the form field. - example: SW50ZWdyYXRlIGZhc3QKSW50ZWdyYXRlIG9uY2U= - encoding: - oneOf: - - $ref: '#/components/schemas/EncodingEnum' - - type: string - nullable: true - default: RAW - description: |- - The encoding of the value of `data`. Defaults to `RAW` if not defined. - - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - example: BASE64 - file_name: - type: string - nullable: true - minLength: 1 - description: The file name of the form field, if the field is for a file. - example: resume.pdf - content_type: - type: string - nullable: true - minLength: 1 - description: The MIME type of the file, if the field is for a file. - example: application/pdf - required: - - data - - name - x-merge-category: crm - Note: - type: object - description: |- - # The Note Object - ### Description - The `Note` object is used to represent a note on another object. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The note's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - content: - type: string - nullable: true - description: The note's content. - example: Merge is hiring! - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The note's contact. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - x-merge-expands-to: Contact - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The note's account. - example: fba1fbc6-67c0-4cb2-a176-7896acd2ffd5 - x-merge-expands-to: Account - opportunity: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Opportunity' - nullable: true - description: The note's opportunity. - example: 754a244e-dd67-4731-a8d3-9bff9dc10465 - x-merge-expands-to: Opportunity - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's lead was updated. - example: '2022-02-10T00:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's lead was created. - example: '2021-11-10T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /notes - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account", "contact": "Contact", "opportunity": - "Opportunity", "owner": "User"}' - x-merge-category: crm - NoteEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/NoteRequest' - required: - - model - x-merge-category: crm - NoteRequest: - type: object - description: |- - # The Note Object - ### Description - The `Note` object is used to represent a note on another object. - ### Usage Example - TODO - properties: - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The note's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - content: - type: string - nullable: true - description: The note's content. - example: Merge is hiring! - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The note's contact. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - x-merge-expands-to: Contact - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The note's account. - example: fba1fbc6-67c0-4cb2-a176-7896acd2ffd5 - x-merge-expands-to: Account - opportunity: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Opportunity' - nullable: true - description: The note's opportunity. - example: 754a244e-dd67-4731-a8d3-9bff9dc10465 - x-merge-expands-to: Opportunity - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "contact": "Contact", "opportunity": - "Opportunity", "owner": "User"}' - x-merge-category: crm - NoteResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Note' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - ObjectClassDescriptionRequest: - type: object - properties: - id: - type: string - minLength: 1 - origin_type: - $ref: '#/components/schemas/OriginTypeEnum' - required: - - id - - origin_type - x-merge-category: crm - Opportunity: - type: object - description: |- - # The Opportunity Object - ### Description - The `Opportunity` object is used to represent a deal opportunity in a CRM system. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The opportunity's name. - example: Needs Integrations - description: - type: string - nullable: true - description: The opportunity's description. - example: Needs a Unified API for Integrations! - amount: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The opportunity's amount. - example: 100000 - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The opportunity's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account of the opportunity. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Account - stage: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Stage' - nullable: true - description: The stage of the opportunity. - example: 1968cbc6-6040-430a-848e-aafacbadf4ad - x-merge-expands-to: Stage - status: - oneOf: - - $ref: '#/components/schemas/OpportunityStatusEnum' - - type: string - nullable: true - description: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - example: WON - last_activity_at: - type: string - format: date-time - nullable: true - description: When the opportunity's last activity occurred. - example: '2022-02-10T00:00:00Z' - close_date: - type: string - format: date-time - nullable: true - description: When the opportunity was closed. - example: '2022-02-10T00:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's opportunity was created. - example: '2021-11-10T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /opportunities - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account", "owner": "User", "stage": "Stage"}' - x-merge-category: crm - OpportunityEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/OpportunityRequest' - required: - - model - x-merge-category: crm - OpportunityRequest: - type: object - description: |- - # The Opportunity Object - ### Description - The `Opportunity` object is used to represent a deal opportunity in a CRM system. - ### Usage Example - TODO - properties: - name: - type: string - nullable: true - description: The opportunity's name. - example: Needs Integrations - description: - type: string - nullable: true - description: The opportunity's description. - example: Needs a Unified API for Integrations! - amount: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The opportunity's amount. - example: 100000 - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The opportunity's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account of the opportunity. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Account - stage: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Stage' - nullable: true - description: The stage of the opportunity. - example: 1968cbc6-6040-430a-848e-aafacbadf4ad - x-merge-expands-to: Stage - status: - oneOf: - - $ref: '#/components/schemas/OpportunityStatusEnum' - - type: string - nullable: true - description: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - example: WON - last_activity_at: - type: string - format: date-time - nullable: true - description: When the opportunity's last activity occurred. - example: '2022-02-10T00:00:00Z' - close_date: - type: string - format: date-time - nullable: true - description: When the opportunity was closed. - example: '2022-02-10T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "owner": "User", "stage": "Stage"}' - x-merge-category: crm - OpportunityResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Opportunity' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - OpportunityStatusEnum: - enum: - - OPEN - - WON - - LOST - type: string - description: |- - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - x-merge-category: crm - OriginTypeEnum: - enum: - - CUSTOM_OBJECT - - COMMON_MODEL - - REMOTE_ONLY_MODEL - type: string - description: |- - * `CUSTOM_OBJECT` - CUSTOM_OBJECT - * `COMMON_MODEL` - COMMON_MODEL - * `REMOTE_ONLY_MODEL` - REMOTE_ONLY_MODEL - x-merge-category: crm - PaginatedAccountDetailsAndActionsList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountDetailsAndActions' - x-merge-category: crm - PaginatedAccountList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Account' - x-merge-category: crm - PaginatedAssociationList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Association' - x-merge-category: crm - PaginatedAssociationTypeList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AssociationType' - x-merge-category: crm - PaginatedAuditLogEventList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AuditLogEvent' - x-merge-category: crm - PaginatedContactList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Contact' - x-merge-category: crm - PaginatedCustomObjectClassList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/CustomObjectClass' - x-merge-category: crm - PaginatedCustomObjectList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/CustomObject' - x-merge-category: crm - PaginatedEngagementList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Engagement' - x-merge-category: crm - PaginatedEngagementTypeList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/EngagementType' - x-merge-category: crm - PaginatedIssueList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Issue' - x-merge-category: crm - PaginatedLeadList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Lead' - x-merge-category: crm - PaginatedNoteList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Note' - x-merge-category: crm - PaginatedOpportunityList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Opportunity' - x-merge-category: crm - PaginatedRemoteFieldClassList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/RemoteFieldClass' - x-merge-category: crm - PaginatedStageList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Stage' - x-merge-category: crm - PaginatedSyncStatusList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - x-merge-category: crm - PaginatedTaskList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Task' - x-merge-category: crm - PaginatedUserList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/User' - x-merge-category: crm - PatchedAccountRequest: - type: object - description: |- - # The Account Object - ### Description - The `Account` object is used to represent a company in a CRM system. - ### Usage Example - TODO - properties: - owner: - type: string - format: uuid - nullable: true - description: The account's owner. - example: 0258cbc6-6020-430a-848e-aafacbadf4ae - name: - type: string - nullable: true - description: The account's name. - example: Merge API - description: - type: string - nullable: true - description: The account's description. - example: One API for all integrations - industry: - type: string - nullable: true - description: The account's industry. - example: API's - website: - type: string - format: uri - nullable: true - description: The account's website. - maxLength: 2000 - example: https://merge.dev/ - number_of_employees: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The account's number of employees. - example: 276000 - addresses: - type: array - items: - $ref: '#/components/schemas/AddressRequest' - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - last_activity_at: - type: string - format: date-time - nullable: true - description: The last date (either most recent or furthest in the future) - of when an activity occurs in an account. - example: '2022-02-10T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: crm - PatchedCRMAccountEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedAccountRequest' - required: - - model - x-merge-category: crm - PatchedCRMContactEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedContactRequest' - required: - - model - x-merge-category: crm - PatchedContactRequest: - type: object - description: |- - # The Contact Object - ### Description - The `Contact` object is used to represent an existing point of contact at a company in a CRM system. - ### Usage Example - TODO - properties: - first_name: - type: string - nullable: true - description: The contact's first name. - example: Gil - last_name: - type: string - nullable: true - description: The contact's last name. - example: Feig - account: - type: string - format: uuid - nullable: true - description: The contact's account. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The contact's owner. - example: b8fbfc30-0982-420e-8c20-dab07b70b9d6 - addresses: - type: array - items: - $ref: '#/components/schemas/AddressRequest' - example: - - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_addresses: - type: array - items: - $ref: '#/components/schemas/EmailAddressRequest' - example: - - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - type: array - items: - $ref: '#/components/schemas/PhoneNumberRequest' - example: - - phone_number: '+13785579223' - phone_number_type: Mobile - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - last_activity_at: - type: string - format: date-time - nullable: true - description: When the contact's last activity occurred. - example: '2022-02-10T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: crm - PatchedEditFieldMappingRequest: - type: object - properties: - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field_name - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - x-merge-category: crm - PatchedEngagementEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedEngagementRequest' - required: - - model - x-merge-category: crm - PatchedEngagementRequest: - type: object - description: |- - # The Engagement Object - ### Description - The `Engagement` object is used to represent an interaction noted in a CRM system. - ### Usage Example - TODO - properties: - owner: - type: string - format: uuid - nullable: true - description: The engagement's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - content: - type: string - nullable: true - description: The engagement's content. - example: Call for negotiation - subject: - type: string - nullable: true - description: The engagement's subject. - example: Call from customer - direction: - oneOf: - - $ref: '#/components/schemas/DirectionEnum' - - type: string - nullable: true - description: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - example: INBOUND - engagement_type: - type: string - format: uuid - nullable: true - description: The engagement type of the engagement. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - start_time: - type: string - format: date-time - nullable: true - description: The time at which the engagement started. - example: '2022-02-10T00:00:00Z' - end_time: - type: string - format: date-time - nullable: true - description: The time at which the engagement ended. - example: '2022-02-10T00:05:00Z' - account: - type: string - format: uuid - nullable: true - description: The account of the engagement. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - contacts: - type: array - items: - type: string - format: uuid - nullable: true - example: - - a7c55bc6-2940-c80a-848e-bbfacbfdf4fg - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: crm - PatchedOpportunityEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedOpportunityRequest' - required: - - model - x-merge-category: crm - PatchedOpportunityRequest: - type: object - description: |- - # The Opportunity Object - ### Description - The `Opportunity` object is used to represent a deal opportunity in a CRM system. - ### Usage Example - TODO - properties: - name: - type: string - nullable: true - description: The opportunity's name. - example: Needs Integrations - description: - type: string - nullable: true - description: The opportunity's description. - example: Needs a Unified API for Integrations! - amount: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - description: The opportunity's amount. - example: 100000 - owner: - type: string - format: uuid - nullable: true - description: The opportunity's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - account: - type: string - format: uuid - nullable: true - description: The account of the opportunity. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - stage: - type: string - format: uuid - nullable: true - description: The stage of the opportunity. - example: 1968cbc6-6040-430a-848e-aafacbadf4ad - status: - oneOf: - - $ref: '#/components/schemas/OpportunityStatusEnum' - - type: string - nullable: true - description: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - example: WON - last_activity_at: - type: string - format: date-time - nullable: true - description: When the opportunity's last activity occurred. - example: '2022-02-10T00:00:00Z' - close_date: - type: string - format: date-time - nullable: true - description: When the opportunity was closed. - example: '2022-02-10T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: crm - PatchedTaskEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedTaskRequest' - required: - - model - x-merge-category: crm - PatchedTaskRequest: - type: object - description: |- - # The Task Object - ### Description - The `Task` object is used to represent a task, such as a to-do item. - ### Usage Example - TODO - properties: - subject: - type: string - nullable: true - description: The task's subject. - example: Contact about Integration Strategy - content: - type: string - nullable: true - description: The task's content. - example: Follow up to see whether they need integrations - owner: - type: string - format: uuid - nullable: true - description: The task's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - account: - type: string - format: uuid - nullable: true - description: The task's account. - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - opportunity: - type: string - format: uuid - nullable: true - description: The task's opportunity. - example: 550e8400-e29b-41d4-a716-446655440000 - completed_date: - type: string - format: date-time - nullable: true - description: When the task is completed. - example: '2022-02-11T00:00:00Z' - due_date: - type: string - format: date-time - nullable: true - description: When the task is due. - example: '2022-02-10T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/TaskStatusEnum' - - type: string - nullable: true - description: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - example: OPEN - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: crm - PhoneNumber: - type: object - description: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent an entity's phone number. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their phone numbers. - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - phone_number: - type: string - nullable: true - description: The phone number. - example: '+3198675309' - phone_number_type: - type: string - nullable: true - description: The phone number's type. - example: Mobile - x-merge-nested-write-allowed: true - x-merge-category: crm - PhoneNumberRequest: - type: object - description: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent an entity's phone number. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their phone numbers. - properties: - phone_number: - type: string - nullable: true - description: The phone number. - example: '+3198675309' - phone_number_type: - type: string - nullable: true - description: The phone number's type. - example: Mobile - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-category: crm - ReasonEnum: - enum: - - GENERAL_CUSTOMER_REQUEST - - GDPR - - OTHER - type: string - description: |- - * `GENERAL_CUSTOMER_REQUEST` - GENERAL_CUSTOMER_REQUEST - * `GDPR` - GDPR - * `OTHER` - OTHER - x-merge-category: crm - RemoteData: - type: object - description: |- - # 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 - description: The third-party API path that is being called. - example: /platform-endpoint - data: - readOnly: true - description: The data returned from the third-party for this object in its - original, unnormalized format. - example: - - Varies by platform - required: - - path - x-merge-category: crm - RemoteEndpointInfo: - type: object - properties: - method: - type: string - example: GET - url_path: - type: string - example: /example-url-path - field_traversal_path: - type: array - items: {} - example: - - example_key_name - required: - - field_traversal_path - - method - - url_path - x-merge-category: crm - RemoteField: - type: object - properties: - remote_field_class: - oneOf: - - type: string - - $ref: '#/components/schemas/RemoteFieldClass' - x-merge-expands-to: RemoteFieldClass - value: - nullable: true - example: string - required: - - remote_field_class - x-merge-expands: '{"remote_field_class": "RemoteFieldClass"}' - x-merge-category: crm - RemoteFieldAPI: - type: object - properties: - schema: - type: object - additionalProperties: {} - example: - type: string - remote_key_name: - type: string - example: example_remote_key_name - remote_endpoint_info: - $ref: '#/components/schemas/RemoteEndpointInfo' - example: - method: GET - url_path: /example-url-path - field_traversal_path: - - example_key_name - example_values: - type: array - items: {} - nullable: true - example: - - example - advanced_metadata: - allOf: - - $ref: '#/components/schemas/AdvancedMetadata' - nullable: true - coverage: - oneOf: - - type: integer - - type: number - format: double - nullable: true - readOnly: true - example: 0.33 - required: - - advanced_metadata - - remote_endpoint_info - - remote_key_name - - schema - x-merge-category: crm - RemoteFieldAPIResponse: - type: object - properties: - Account: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Contact: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Lead: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Note: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Opportunity: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Stage: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - User: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Task: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Engagement: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - x-merge-category: crm - RemoteFieldClass: - type: object - properties: - id: - type: string - display_name: - type: string - remote_key_name: - type: string - description: - type: string - is_custom: - type: boolean - is_required: - type: boolean - field_type: - $ref: '#/components/schemas/FieldTypeEnum' - field_format: - $ref: '#/components/schemas/FieldFormatEnum' - field_choices: - type: array - items: - type: object - properties: - value: - nullable: true - display_name: - type: string - nullable: true - nullable: true - item_schema: - $ref: '#/components/schemas/ItemSchema' - x-merge-category: crm - RemoteFieldClassForCustomObjectClass: - type: object - properties: - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - display_name: - type: string - nullable: true - remote_key_name: - type: string - nullable: true - description: - type: string - nullable: true - is_required: - type: boolean - field_type: - oneOf: - - $ref: '#/components/schemas/FieldTypeEnum' - - type: string - readOnly: true - field_format: - oneOf: - - $ref: '#/components/schemas/FieldFormatEnum' - - type: string - readOnly: true - field_choices: - type: array - items: - type: object - properties: - value: - nullable: true - display_name: - type: string - nullable: true - nullable: true - readOnly: true - item_schema: - type: object - properties: - item_type: - type: string - nullable: true - item_format: - type: string - nullable: true - item_choices: - type: array - items: - type: string - nullable: true - nullable: true - required: - - item_choices - - item_format - - item_type - nullable: true - readOnly: true - x-merge-category: crm - RemoteFieldRequest: - type: object - properties: - remote_field_class: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteFieldClass' - example: b057d1d2-c204-4da8-a74c-c91d1a260614 - x-merge-expands-to: RemoteFieldClass - value: - nullable: true - example: string - required: - - remote_field_class - x-merge-expands: '{"remote_field_class": "RemoteFieldClass"}' - x-merge-category: crm - RemoteKey: - type: object - description: |- - # 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: - type: string - example: Remote Deployment Key 1 - key: - type: string - example: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA - required: - - key - - name - x-merge-category: crm - RemoteKeyForRegenerationRequest: - type: object - description: |- - # The RemoteKeyForRegeneration Object - ### Description - The `RemoteKeyForRegeneration` object is used to exchange an old remote key for a new one - - ### Usage Example - Post a `RemoteKeyForRegeneration` to swap out an old remote key for a new one - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: crm - RemoteResponse: - type: object - description: |- - # 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: - type: string - example: GET - path: - type: string - example: /scooters - status: - type: integer - example: 200 - response: - example: - scooters: - - company: Lime - model: Gen 2.5 - - company: Bird - model: Bird Zero - response_headers: - type: object - additionalProperties: {} - example: - X-Page-Token: value - response_type: - oneOf: - - $ref: '#/components/schemas/ResponseTypeEnum' - - type: string - example: JSON - headers: - type: object - additionalProperties: {} - example: - EXTRA-HEADER: value - Authorization: - required: - - method - - path - - response - - status - x-merge-category: crm - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - type: string - description: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - x-merge-category: crm - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - type: string - description: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - x-merge-category: crm - RoleEnum: - enum: - - ADMIN - - DEVELOPER - - MEMBER - - API - - SYSTEM - - MERGE_TEAM - type: string - description: |- - * `ADMIN` - ADMIN - * `DEVELOPER` - DEVELOPER - * `MEMBER` - MEMBER - * `API` - API - * `SYSTEM` - SYSTEM - * `MERGE_TEAM` - MERGE_TEAM - x-merge-category: crm - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - type: string - description: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - x-merge-category: crm - Stage: - type: object - description: |- - # The Stage Object - ### Description - The `Stage` object is used to represent the stage of an opportunity. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The stage's name. - example: Closed Won - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /stages - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-category: crm - StatusFd5Enum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: crm - SyncStatus: - type: object - description: |- - # 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: - type: string - example: Account - model_id: - type: string - example: crm.Account - last_sync_start: - type: string - format: date-time - example: '2021-03-30T19:44:18.695973Z' - next_sync_start: - type: string - format: date-time - example: '2021-03-30T20:44:18.662942Z' - last_sync_result: - oneOf: - - $ref: '#/components/schemas/LastSyncResultEnum' - - type: string - example: DONE - last_sync_finished: - type: string - format: date-time - example: '2021-03-30T19:55:18.695973Z' - status: - oneOf: - - $ref: '#/components/schemas/StatusFd5Enum' - - type: string - example: SYNCING - is_initial_sync: - type: boolean - example: true - selective_sync_configurations_usage: - $ref: '#/components/schemas/SelectiveSyncConfigurationsUsageEnum' - required: - - is_initial_sync - - model_id - - model_name - - status - x-merge-sample-json: '{"model_name": "Candidate", "model_id": "ats.Candidate", - "last_sync_start": "2021-03-30T19:44:18.695973Z", "next_sync_start": "2021-03-30T20:44:18.662942Z", - "status": "SYNCING", "is_initial_sync": true}' - x-merge-category: crm - Task: - type: object - description: |- - # The Task Object - ### Description - The `Task` object is used to represent a task, such as a to-do item. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 550e8400-e29b-41d4-a716-446655440000 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - subject: - type: string - nullable: true - description: The task's subject. - example: Contact about Integration Strategy - content: - type: string - nullable: true - description: The task's content. - example: Follow up to see whether they need integrations - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The task's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The task's account. - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - x-merge-expands-to: Account - opportunity: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Opportunity' - nullable: true - description: The task's opportunity. - example: 550e8400-e29b-41d4-a716-446655440000 - x-merge-expands-to: Opportunity - completed_date: - type: string - format: date-time - nullable: true - description: When the task is completed. - example: '2022-02-11T00:00:00Z' - due_date: - type: string - format: date-time - nullable: true - description: When the task is due. - example: '2022-02-10T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/TaskStatusEnum' - - type: string - nullable: true - description: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - example: OPEN - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /tasks - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account", "opportunity": "Opportunity", "owner": - "User"}' - x-merge-category: crm - TaskEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/TaskRequest' - required: - - model - x-merge-category: crm - TaskRequest: - type: object - description: |- - # The Task Object - ### Description - The `Task` object is used to represent a task, such as a to-do item. - ### Usage Example - TODO - properties: - subject: - type: string - nullable: true - description: The task's subject. - example: Contact about Integration Strategy - content: - type: string - nullable: true - description: The task's content. - example: Follow up to see whether they need integrations - owner: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The task's owner. - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - x-merge-expands-to: User - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The task's account. - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - x-merge-expands-to: Account - opportunity: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Opportunity' - nullable: true - description: The task's opportunity. - example: 550e8400-e29b-41d4-a716-446655440000 - x-merge-expands-to: Opportunity - completed_date: - type: string - format: date-time - nullable: true - description: When the task is completed. - example: '2022-02-11T00:00:00Z' - due_date: - type: string - format: date-time - nullable: true - description: When the task is due. - example: '2022-02-10T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/TaskStatusEnum' - - type: string - nullable: true - description: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - example: OPEN - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "opportunity": "Opportunity", "owner": - "User"}' - x-merge-category: crm - TaskResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Task' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: crm - TaskStatusEnum: - enum: - - OPEN - - CLOSED - type: string - description: |- - * `OPEN` - OPEN - * `CLOSED` - CLOSED - x-merge-category: crm - User: - type: object - description: |- - # The User Object - ### Description - The `User` object is used to represent a user with a login to the CRM system. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 0358cbc6-2040-430a-848e-aafacbadf3aa - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The user's name. - example: Gil Feig - email: - type: string - nullable: true - description: The user's email address. - example: merge_is_hiring@merge.dev - is_active: - type: boolean - nullable: true - description: Whether or not the user is active. - example: true - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /users - data: - - Varies by platform - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"roles": "Role", "teams": "Team"}' - x-merge-category: crm - ValidationProblemSource: - type: object - properties: - pointer: - type: string - required: - - pointer - x-merge-category: crm - WarningValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /age - title: - type: string - example: Unrecognized Field - detail: - type: string - example: An unrecognized field, age, was passed in with request data. - problem_type: - type: string - example: UNRECOGNIZED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: crm - WebhookReceiver: - type: object - properties: - event: - type: string - is_active: - type: boolean - key: - type: string - required: - - event - - is_active - x-merge-category: crm - WebhookReceiverRequest: - type: object - properties: - event: - type: string - minLength: 1 - is_active: - type: boolean - key: - type: string - minLength: 1 - required: - - event - - is_active - x-merge-category: crm - securitySchemes: - tokenAuth: - type: http - scheme: bearer - description: Token-based authentication with required prefix "Bearer" - x-fern-token-variable-name: api_key -servers: -- url: https://api.merge.dev/api/crm/v1 - description: Production - x-fern-server-name: Production -- url: https://api-sandbox.merge.dev/api/crm/v1 - description: Sandbox - x-fern-server-name: Sandbox -- url: https://api-eu.merge.dev/api/crm/v1 - description: Production EU - x-fern-server-name: ProductionEU -- url: https://api-ap.merge.dev/api/crm/v1 - description: Production APSE1 - x-fern-server-name: ProductionAPSE1 diff --git a/.mock/definition/ATS/__package__.yml b/.mock/definition/ATS/__package__.yml deleted file mode 100644 index 791d099f4..000000000 --- a/.mock/definition/ATS/__package__.yml +++ /dev/null @@ -1,4734 +0,0 @@ -types: - AccessRoleEnum: - enum: - - SUPER_ADMIN - - ADMIN - - TEAM_MEMBER - - LIMITED_TEAM_MEMBER - - INTERVIEWER - docs: |- - * `SUPER_ADMIN` - SUPER_ADMIN - * `ADMIN` - ADMIN - * `TEAM_MEMBER` - TEAM_MEMBER - * `LIMITED_TEAM_MEMBER` - LIMITED_TEAM_MEMBER - * `INTERVIEWER` - INTERVIEWER - source: - openapi: ats_v3.yml - AccountDetailsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: ats_v3.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: ats_v3.yml - AccountDetailsAndActionsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: ats_v3.yml - inline: true - AccountDetailsAndActionsStatus: - discriminated: false - union: - - AccountDetailsAndActionsStatusEnum - - string - source: - openapi: ats_v3.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 - source: - openapi: ats_v3.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: ats_v3.yml - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - docs: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - source: - openapi: ats_v3.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: ats_v3.yml - AccountToken: - properties: - account_token: string - integration: AccountIntegration - id: string - source: - openapi: ats_v3.yml - ActivityUser: - discriminated: false - docs: The user that performed the action. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ActivityActivityType: - discriminated: false - docs: |- - The activity's type. - - * `NOTE` - NOTE - * `EMAIL` - EMAIL - * `OTHER` - OTHER - union: - - ActivityTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - ActivityVisibility: - discriminated: false - docs: |- - The activity's visibility. - - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - union: - - VisibilityEnum - - string - source: - openapi: ats_v3.yml - inline: true - Activity: - docs: >- - # The Activity Object - - ### Description - - The `Activity` object is used to represent an activity for a candidate - performed by a user. - - ### Usage Example - - Fetch from the `LIST Activities` endpoint and filter by `ID` to show all - activities. - 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: - type: optional - docs: The user that performed the action. - remote_created_at: - type: optional - docs: When the third party's activity was created. - activity_type: - type: optional - docs: |- - The activity's type. - - * `NOTE` - NOTE - * `EMAIL` - EMAIL - * `OTHER` - OTHER - subject: - type: optional - docs: The activity's subject. - body: - type: optional - docs: The activity's body. - visibility: - type: optional - docs: |- - The activity's visibility. - - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - candidate: - type: optional - validation: - format: uuid - 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: ats_v3.yml - ActivityRequestUser: - discriminated: false - docs: The user that performed the action. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ActivityRequestVisibility: - discriminated: false - docs: |- - The activity's visibility. - - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - union: - - VisibilityEnum - - string - source: - openapi: ats_v3.yml - inline: true - ActivityRequest: - docs: >- - # The Activity Object - - ### Description - - The `Activity` object is used to represent an activity for a candidate - performed by a user. - - ### Usage Example - - Fetch from the `LIST Activities` endpoint and filter by `ID` to show all - activities. - properties: - user: - type: optional - docs: The user that performed the action. - activity_type: - type: optional - docs: |- - The activity's type. - - * `NOTE` - NOTE - * `EMAIL` - EMAIL - * `OTHER` - OTHER - subject: - type: optional - docs: The activity's subject. - body: - type: optional - docs: The activity's body. - visibility: - type: optional - docs: |- - The activity's visibility. - - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - candidate: - type: optional - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - ActivityResponse: - properties: - model: Activity - warnings: list - errors: list - logs: optional> - source: - openapi: ats_v3.yml - ActivityTypeEnum: - enum: - - NOTE - - EMAIL - - OTHER - docs: |- - * `NOTE` - NOTE - * `EMAIL` - EMAIL - * `OTHER` - OTHER - source: - openapi: ats_v3.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: ats_v3.yml - ApplicationCandidate: - discriminated: false - docs: The candidate applying. - union: - - type: string - validation: - format: uuid - - Candidate - source: - openapi: ats_v3.yml - inline: true - ApplicationJob: - discriminated: false - docs: The job being applied for. - union: - - type: string - validation: - format: uuid - - Job - source: - openapi: ats_v3.yml - inline: true - ApplicationOffersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Offer - source: - openapi: ats_v3.yml - inline: true - ApplicationCreditedTo: - discriminated: false - docs: The user credited for this application. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ApplicationScreeningQuestionAnswersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - ScreeningQuestionAnswer - source: - openapi: ats_v3.yml - inline: true - ApplicationCurrentStage: - discriminated: false - docs: The application's current stage. - union: - - type: string - validation: - format: uuid - - JobInterviewStage - source: - openapi: ats_v3.yml - inline: true - ApplicationRejectReason: - discriminated: false - docs: The application's reason for rejection. - union: - - type: string - validation: - format: uuid - - RejectReason - source: - openapi: ats_v3.yml - inline: true - Application: - docs: >- - # The Application Object - - ### Description - - The Application Object is used to represent a candidate's journey through - a particular Job's recruiting process. If a Candidate applies for multiple - Jobs, there will be a separate Application for each Job if the third-party - integration allows it. - - - ### Usage Example - - Fetch from the `LIST Applications` endpoint and filter by `ID` to show all - applications. - 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 - candidate: - type: optional - docs: The candidate applying. - job: - type: optional - docs: The job being applied for. - applied_at: - type: optional - docs: When the application was submitted. - rejected_at: - type: optional - docs: When the application was rejected. - offers: optional>> - source: - type: optional - docs: The application's source. - credited_to: - type: optional - docs: The user credited for this application. - screening_question_answers: optional> - current_stage: - type: optional - docs: The application's current stage. - reject_reason: - type: optional - docs: The application's reason for rejection. - 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: ats_v3.yml - ApplicationRequestCandidate: - discriminated: false - docs: The candidate applying. - union: - - type: string - validation: - format: uuid - - Candidate - source: - openapi: ats_v3.yml - inline: true - ApplicationRequestJob: - discriminated: false - docs: The job being applied for. - union: - - type: string - validation: - format: uuid - - Job - source: - openapi: ats_v3.yml - inline: true - ApplicationRequestOffersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Offer - source: - openapi: ats_v3.yml - inline: true - ApplicationRequestCreditedTo: - discriminated: false - docs: The user credited for this application. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ApplicationRequestScreeningQuestionAnswersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - ScreeningQuestionAnswerRequest - source: - openapi: ats_v3.yml - inline: true - ApplicationRequestCurrentStage: - discriminated: false - docs: The application's current stage. - union: - - type: string - validation: - format: uuid - - JobInterviewStage - source: - openapi: ats_v3.yml - inline: true - ApplicationRequestRejectReason: - discriminated: false - docs: The application's reason for rejection. - union: - - type: string - validation: - format: uuid - - RejectReason - source: - openapi: ats_v3.yml - inline: true - ApplicationRequest: - docs: >- - # The Application Object - - ### Description - - The Application Object is used to represent a candidate's journey through - a particular Job's recruiting process. If a Candidate applies for multiple - Jobs, there will be a separate Application for each Job if the third-party - integration allows it. - - - ### Usage Example - - Fetch from the `LIST Applications` endpoint and filter by `ID` to show all - applications. - properties: - candidate: - type: optional - docs: The candidate applying. - job: - type: optional - docs: The job being applied for. - applied_at: - type: optional - docs: When the application was submitted. - rejected_at: - type: optional - docs: When the application was rejected. - offers: optional>> - source: - type: optional - docs: The application's source. - credited_to: - type: optional - docs: The user credited for this application. - screening_question_answers: optional> - current_stage: - type: optional - docs: The application's current stage. - reject_reason: - type: optional - docs: The application's reason for rejection. - remote_template_id: - type: optional - validation: - minLength: 1 - access: write-only - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - ApplicationResponse: - properties: - model: Application - warnings: list - errors: list - logs: optional> - source: - openapi: ats_v3.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid - source: - openapi: ats_v3.yml - AttachmentAttachmentType: - discriminated: false - docs: |- - The attachment's type. - - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - union: - - AttachmentTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - Attachment: - docs: >- - # The Attachment Object - - ### Description - - The `Attachment` object is used to represent a file attached to a - candidate. - - ### Usage Example - - Fetch from the `LIST Attachments` endpoint and view attachments accessible - by a company. - 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 - file_name: - type: optional - docs: The attachment's name. - file_url: - type: optional - docs: The attachment's url. - validation: - format: uri - maxLength: 2000 - candidate: - type: optional - docs: '' - validation: - format: uuid - attachment_type: - type: optional - docs: |- - The attachment's type. - - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - 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: ats_v3.yml - AttachmentRequestAttachmentType: - discriminated: false - docs: |- - The attachment's type. - - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - union: - - AttachmentTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - AttachmentRequest: - docs: >- - # The Attachment Object - - ### Description - - The `Attachment` object is used to represent a file attached to a - candidate. - - ### Usage Example - - Fetch from the `LIST Attachments` endpoint and view attachments accessible - by a company. - properties: - file_name: - type: optional - docs: The attachment's name. - file_url: - type: optional - docs: The attachment's url. - validation: - format: uri - maxLength: 2000 - candidate: - type: optional - docs: '' - validation: - format: uuid - attachment_type: - type: optional - docs: |- - The attachment's type. - - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - AttachmentResponse: - properties: - model: Attachment - warnings: list - errors: list - logs: optional> - source: - openapi: ats_v3.yml - AttachmentTypeEnum: - enum: - - RESUME - - COVER_LETTER - - OFFER_LETTER - - OTHER - docs: |- - * `RESUME` - RESUME - * `COVER_LETTER` - COVER_LETTER - * `OFFER_LETTER` - OFFER_LETTER - * `OTHER` - OTHER - source: - openapi: ats_v3.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: ats_v3.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: ats_v3.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: ats_v3.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: ats_v3.yml - CandidateApplicationsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Application - source: - openapi: ats_v3.yml - inline: true - CandidateAttachmentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Attachment - source: - openapi: ats_v3.yml - inline: true - Candidate: - docs: >- - # The Candidate Object - - ### Description - - The `Candidate` object is used to represent profile information about a - given Candidate. Because it is specific to a Candidate, this information - stays constant across applications. - - ### Usage Example - - Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all - candidates. - 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 - first_name: - type: optional - docs: The candidate's first name. - last_name: - type: optional - docs: The candidate's last name. - company: - type: optional - docs: The candidate's current company. - title: - type: optional - docs: The candidate's current title. - remote_created_at: - type: optional - docs: When the third party's candidate was created. - remote_updated_at: - type: optional - docs: When the third party's candidate was updated. - last_interaction_at: - type: optional - docs: When the most recent interaction with the candidate occurred. - is_private: - type: optional - docs: Whether or not the candidate is private. - can_email: - type: optional - docs: Whether or not the candidate can be emailed. - locations: - type: optional>> - docs: The candidate's locations. - phone_numbers: optional> - email_addresses: optional> - urls: optional> - tags: - type: optional>> - docs: Array of `Tag` names as strings. - applications: - type: optional>> - docs: Array of `Application` object IDs. - attachments: - type: optional>> - docs: Array of `Attachment` object IDs. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: ats_v3.yml - CandidateRequestApplicationsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Application - source: - openapi: ats_v3.yml - inline: true - CandidateRequestAttachmentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Attachment - source: - openapi: ats_v3.yml - inline: true - CandidateRequest: - docs: >- - # The Candidate Object - - ### Description - - The `Candidate` object is used to represent profile information about a - given Candidate. Because it is specific to a Candidate, this information - stays constant across applications. - - ### Usage Example - - Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all - candidates. - properties: - first_name: - type: optional - docs: The candidate's first name. - last_name: - type: optional - docs: The candidate's last name. - company: - type: optional - docs: The candidate's current company. - title: - type: optional - docs: The candidate's current title. - last_interaction_at: - type: optional - docs: When the most recent interaction with the candidate occurred. - is_private: - type: optional - docs: Whether or not the candidate is private. - can_email: - type: optional - docs: Whether or not the candidate can be emailed. - locations: - type: optional>> - docs: The candidate's locations. - phone_numbers: optional> - email_addresses: optional> - urls: optional> - tags: - type: optional>> - docs: Array of `Tag` names as strings. - applications: - type: optional>> - docs: Array of `Application` object IDs. - attachments: - type: optional>> - docs: Array of `Attachment` object IDs. - remote_template_id: - type: optional - validation: - minLength: 1 - access: write-only - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - CandidateResponse: - properties: - model: Candidate - warnings: list - errors: list - logs: optional> - source: - openapi: ats_v3.yml - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: ats_v3.yml - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: ats_v3.yml - CommonModelScopeApi: - properties: - common_models: - docs: The common models you want to update the scopes for - type: list - source: - openapi: ats_v3.yml - CommonModelScopesBodyRequest: - properties: - model_id: - type: string - validation: - minLength: 1 - enabled_actions: list - disabled_fields: list - source: - openapi: ats_v3.yml - 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: MethodEnum - 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: ats_v3.yml - DebugModeLog: - properties: - log_id: string - dashboard_view: string - log_summary: DebugModelLogSummary - source: - openapi: ats_v3.yml - DebugModelLogSummary: - properties: - url: string - method: string - status_code: integer - source: - openapi: ats_v3.yml - Department: - docs: >- - # The Department Object - - ### Description - - The `Department` object is used to represent a department within a - company. - - ### Usage Example - - Fetch from the `LIST Departments` endpoint and view the departments within - a company. - 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 department's name. - 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: ats_v3.yml - DisabilityStatusEnum: - enum: - - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - - NO_I_DONT_HAVE_A_DISABILITY - - I_DONT_WISH_TO_ANSWER - docs: >- - * `YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY` - - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - - * `NO_I_DONT_HAVE_A_DISABILITY` - NO_I_DONT_HAVE_A_DISABILITY - - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - source: - openapi: ats_v3.yml - EeocCandidate: - discriminated: false - docs: The candidate being represented. - union: - - type: string - validation: - format: uuid - - Candidate - source: - openapi: ats_v3.yml - inline: true - EeocRace: - discriminated: false - docs: >- - The candidate's race. - - - * `AMERICAN_INDIAN_OR_ALASKAN_NATIVE` - AMERICAN_INDIAN_OR_ALASKAN_NATIVE - - * `ASIAN` - ASIAN - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `WHITE` - WHITE - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - union: - - RaceEnum - - string - source: - openapi: ats_v3.yml - inline: true - EeocGender: - discriminated: false - docs: |- - The candidate's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - union: - - GenderEnum - - string - source: - openapi: ats_v3.yml - inline: true - EeocVeteranStatus: - discriminated: false - docs: >- - The candidate's veteran status. - - - * `I_AM_NOT_A_PROTECTED_VETERAN` - I_AM_NOT_A_PROTECTED_VETERAN - - * - `I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN` - - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - union: - - VeteranStatusEnum - - string - source: - openapi: ats_v3.yml - inline: true - EeocDisabilityStatus: - discriminated: false - docs: >- - The candidate's disability status. - - - * `YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY` - - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - - * `NO_I_DONT_HAVE_A_DISABILITY` - NO_I_DONT_HAVE_A_DISABILITY - - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - union: - - DisabilityStatusEnum - - string - source: - openapi: ats_v3.yml - inline: true - Eeoc: - docs: >- - # The EEOC Object - - ### Description - - The `EEOC` object is used to represent the Equal Employment Opportunity - Commission information for a candidate (race, gender, veteran status, - disability status). - - ### Usage Example - - Fetch from the `LIST EEOCs` endpoint and filter by `candidate` to show all - EEOC information for a candidate. - 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 - candidate: - type: optional - docs: The candidate being represented. - submitted_at: - type: optional - docs: When the information was submitted. - race: - type: optional - docs: >- - The candidate's race. - - - * `AMERICAN_INDIAN_OR_ALASKAN_NATIVE` - - AMERICAN_INDIAN_OR_ALASKAN_NATIVE - - * `ASIAN` - ASIAN - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `WHITE` - WHITE - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - gender: - type: optional - docs: |- - The candidate's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - veteran_status: - type: optional - docs: >- - The candidate's veteran status. - - - * `I_AM_NOT_A_PROTECTED_VETERAN` - I_AM_NOT_A_PROTECTED_VETERAN - - * - `I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN` - - - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - disability_status: - type: optional - docs: >- - The candidate's disability status. - - - * `YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY` - - YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - - * `NO_I_DONT_HAVE_A_DISABILITY` - NO_I_DONT_HAVE_A_DISABILITY - - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - 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: ats_v3.yml - EmailAddressEmailAddressType: - discriminated: false - docs: |- - The type of email address. - - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - union: - - EmailAddressTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - EmailAddress: - docs: >- - # The EmailAddress Object - - ### Description - - The `EmailAddress` object is used to represent a candidate's email - address. - - ### Usage Example - - Fetch from the `GET Candidate` endpoint and view their email addresses. - properties: - 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 - value: - type: optional - docs: The email address. - validation: - format: email - maxLength: 254 - email_address_type: - type: optional - docs: |- - The type of email address. - - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - 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 - source: - openapi: ats_v3.yml - EmailAddressRequestEmailAddressType: - discriminated: false - docs: |- - The type of email address. - - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - union: - - EmailAddressTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - EmailAddressRequest: - docs: >- - # The EmailAddress Object - - ### Description - - The `EmailAddress` object is used to represent a candidate's email - address. - - ### Usage Example - - Fetch from the `GET Candidate` endpoint and view their email addresses. - properties: - value: - type: optional - docs: The email address. - validation: - format: email - maxLength: 254 - email_address_type: - type: optional - docs: |- - The type of email address. - - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - EmailAddressTypeEnum: - enum: - - PERSONAL - - WORK - - OTHER - docs: |- - * `PERSONAL` - PERSONAL - * `WORK` - WORK - * `OTHER` - OTHER - source: - openapi: ats_v3.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: ats_v3.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: ats_v3.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: ats_v3.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: ats_v3.yml - ExternalTargetFieldApi: - properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only - source: - openapi: ats_v3.yml - ExternalTargetFieldApiResponse: - properties: - Activity: optional> - Application: optional> - Attachment: optional> - Candidate: optional> - Department: optional> - EEOC: optional> - ScheduledInterview: optional> - Job: optional> - JobPosting: optional> - JobInterviewStage: optional> - Offer: optional> - Office: optional> - RejectReason: optional> - Scorecard: optional> - Tag: optional> - RemoteUser: optional> - source: - openapi: ats_v3.yml - FieldMappingApiInstanceTargetField: - properties: - name: string - description: string - is_organization_wide: boolean - source: - openapi: ats_v3.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: - properties: - method: optional - url_path: optional - field_traversal_path: optional> - source: - openapi: ats_v3.yml - inline: true - FieldMappingApiInstanceRemoteField: - properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - source: - openapi: ats_v3.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 - source: - openapi: ats_v3.yml - FieldMappingApiInstanceResponse: - properties: - Activity: optional> - Application: optional> - Attachment: optional> - Candidate: optional> - Department: optional> - EEOC: optional> - ScheduledInterview: optional> - Job: optional> - JobPosting: optional> - JobInterviewStage: optional> - Offer: optional> - Office: optional> - RejectReason: optional> - Scorecard: optional> - Tag: optional> - RemoteUser: optional> - source: - openapi: ats_v3.yml - FieldMappingInstanceResponse: - properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> - source: - openapi: ats_v3.yml - FieldPermissionDeserializer: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: ats_v3.yml - FieldPermissionDeserializerRequest: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: ats_v3.yml - GenderEnum: - enum: - - MALE - - FEMALE - - value: NON-BINARY - name: NonBinary - - OTHER - - DECLINE_TO_SELF_IDENTIFY - docs: |- - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - source: - openapi: ats_v3.yml - IgnoreCommonModelRequestReason: - discriminated: false - union: - - ReasonEnum - - string - source: - openapi: ats_v3.yml - inline: true - IgnoreCommonModelRequest: - properties: - reason: IgnoreCommonModelRequestReason - message: - type: optional - validation: - minLength: 1 - maxLength: 256 - source: - openapi: ats_v3.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: ats_v3.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: ats_v3.yml - IssueStatus: - discriminated: false - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - union: - - IssueStatusEnum - - string - source: - openapi: ats_v3.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: ats_v3.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: ats_v3.yml - JobStatus: - discriminated: false - docs: |- - The job's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `ARCHIVED` - ARCHIVED - * `PENDING` - PENDING - union: - - JobStatusEnum - - string - source: - openapi: ats_v3.yml - inline: true - JobType: - discriminated: false - docs: |- - The job's type. - - * `POSTING` - POSTING - * `REQUISITION` - REQUISITION - * `PROFILE` - PROFILE - union: - - JobTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - JobDepartmentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Department - source: - openapi: ats_v3.yml - inline: true - JobOfficesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Office - source: - openapi: ats_v3.yml - inline: true - JobHiringManagersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - JobRecruitersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - Job: - docs: >- - # The Job Object - - ### Description - - The `Job` object can be used to track any jobs that are currently or will - be open/closed for applications. - - ### Usage Example - - Fetch from the `LIST Jobs` endpoint to show all job postings. - 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 job's name. - description: - type: optional - docs: The job's description. - code: - type: optional - docs: >- - The job's code. Typically an additional identifier used to reference - the particular job that is displayed on the ATS. - status: - type: optional - docs: |- - The job's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `ARCHIVED` - ARCHIVED - * `PENDING` - PENDING - type: - type: optional - docs: |- - The job's type. - - * `POSTING` - POSTING - * `REQUISITION` - REQUISITION - * `PROFILE` - PROFILE - job_postings: - type: optional>> - docs: IDs of `JobPosting` objects that serve as job postings for this `Job`. - job_posting_urls: optional> - remote_created_at: - type: optional - docs: When the third party's job was created. - remote_updated_at: - type: optional - docs: When the third party's job was updated. - confidential: - type: optional - docs: Whether the job is confidential. - departments: - type: optional>> - docs: IDs of `Department` objects for this `Job`. - offices: - type: optional>> - docs: IDs of `Office` objects for this `Job`. - hiring_managers: - type: optional>> - docs: >- - IDs of `RemoteUser` objects that serve as hiring managers for this - `Job`. - recruiters: - type: optional>> - docs: IDs of `RemoteUser` objects that serve as recruiters for this `Job`. - 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: ats_v3.yml - JobInterviewStageJob: - discriminated: false - docs: >- - This field is populated only if the stage is specific to a particular job. - If the stage is generic, this field will not be populated. - union: - - type: string - validation: - format: uuid - - Job - source: - openapi: ats_v3.yml - inline: true - JobInterviewStage: - docs: >- - # The JobInterviewStage Object - - ### Description - - The `JobInterviewStage` object is used to represent a particular - recruiting stage for an `Application`. A given `Application` typically has - the `JobInterviewStage` object represented in the current_stage field. - - ### Usage Example - - Fetch from the `LIST JobInterviewStages` endpoint and view the job - interview stages used by a company. - 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: >- - Standard stage names are offered by ATS systems but can be modified by - users. - job: - type: optional - docs: >- - This field is populated only if the stage is specific to a particular - job. If the stage is generic, this field will not be populated. - stage_order: - type: optional - docs: >- - The stage’s order, with the lowest values ordered first. If the - third-party does not return details on the order of stages, this field - will not be populated. - validation: - min: -2147483648 - max: 2147483647 - 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: ats_v3.yml - JobPostingJobPostingUrlsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Url - source: - openapi: ats_v3.yml - inline: true - JobPostingJob: - discriminated: false - docs: ID of `Job` object for this `JobPosting`. - union: - - type: string - validation: - format: uuid - - Job - source: - openapi: ats_v3.yml - inline: true - JobPostingStatus: - discriminated: false - docs: |- - The job posting's status. - - * `PUBLISHED` - PUBLISHED - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `INTERNAL` - INTERNAL - * `PENDING` - PENDING - union: - - JobPostingStatusEnum - - string - source: - openapi: ats_v3.yml - inline: true - JobPosting: - docs: >- - # The JobPosting Object - - ### Description - - The `JobPosting` object represents an external announcement on a job board - created by an organization to attract qualified candidates to apply for a - specific `Job` opening - - ### Usage Example - - Fetch from the `LIST JobPostings` endpoint to show all job postings. - 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 job posting’s title. - job_posting_urls: - type: optional> - docs: >- - The Url object is used to represent hyperlinks for a candidate to - apply to a given job. - job: - type: optional - docs: ID of `Job` object for this `JobPosting`. - status: - type: optional - docs: |- - The job posting's status. - - * `PUBLISHED` - PUBLISHED - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `INTERNAL` - INTERNAL - * `PENDING` - PENDING - content: - type: optional - docs: The job posting’s content. - remote_created_at: - type: optional - docs: When the third party's job posting was created. - remote_updated_at: - type: optional - docs: When the third party's job posting was updated. - is_internal: - type: optional - docs: Indicates whether the job posting is internal or external. - 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: ats_v3.yml - JobPostingStatusEnum: - enum: - - PUBLISHED - - CLOSED - - DRAFT - - INTERNAL - - PENDING - docs: |- - * `PUBLISHED` - PUBLISHED - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `INTERNAL` - INTERNAL - * `PENDING` - PENDING - source: - openapi: ats_v3.yml - JobStatusEnum: - enum: - - OPEN - - CLOSED - - DRAFT - - ARCHIVED - - PENDING - docs: |- - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `DRAFT` - DRAFT - * `ARCHIVED` - ARCHIVED - * `PENDING` - PENDING - source: - openapi: ats_v3.yml - JobTypeEnum: - enum: - - POSTING - - REQUISITION - - PROFILE - docs: |- - * `POSTING` - POSTING - * `REQUISITION` - REQUISITION - * `PROFILE` - PROFILE - source: - openapi: ats_v3.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: ats_v3.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: ats_v3.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: ats_v3.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean - source: - openapi: ats_v3.yml - MetaResponse: - properties: - request_schema: map - remote_field_classes: optional> - status: optional - has_conditional_params: boolean - has_required_linked_account_params: boolean - source: - openapi: ats_v3.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: ats_v3.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: ats_v3.yml - ModelPermissionDeserializer: - properties: - is_enabled: optional - source: - openapi: ats_v3.yml - ModelPermissionDeserializerRequest: - properties: - is_enabled: optional - source: - openapi: ats_v3.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: ats_v3.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: ats_v3.yml - OfferApplication: - discriminated: false - docs: The application who is receiving the offer. - union: - - type: string - validation: - format: uuid - - Application - source: - openapi: ats_v3.yml - inline: true - OfferCreator: - discriminated: false - docs: The user who created the offer. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - OfferStatus: - discriminated: false - docs: |- - The offer's status. - - * `DRAFT` - DRAFT - * `APPROVAL-SENT` - APPROVAL-SENT - * `APPROVED` - APPROVED - * `SENT` - SENT - * `SENT-MANUALLY` - SENT-MANUALLY - * `OPENED` - OPENED - * `DENIED` - DENIED - * `SIGNED` - SIGNED - * `DEPRECATED` - DEPRECATED - union: - - OfferStatusEnum - - string - source: - openapi: ats_v3.yml - inline: true - Offer: - docs: >- - # The Offer Object - - ### Description - - The `Offer` object is used to represent an offer for a candidate's - application specific to a job. - - ### Usage Example - - Fetch from the `LIST Offers` endpoint and filter by `ID` to show all - offers. - 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 - application: - type: optional - docs: The application who is receiving the offer. - creator: - type: optional - docs: The user who created the offer. - remote_created_at: - type: optional - docs: When the third party's offer was created. - closed_at: - type: optional - docs: When the offer was closed. - sent_at: - type: optional - docs: When the offer was sent. - start_date: - type: optional - docs: The employment start date on the offer. - status: - type: optional - docs: |- - The offer's status. - - * `DRAFT` - DRAFT - * `APPROVAL-SENT` - APPROVAL-SENT - * `APPROVED` - APPROVED - * `SENT` - SENT - * `SENT-MANUALLY` - SENT-MANUALLY - * `OPENED` - OPENED - * `DENIED` - DENIED - * `SIGNED` - SIGNED - * `DEPRECATED` - DEPRECATED - 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: ats_v3.yml - OfferStatusEnum: - enum: - - DRAFT - - value: APPROVAL-SENT - name: ApprovalSent - - APPROVED - - SENT - - value: SENT-MANUALLY - name: SentManually - - OPENED - - DENIED - - SIGNED - - DEPRECATED - docs: |- - * `DRAFT` - DRAFT - * `APPROVAL-SENT` - APPROVAL-SENT - * `APPROVED` - APPROVED - * `SENT` - SENT - * `SENT-MANUALLY` - SENT-MANUALLY - * `OPENED` - OPENED - * `DENIED` - DENIED - * `SIGNED` - SIGNED - * `DEPRECATED` - DEPRECATED - source: - openapi: ats_v3.yml - Office: - docs: >- - # The Office Object - - ### Description - - The `Office` object is used to represent an office within a company. A - given `Job` has the `Office` ID in its offices field. - - ### Usage Example - - Fetch from the `LIST Offices` endpoint and view the offices within a - company. - 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 office's name. - location: - type: optional - docs: The office's location. - 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: ats_v3.yml - OverallRecommendationEnum: - enum: - - DEFINITELY_NO - - 'NO' - - 'YES' - - STRONG_YES - - NO_DECISION - docs: |- - * `DEFINITELY_NO` - DEFINITELY_NO - * `NO` - NO - * `YES` - YES - * `STRONG_YES` - STRONG_YES - * `NO_DECISION` - NO_DECISION - source: - openapi: ats_v3.yml - PaginatedAccountDetailsAndActionsList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedActivityList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedApplicationList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedAttachmentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedAuditLogEventList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedCandidateList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedDepartmentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedEeocList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedIssueList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedJobInterviewStageList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedJobList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedJobPostingList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedOfferList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedOfficeList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedRejectReasonList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedRemoteUserList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedScheduledInterviewList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedScorecardList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedScreeningQuestionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedSyncStatusList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PaginatedTagList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ats_v3.yml - PatchedCandidateRequest: - docs: >- - # The Candidate Object - - ### Description - - The `Candidate` object is used to represent profile information about a - given Candidate. Because it is specific to a Candidate, this information - stays constant across applications. - - ### Usage Example - - Fetch from the `LIST Candidates` endpoint and filter by `ID` to show all - candidates. - properties: - first_name: - type: optional - docs: The candidate's first name. - last_name: - type: optional - docs: The candidate's last name. - company: - type: optional - docs: The candidate's current company. - title: - type: optional - docs: The candidate's current title. - last_interaction_at: - type: optional - docs: When the most recent interaction with the candidate occurred. - is_private: - type: optional - docs: Whether or not the candidate is private. - can_email: - type: optional - docs: Whether or not the candidate can be emailed. - locations: - type: optional>> - docs: The candidate's locations. - phone_numbers: optional> - email_addresses: optional> - urls: optional> - tags: - type: optional>> - docs: Array of `Tag` names as strings. - applications: - type: optional>> - docs: Array of `Application` object IDs. - attachments: - type: optional>> - docs: Array of `Attachment` object IDs. - remote_template_id: - type: optional - validation: - minLength: 1 - access: write-only - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - PhoneNumberPhoneNumberType: - discriminated: false - docs: |- - The type of phone number. - - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - union: - - PhoneNumberTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - PhoneNumber: - docs: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent a candidate's phone number. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their phone numbers. - properties: - 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 - value: - type: optional - docs: The phone number. - phone_number_type: - type: optional - docs: |- - The type of phone number. - - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - 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 - source: - openapi: ats_v3.yml - PhoneNumberRequestPhoneNumberType: - discriminated: false - docs: |- - The type of phone number. - - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - union: - - PhoneNumberTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - PhoneNumberRequest: - docs: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent a candidate's phone number. - ### Usage Example - Fetch from the `GET Candidate` endpoint and view their phone numbers. - properties: - value: - type: optional - docs: The phone number. - phone_number_type: - type: optional - docs: |- - The type of phone number. - - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - PhoneNumberTypeEnum: - enum: - - HOME - - WORK - - MOBILE - - SKYPE - - OTHER - docs: |- - * `HOME` - HOME - * `WORK` - WORK - * `MOBILE` - MOBILE - * `SKYPE` - SKYPE - * `OTHER` - OTHER - source: - openapi: ats_v3.yml - RaceEnum: - enum: - - AMERICAN_INDIAN_OR_ALASKAN_NATIVE - - ASIAN - - BLACK_OR_AFRICAN_AMERICAN - - HISPANIC_OR_LATINO - - WHITE - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - TWO_OR_MORE_RACES - - DECLINE_TO_SELF_IDENTIFY - docs: >- - * `AMERICAN_INDIAN_OR_ALASKAN_NATIVE` - AMERICAN_INDIAN_OR_ALASKAN_NATIVE - - * `ASIAN` - ASIAN - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `WHITE` - WHITE - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY - source: - openapi: ats_v3.yml - ReasonEnum: - enum: - - GENERAL_CUSTOMER_REQUEST - - GDPR - - OTHER - docs: |- - * `GENERAL_CUSTOMER_REQUEST` - GENERAL_CUSTOMER_REQUEST - * `GDPR` - GDPR - * `OTHER` - OTHER - source: - openapi: ats_v3.yml - RejectReason: - docs: >- - # The RejectReason Object - - ### Description - - The `RejectReason` object is used to represent a reason for rejecting an - application. These can typically be configured within an ATS system. - - ### Usage Example - - Fetch from the `LIST RejectReasons` endpoint and filter by `ID` to show - all reasons. - 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 rejection reason’s name. - 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: ats_v3.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: ats_v3.yml - RemoteEndpointInfo: - properties: - method: string - url_path: string - field_traversal_path: list - source: - openapi: ats_v3.yml - RemoteFieldApiCoverage: - discriminated: false - union: - - integer - - double - source: - openapi: ats_v3.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: ats_v3.yml - RemoteFieldApiResponse: - properties: - Activity: optional> - Application: optional> - Attachment: optional> - Candidate: optional> - Department: optional> - EEOC: optional> - ScheduledInterview: optional> - Job: optional> - JobPosting: optional> - JobInterviewStage: optional> - Offer: optional> - Office: optional> - RejectReason: optional> - Scorecard: optional> - Tag: optional> - RemoteUser: optional> - source: - openapi: ats_v3.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: ats_v3.yml - RemoteResponseResponseType: - discriminated: false - union: - - ResponseTypeEnum - - string - source: - openapi: ats_v3.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: ats_v3.yml - RemoteUserAccessRole: - discriminated: false - docs: |- - The user's role. - - * `SUPER_ADMIN` - SUPER_ADMIN - * `ADMIN` - ADMIN - * `TEAM_MEMBER` - TEAM_MEMBER - * `LIMITED_TEAM_MEMBER` - LIMITED_TEAM_MEMBER - * `INTERVIEWER` - INTERVIEWER - union: - - AccessRoleEnum - - string - source: - openapi: ats_v3.yml - inline: true - RemoteUser: - docs: >- - # The RemoteUser Object - - ### Description - - The `RemoteUser` object is used to represent a user with a login to the - ATS system. - - ### Usage Example - - Fetch from the `LIST RemoteUsers` endpoint to show all users for a third - party. - 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 - first_name: - type: optional - docs: The user's first name. - last_name: - type: optional - docs: The user's last name. - email: - type: optional - docs: The user's email. - validation: - format: email - maxLength: 254 - disabled: - type: optional - docs: Whether the user's account had been disabled. - remote_created_at: - type: optional - docs: When the third party's user was created. - access_role: - type: optional - docs: |- - The user's role. - - * `SUPER_ADMIN` - SUPER_ADMIN - * `ADMIN` - ADMIN - * `TEAM_MEMBER` - TEAM_MEMBER - * `LIMITED_TEAM_MEMBER` - LIMITED_TEAM_MEMBER - * `INTERVIEWER` - INTERVIEWER - 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: ats_v3.yml - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - docs: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - source: - openapi: ats_v3.yml - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - docs: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - source: - openapi: ats_v3.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: ats_v3.yml - ScheduledInterviewApplication: - discriminated: false - docs: The application being interviewed. - union: - - type: string - validation: - format: uuid - - Application - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewJobInterviewStage: - discriminated: false - docs: The stage of the interview. - union: - - type: string - validation: - format: uuid - - JobInterviewStage - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewOrganizer: - discriminated: false - docs: The user organizing the interview. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewInterviewersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewStatus: - discriminated: false - docs: |- - The interview's status. - - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - union: - - ScheduledInterviewStatusEnum - - string - source: - openapi: ats_v3.yml - inline: true - ScheduledInterview: - docs: >- - # The ScheduledInterview Object - - ### Description - - The `ScheduledInterview` object is used to represent a scheduled interview - for a given candidate’s application to a job. An `Application` can have - multiple `ScheduledInterview`s depending on the particular hiring process. - - ### Usage Example - - Fetch from the `LIST ScheduledInterviews` endpoint and filter by - `interviewers` to show all office locations. - 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 - application: - type: optional - docs: The application being interviewed. - job_interview_stage: - type: optional - docs: The stage of the interview. - organizer: - type: optional - docs: The user organizing the interview. - interviewers: - type: optional>> - docs: Array of `RemoteUser` IDs. - location: - type: optional - docs: The interview's location. - start_at: - type: optional - docs: When the interview was started. - end_at: - type: optional - docs: When the interview was ended. - remote_created_at: - type: optional - docs: When the third party's interview was created. - remote_updated_at: - type: optional - docs: When the third party's interview was updated. - status: - type: optional - docs: |- - The interview's status. - - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - 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: ats_v3.yml - ScheduledInterviewRequestApplication: - discriminated: false - docs: The application being interviewed. - union: - - type: string - validation: - format: uuid - - Application - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewRequestJobInterviewStage: - discriminated: false - docs: The stage of the interview. - union: - - type: string - validation: - format: uuid - - JobInterviewStage - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewRequestOrganizer: - discriminated: false - docs: The user organizing the interview. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewRequestInterviewersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewRequestStatus: - discriminated: false - docs: |- - The interview's status. - - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - union: - - ScheduledInterviewStatusEnum - - string - source: - openapi: ats_v3.yml - inline: true - ScheduledInterviewRequest: - docs: >- - # The ScheduledInterview Object - - ### Description - - The `ScheduledInterview` object is used to represent a scheduled interview - for a given candidate’s application to a job. An `Application` can have - multiple `ScheduledInterview`s depending on the particular hiring process. - - ### Usage Example - - Fetch from the `LIST ScheduledInterviews` endpoint and filter by - `interviewers` to show all office locations. - properties: - application: - type: optional - docs: The application being interviewed. - job_interview_stage: - type: optional - docs: The stage of the interview. - organizer: - type: optional - docs: The user organizing the interview. - interviewers: - type: optional>> - docs: Array of `RemoteUser` IDs. - location: - type: optional - docs: The interview's location. - start_at: - type: optional - docs: When the interview was started. - end_at: - type: optional - docs: When the interview was ended. - status: - type: optional - docs: |- - The interview's status. - - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - ScheduledInterviewResponse: - properties: - model: ScheduledInterview - warnings: list - errors: list - logs: optional> - source: - openapi: ats_v3.yml - ScheduledInterviewStatusEnum: - enum: - - SCHEDULED - - AWAITING_FEEDBACK - - COMPLETE - docs: |- - * `SCHEDULED` - SCHEDULED - * `AWAITING_FEEDBACK` - AWAITING_FEEDBACK - * `COMPLETE` - COMPLETE - source: - openapi: ats_v3.yml - ScorecardApplication: - discriminated: false - docs: The application being scored. - union: - - type: string - validation: - format: uuid - - Application - source: - openapi: ats_v3.yml - inline: true - ScorecardInterview: - discriminated: false - docs: The interview being scored. - union: - - type: string - validation: - format: uuid - - ScheduledInterview - source: - openapi: ats_v3.yml - inline: true - ScorecardInterviewer: - discriminated: false - docs: The interviewer doing the scoring. - union: - - type: string - validation: - format: uuid - - RemoteUser - source: - openapi: ats_v3.yml - inline: true - ScorecardOverallRecommendation: - discriminated: false - docs: |- - The inteviewer's recommendation. - - * `DEFINITELY_NO` - DEFINITELY_NO - * `NO` - NO - * `YES` - YES - * `STRONG_YES` - STRONG_YES - * `NO_DECISION` - NO_DECISION - union: - - OverallRecommendationEnum - - string - source: - openapi: ats_v3.yml - inline: true - Scorecard: - docs: >- - # The Scorecard Object - - ### Description - - The `Scorecard` object is used to represent an interviewer's candidate - recommendation based on a particular interview. - - ### Usage Example - - Fetch from the `LIST Scorecards` endpoint and filter by `application` to - show all scorecard for an applicant. - 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 - application: - type: optional - docs: The application being scored. - interview: - type: optional - docs: The interview being scored. - interviewer: - type: optional - docs: The interviewer doing the scoring. - remote_created_at: - type: optional - docs: When the third party's scorecard was created. - submitted_at: - type: optional - docs: When the scorecard was submitted. - overall_recommendation: - type: optional - docs: |- - The inteviewer's recommendation. - - * `DEFINITELY_NO` - DEFINITELY_NO - * `NO` - NO - * `YES` - YES - * `STRONG_YES` - STRONG_YES - * `NO_DECISION` - NO_DECISION - 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: ats_v3.yml - ScreeningQuestionJob: - discriminated: false - docs: The job associated with the screening question. - union: - - type: string - validation: - format: uuid - - Job - source: - openapi: ats_v3.yml - inline: true - ScreeningQuestionType: - discriminated: false - docs: |- - The data type for the screening question. - - * `DATE` - DATE - * `FILE` - FILE - * `SINGLE_SELECT` - SINGLE_SELECT - * `MULTI_SELECT` - MULTI_SELECT - * `SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT - * `MULTI_LINE_TEXT` - MULTI_LINE_TEXT - * `NUMERIC` - NUMERIC - * `BOOLEAN` - BOOLEAN - union: - - ScreeningQuestionTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - ScreeningQuestion: - docs: >- - # The ScreeningQuestion Object - - ### Description - - The `ScreeningQuestion` object is used to represent questions asked to - screen candidates for a job. - - - ### Usage Example - - TODO - 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 - job: - type: optional - docs: The job associated with the screening question. - description: - type: optional - docs: The description of the screening question - validation: - maxLength: 500 - title: - type: optional - docs: The title of the screening question - validation: - maxLength: 2500 - type: - type: optional - docs: |- - The data type for the screening question. - - * `DATE` - DATE - * `FILE` - FILE - * `SINGLE_SELECT` - SINGLE_SELECT - * `MULTI_SELECT` - MULTI_SELECT - * `SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT - * `MULTI_LINE_TEXT` - MULTI_LINE_TEXT - * `NUMERIC` - NUMERIC - * `BOOLEAN` - BOOLEAN - required: - type: optional - docs: Whether or not the screening question is required. - options: 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/). - source: - openapi: ats_v3.yml - ScreeningQuestionAnswerQuestion: - discriminated: false - docs: >- - The screening question associated with the candidate’s answer. To - determine the data type of the answer, you can expand on the screening - question by adding `screening_question_answers.question` to the `expand` - query parameter. - union: - - type: string - validation: - format: uuid - - ScreeningQuestion - source: - openapi: ats_v3.yml - inline: true - ScreeningQuestionAnswer: - docs: >- - # The ScreeningQuestionAnswer Object - - ### Description - - The `ScreeningQuestionAnswer` object is used to represent candidate - responses to a screening question, for a specific application. - - - ### Usage Example - - TODO - 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 - question: - type: optional - docs: >- - The screening question associated with the candidate’s answer. To - determine the data type of the answer, you can expand on the screening - question by adding `screening_question_answers.question` to the - `expand` query parameter. - answer: - type: optional - docs: The candidate’s response to the screening question. - validation: - maxLength: 10000 - 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 - source: - openapi: ats_v3.yml - ScreeningQuestionAnswerRequestQuestion: - discriminated: false - docs: >- - The screening question associated with the candidate’s answer. To - determine the data type of the answer, you can expand on the screening - question by adding `screening_question_answers.question` to the `expand` - query parameter. - union: - - type: string - validation: - format: uuid - - ScreeningQuestion - source: - openapi: ats_v3.yml - inline: true - ScreeningQuestionAnswerRequest: - docs: >- - # The ScreeningQuestionAnswer Object - - ### Description - - The `ScreeningQuestionAnswer` object is used to represent candidate - responses to a screening question, for a specific application. - - - ### Usage Example - - TODO - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - question: - type: optional - docs: >- - The screening question associated with the candidate’s answer. To - determine the data type of the answer, you can expand on the screening - question by adding `screening_question_answers.question` to the - `expand` query parameter. - answer: - type: optional - docs: The candidate’s response to the screening question. - validation: - maxLength: 10000 - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - ScreeningQuestionOption: - docs: >- - # The ScreeningQuestionOption Object - - ### Description - - The `ScreeningQuestionOption` object is used to represent options for a - `ScreeningQuestion` object - - - ### Usage Example - - TODO - 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 - label: - type: optional - docs: Available response options - validation: - maxLength: 300 - 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/). - source: - openapi: ats_v3.yml - ScreeningQuestionTypeEnum: - enum: - - DATE - - FILE - - SINGLE_SELECT - - MULTI_SELECT - - SINGLE_LINE_TEXT - - MULTI_LINE_TEXT - - NUMERIC - - BOOLEAN - docs: |- - * `DATE` - DATE - * `FILE` - FILE - * `SINGLE_SELECT` - SINGLE_SELECT - * `MULTI_SELECT` - MULTI_SELECT - * `SINGLE_LINE_TEXT` - SINGLE_LINE_TEXT - * `MULTI_LINE_TEXT` - MULTI_LINE_TEXT - * `NUMERIC` - NUMERIC - * `BOOLEAN` - BOOLEAN - source: - openapi: ats_v3.yml - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - docs: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - source: - openapi: ats_v3.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: ats_v3.yml - SyncStatusLastSyncResult: - discriminated: false - union: - - LastSyncResultEnum - - string - source: - openapi: ats_v3.yml - inline: true - SyncStatusStatus: - discriminated: false - union: - - StatusFd5Enum - - string - source: - openapi: ats_v3.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: ats_v3.yml - Tag: - docs: >- - # The Tag Object - - ### Description - - The `Tag` object is used to represent a tag for a candidate. - - ### Usage Example - - Fetch from the `LIST Tags` endpoint and view the tags used within a - company. - properties: - 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 tag's name. - 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: optional>>> - source: - openapi: ats_v3.yml - UrlUrlType: - discriminated: false - docs: |- - The type of site. - - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - union: - - UrlTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - Url: - docs: >- - # The Url Object - - ### Description - - The `Url` object is used to represent hyperlinks associated with the - parent model. - - ### Usage Example - - Fetch from the `GET Candidate` endpoint and view their website urls. - properties: - 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 - value: - type: optional - docs: The site's url. - validation: - format: uri - maxLength: 2000 - url_type: - type: optional - docs: |- - The type of site. - - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - 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 - source: - openapi: ats_v3.yml - UrlRequestUrlType: - discriminated: false - docs: |- - The type of site. - - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - union: - - UrlTypeEnum - - string - source: - openapi: ats_v3.yml - inline: true - UrlRequest: - docs: >- - # The Url Object - - ### Description - - The `Url` object is used to represent hyperlinks associated with the - parent model. - - ### Usage Example - - Fetch from the `GET Candidate` endpoint and view their website urls. - properties: - value: - type: optional - docs: The site's url. - validation: - format: uri - maxLength: 2000 - url_type: - type: optional - docs: |- - The type of site. - - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ats_v3.yml - UrlTypeEnum: - enum: - - PERSONAL - - COMPANY - - PORTFOLIO - - BLOG - - SOCIAL_MEDIA - - OTHER - - JOB_POSTING - docs: |- - * `PERSONAL` - PERSONAL - * `COMPANY` - COMPANY - * `PORTFOLIO` - PORTFOLIO - * `BLOG` - BLOG - * `SOCIAL_MEDIA` - SOCIAL_MEDIA - * `OTHER` - OTHER - * `JOB_POSTING` - JOB_POSTING - source: - openapi: ats_v3.yml - ValidationProblemSource: - properties: - pointer: string - source: - openapi: ats_v3.yml - VeteranStatusEnum: - enum: - - I_AM_NOT_A_PROTECTED_VETERAN - - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - - I_DONT_WISH_TO_ANSWER - docs: >- - * `I_AM_NOT_A_PROTECTED_VETERAN` - I_AM_NOT_A_PROTECTED_VETERAN - - * - `I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN` - - I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN - - * `I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER - source: - openapi: ats_v3.yml - VisibilityEnum: - enum: - - ADMIN_ONLY - - PUBLIC - - PRIVATE - docs: |- - * `ADMIN_ONLY` - ADMIN_ONLY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - source: - openapi: ats_v3.yml - WarningValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: ats_v3.yml - WebhookReceiver: - properties: - event: string - is_active: boolean - key: optional - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/accountDetails.yml b/.mock/definition/ATS/accountDetails.yml deleted file mode 100644 index 48428454c..000000000 --- a/.mock/definition/ATS/accountDetails.yml +++ /dev/null @@ -1,38 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /ats/v1/account-details - method: GET - auth: - - tokenAuth: [] - docs: Get details for a linked account. - source: - openapi: ats_v3.yml - response: - docs: '' - type: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/accountToken.yml b/.mock/definition/ATS/accountToken.yml deleted file mode 100644 index ae8d93094..000000000 --- a/.mock/definition/ATS/accountToken.yml +++ /dev/null @@ -1,47 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /ats/v1/account-token/{public_token} - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns the account token for the end user with the provided public - token. - source: - openapi: ats_v3.yml - path-parameters: - public_token: string - response: - docs: '' - type: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/activities.yml b/.mock/definition/ATS/activities.yml deleted file mode 100644 index 99b916b4c..000000000 --- a/.mock/definition/ATS/activities.yml +++ /dev/null @@ -1,510 +0,0 @@ -types: - ActivitiesListRequestRemoteFields: - enum: - - activity_type - - value: activity_type,visibility - name: ActivityTypeVisibility - - visibility - source: - openapi: ats_v3.yml - ActivitiesListRequestShowEnumOrigins: - enum: - - activity_type - - value: activity_type,visibility - name: ActivityTypeVisibility - - visibility - source: - openapi: ats_v3.yml - ActivitiesRetrieveRequestRemoteFields: - enum: - - activity_type - - value: activity_type,visibility - name: ActivityTypeVisibility - - visibility - source: - openapi: ats_v3.yml - ActivitiesRetrieveRequestShowEnumOrigins: - enum: - - activity_type - - value: activity_type,visibility - name: ActivityTypeVisibility - - visibility - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/activities - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Activity` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: ActivitiesListRequest - 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> - allow-multiple: true - 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_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional - docs: >- - 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) - user_id: - type: optional - docs: If provided, will only return activities done by this user. - response: - docs: '' - type: atsRoot.PaginatedActivityList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: activity_type - remote_id: remote_id - show_enum_origins: activity_type - user_id: user_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '198123' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - user: user - remote_created_at: '2021-10-15T00:00:00Z' - activity_type: NOTE - subject: Gil Feig's interview - body: Candidate loves integrations! - visibility: ADMIN_ONLY - candidate: 550e8400-e29b-41d4-a716-446655440000 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - create: - path: /ats/v1/activities - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Activity` object with the given values. - source: - openapi: ats_v3.yml - request: - name: ActivityEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: atsRoot.ActivityRequest - remote_user_id: string - content-type: application/json - response: - docs: '' - type: atsRoot.ActivityResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - remote_user_id: remote_user_id - response: - body: - model: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '198123' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - user: user - remote_created_at: '2021-10-15T00:00:00Z' - activity_type: NOTE - subject: Gil Feig's interview - body: Candidate loves integrations! - visibility: ADMIN_ONLY - candidate: 550e8400-e29b-41d4-a716-446655440000 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - 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 - retrieve: - path: /ats/v1/activities/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Activity` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: ActivitiesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: atsRoot.Activity - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: activity_type - show_enum_origins: activity_type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '198123' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - user: user - remote_created_at: '2021-10-15T00:00:00Z' - activity_type: NOTE - subject: Gil Feig's interview - body: Candidate loves integrations! - visibility: ADMIN_ONLY - candidate: 550e8400-e29b-41d4-a716-446655440000 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - metaPostRetrieve: - path: /ats/v1/activities/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Activity` POSTs. - source: - openapi: ats_v3.yml - response: - docs: '' - type: atsRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/applications.yml b/.mock/definition/ATS/applications.yml deleted file mode 100644 index c0347b5d3..000000000 --- a/.mock/definition/ATS/applications.yml +++ /dev/null @@ -1,639 +0,0 @@ -types: - ApplicationsListRequestExpandItem: - enum: - - candidate - - credited_to - - current_stage - - job - - offers - - reject_reason - - screening_question_answers - - value: screening_question_answers.question - name: ScreeningQuestionAnswersQuestion - source: - openapi: ats_v3.yml - ApplicationsRetrieveRequestExpandItem: - enum: - - candidate - - credited_to - - current_stage - - job - - offers - - reject_reason - - screening_question_answers - - value: screening_question_answers.question - name: ScreeningQuestionAnswersQuestion - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/applications - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Application` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: ApplicationsListRequest - query-parameters: - candidate_id: - type: optional - docs: If provided, will only return applications for this candidate. - 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. - credited_to_id: - type: optional - docs: If provided, will only return applications credited to this user. - current_stage_id: - type: optional - docs: >- - If provided, will only return applications at this interview - stage. - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - allow-multiple: true - 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). - job_id: - type: optional - docs: If provided, will only return applications for this job. - 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. - reject_reason_id: - type: optional - docs: >- - If provided, will only return applications with this reject - reason. - remote_id: - type: optional - docs: The API provider's ID for the given object. - source: - type: optional - docs: If provided, will only return applications with this source. - response: - docs: '' - type: atsRoot.PaginatedApplicationList - status-code: 200 - examples: - - query-parameters: - candidate_id: candidate_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - credited_to_id: credited_to_id - current_stage_id: current_stage_id - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - job_id: job_id - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - reject_reason_id: reject_reason_id - remote_id: remote_id - source: source - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - remote_id: '98796' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - candidate: candidate - job: job - applied_at: '2021-10-15T00:00:00Z' - rejected_at: '2021-11-15T00:00:00Z' - offers: - - e9b5c11d-c588-468e-8567-cd6992e42b62 - source: Campus recruiting event - credited_to: credited_to - screening_question_answers: - - screening_question_answers - - screening_question_answers - current_stage: current_stage - reject_reason: reject_reason - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidacies - data: - - Varies by platform - create: - path: /ats/v1/applications - method: POST - auth: - - tokenAuth: [] - docs: > - Creates an `Application` object with the given values. - - For certain integrations, but not all, our API detects duplicate - candidates and will associate applications with existing records in the - third-party. New candidates are created and automatically linked to the - application. - - - See our [Help Center - article](https://help.merge.dev/en/articles/10012366-updates-to-post-applications-oct-2024) - for detailed support per integration. - source: - openapi: ats_v3.yml - request: - name: ApplicationEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: atsRoot.ApplicationRequest - remote_user_id: string - content-type: application/json - response: - docs: '' - type: atsRoot.ApplicationResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - remote_user_id: remote_user_id - response: - body: - model: - id: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - remote_id: '98796' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - candidate: candidate - job: job - applied_at: '2021-10-15T00:00:00Z' - rejected_at: '2021-11-15T00:00:00Z' - offers: - - e9b5c11d-c588-468e-8567-cd6992e42b62 - source: Campus recruiting event - credited_to: credited_to - screening_question_answers: - - screening_question_answers - - screening_question_answers - current_stage: current_stage - reject_reason: reject_reason - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidacies - data: - - Varies by platform - 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 - retrieve: - path: /ats/v1/applications/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Application` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: ApplicationsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: atsRoot.Application - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - remote_id: '98796' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - candidate: candidate - job: job - applied_at: '2021-10-15T00:00:00Z' - rejected_at: '2021-11-15T00:00:00Z' - offers: - - e9b5c11d-c588-468e-8567-cd6992e42b62 - source: Campus recruiting event - credited_to: credited_to - screening_question_answers: - - screening_question_answers - - screening_question_answers - current_stage: current_stage - reject_reason: reject_reason - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidacies - data: - - Varies by platform - changeStageCreate: - path: /ats/v1/applications/{id}/change-stage - method: POST - auth: - - tokenAuth: [] - docs: Updates the `current_stage` field of an `Application` object - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: UpdateApplicationStageRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - job_interview_stage: - type: optional - docs: The interview stage to move the application to. - validation: - format: uuid - remote_user_id: - type: optional - validation: - minLength: 1 - content-type: application/json - response: - docs: '' - type: atsRoot.ApplicationResponse - status-code: 201 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: {} - response: - body: - model: - id: 92e8a369-fffe-430d-b93a-f7e8a16563f1 - remote_id: '98796' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - candidate: candidate - job: job - applied_at: '2021-10-15T00:00:00Z' - rejected_at: '2021-11-15T00:00:00Z' - offers: - - e9b5c11d-c588-468e-8567-cd6992e42b62 - source: Campus recruiting event - credited_to: credited_to - screening_question_answers: - - screening_question_answers - - screening_question_answers - current_stage: current_stage - reject_reason: reject_reason - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidacies - data: - - Varies by platform - 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 - metaPostRetrieve: - path: /ats/v1/applications/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Application` POSTs. - source: - openapi: ats_v3.yml - request: - name: ApplicationsMetaPostRetrieveRequest - query-parameters: - application_remote_template_id: - type: optional - docs: >- - The template ID associated with the nested application in the - request. - response: - docs: '' - type: atsRoot.MetaResponse - status-code: 200 - examples: - - query-parameters: - application_remote_template_id: application_remote_template_id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/asyncPassthrough.yml b/.mock/definition/ATS/asyncPassthrough.yml deleted file mode 100644 index b84e9da2a..000000000 --- a/.mock/definition/ATS/asyncPassthrough.yml +++ /dev/null @@ -1,74 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ats/v1/async-passthrough - method: POST - auth: - - tokenAuth: [] - docs: >- - Asynchronously pull data from an endpoint not currently supported by - Merge. - source: - openapi: ats_v3.yml - request: - body: atsRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: atsRoot.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: /ats/v1/async-passthrough/{async_passthrough_receipt_id} - method: GET - auth: - - tokenAuth: [] - docs: Retrieves data from earlier async-passthrough POST request - source: - openapi: ats_v3.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: ats_v3.yml -types: - AsyncPassthroughRetrieveResponse: - discriminated: false - union: - - atsRoot.RemoteResponse - - string - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/attachments.yml b/.mock/definition/ATS/attachments.yml deleted file mode 100644 index 61e0a1e1e..000000000 --- a/.mock/definition/ATS/attachments.yml +++ /dev/null @@ -1,468 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/attachments - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Attachment` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: AttachmentsListRequest - query-parameters: - candidate_id: - type: optional - docs: If provided, will only return attachments for this candidate. - 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> - allow-multiple: true - 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_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.PaginatedAttachmentList - status-code: 200 - examples: - - query-parameters: - candidate_id: candidate_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: attachment_type - remote_id: remote_id - show_enum_origins: attachment_type - 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' - file_name: Candidate Resume - file_url: http://alturl.com/p749b - candidate: 2872ba14-4084-492b-be96-e5eee6fc33ef - attachment_type: RESUME - 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 - create: - path: /ats/v1/attachments - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Attachment` object with the given values. - source: - openapi: ats_v3.yml - request: - name: AttachmentEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: atsRoot.AttachmentRequest - remote_user_id: string - content-type: application/json - response: - docs: '' - type: atsRoot.AttachmentResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - remote_user_id: remote_user_id - response: - body: - model: - id: c640b80b-fac9-409f-aa19-1f9221aec445 - remote_id: '11167' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - file_name: Candidate Resume - file_url: http://alturl.com/p749b - candidate: 2872ba14-4084-492b-be96-e5eee6fc33ef - attachment_type: RESUME - 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 - 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 - retrieve: - path: /ats/v1/attachments/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Attachment` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: AttachmentsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.Attachment - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: attachment_type - show_enum_origins: attachment_type - 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' - file_name: Candidate Resume - file_url: http://alturl.com/p749b - candidate: 2872ba14-4084-492b-be96-e5eee6fc33ef - attachment_type: RESUME - 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 - metaPostRetrieve: - path: /ats/v1/attachments/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Attachment` POSTs. - source: - openapi: ats_v3.yml - response: - docs: '' - type: atsRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/auditTrail.yml b/.mock/definition/ATS/auditTrail.yml deleted file mode 100644 index 3a53d381f..000000000 --- a/.mock/definition/ATS/auditTrail.yml +++ /dev/null @@ -1,108 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/audit-trail - method: GET - auth: - - tokenAuth: [] - docs: Gets a list of audit trail events. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.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: atsRoot.PaginatedAuditLogEventList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - event_type: event_type - page_size: 1 - start_date: start_date - user_email: user_email - 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: ats_v3.yml diff --git a/.mock/definition/ATS/availableActions.yml b/.mock/definition/ATS/availableActions.yml deleted file mode 100644 index 7cc26f4d9..000000000 --- a/.mock/definition/ATS/availableActions.yml +++ /dev/null @@ -1,52 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /ats/v1/available-actions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of models and actions available for an account. - source: - openapi: ats_v3.yml - response: - docs: '' - type: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/candidates.yml b/.mock/definition/ATS/candidates.yml deleted file mode 100644 index a757ff051..000000000 --- a/.mock/definition/ATS/candidates.yml +++ /dev/null @@ -1,900 +0,0 @@ -types: - CandidatesListRequestExpandItem: - enum: - - applications - - attachments - source: - openapi: ats_v3.yml - CandidatesRetrieveRequestExpandItem: - enum: - - applications - - attachments - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/candidates - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Candidate` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: CandidatesListRequest - 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. - email_addresses: - type: optional - docs: >- - If provided, will only return candidates with these email - addresses; multiple addresses can be separated by commas. - expand: - type: optional - allow-multiple: true - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - first_name: - type: optional - docs: If provided, will only return candidates with this first name. - 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). - last_name: - type: optional - docs: If provided, will only return candidates with this last name. - 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. - tags: - type: optional - docs: >- - If provided, will only return candidates with these tags; multiple - tags can be separated by commas. - response: - docs: '' - type: atsRoot.PaginatedCandidateList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email_addresses: email_addresses - first_name: first_name - include_deleted_data: true - include_remote_data: true - include_shell_data: true - last_name: last_name - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - tags: tags - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 521b18c2-4d01-4297-b451-19858d07c133 - remote_id: '21198' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - company: Columbia Dining App. - title: Software Engineer - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - last_interaction_at: '2021-10-17T00:00:00Z' - is_private: true - can_email: true - locations: - - San Francisco - - New York - - Miami - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: '+1234567890' - phone_number_type: MOBILE - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: hello@merge.dev - email_address_type: PERSONAL - urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: http://alturl.com/p749b - url_type: BLOG - tags: - - High-Priority - applications: - - 29eb9867-ce2a-403f-b8ce-f2844b89f078 - - b4d08e5c-de00-4d64-a29f-66addac9af99 - - 4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56 - attachments: - - bea08964-32b4-4a20-8bb4-2612ba09de1d - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidates - data: - - Varies by platform - create: - path: /ats/v1/candidates - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Candidate` object with the given values. - source: - openapi: ats_v3.yml - request: - name: CandidateEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: atsRoot.CandidateRequest - remote_user_id: string - content-type: application/json - response: - docs: '' - type: atsRoot.CandidateResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - remote_user_id: remote_user_id - response: - body: - model: - id: 521b18c2-4d01-4297-b451-19858d07c133 - remote_id: '21198' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - company: Columbia Dining App. - title: Software Engineer - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - last_interaction_at: '2021-10-17T00:00:00Z' - is_private: true - can_email: true - locations: - - San Francisco - - New York - - Miami - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: '+1234567890' - phone_number_type: MOBILE - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: hello@merge.dev - email_address_type: PERSONAL - urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: http://alturl.com/p749b - url_type: BLOG - tags: - - High-Priority - applications: - - 29eb9867-ce2a-403f-b8ce-f2844b89f078 - - b4d08e5c-de00-4d64-a29f-66addac9af99 - - 4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56 - attachments: - - bea08964-32b4-4a20-8bb4-2612ba09de1d - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidates - data: - - Varies by platform - 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 - retrieve: - path: /ats/v1/candidates/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Candidate` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: CandidatesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: atsRoot.Candidate - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 521b18c2-4d01-4297-b451-19858d07c133 - remote_id: '21198' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - company: Columbia Dining App. - title: Software Engineer - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - last_interaction_at: '2021-10-17T00:00:00Z' - is_private: true - can_email: true - locations: - - San Francisco - - New York - - Miami - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: '+1234567890' - phone_number_type: MOBILE - remote_was_deleted: true - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: hello@merge.dev - email_address_type: PERSONAL - remote_was_deleted: true - urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: http://alturl.com/p749b - url_type: BLOG - remote_was_deleted: true - tags: - - High-Priority - applications: - - 29eb9867-ce2a-403f-b8ce-f2844b89f078 - - b4d08e5c-de00-4d64-a29f-66addac9af99 - - 4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56 - attachments: - - bea08964-32b4-4a20-8bb4-2612ba09de1d - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidates - data: - - Varies by platform - partialUpdate: - path: /ats/v1/candidates/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates a `Candidate` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: PatchedCandidateEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: atsRoot.PatchedCandidateRequest - remote_user_id: string - content-type: application/json - response: - docs: '' - type: atsRoot.CandidateResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - remote_user_id: remote_user_id - response: - body: - model: - id: 521b18c2-4d01-4297-b451-19858d07c133 - remote_id: '21198' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - company: Columbia Dining App. - title: Software Engineer - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - last_interaction_at: '2021-10-17T00:00:00Z' - is_private: true - can_email: true - locations: - - San Francisco - - New York - - Miami - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: '+1234567890' - phone_number_type: MOBILE - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: hello@merge.dev - email_address_type: PERSONAL - urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: http://alturl.com/p749b - url_type: BLOG - tags: - - High-Priority - applications: - - 29eb9867-ce2a-403f-b8ce-f2844b89f078 - - b4d08e5c-de00-4d64-a29f-66addac9af99 - - 4ff877d2-fb3e-4a5b-a7a5-168ddf2ffa56 - attachments: - - bea08964-32b4-4a20-8bb4-2612ba09de1d - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /candidates - data: - - Varies by platform - 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 - ignoreCreate: - path: /ats/v1/candidates/ignore/{model_id} - method: POST - auth: - - tokenAuth: [] - docs: >- - 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. - source: - openapi: ats_v3.yml - path-parameters: - model_id: string - request: - body: atsRoot.IgnoreCommonModelRequest - content-type: application/json - examples: - - path-parameters: - model_id: model_id - headers: - X-Account-Token: X-Account-Token - request: - reason: GENERAL_CUSTOMER_REQUEST - metaPatchRetrieve: - path: /ats/v1/candidates/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Candidate` PATCHs. - source: - openapi: ats_v3.yml - path-parameters: - id: string - response: - docs: '' - type: atsRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /ats/v1/candidates/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Candidate` POSTs. - source: - openapi: ats_v3.yml - response: - docs: '' - type: atsRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/deleteAccount.yml b/.mock/definition/ATS/deleteAccount.yml deleted file mode 100644 index b902b54e2..000000000 --- a/.mock/definition/ATS/deleteAccount.yml +++ /dev/null @@ -1,17 +0,0 @@ -service: - auth: false - base-path: '' - endpoints: - delete: - path: /ats/v1/delete-account - method: POST - auth: - - tokenAuth: [] - docs: Delete a linked account. - source: - openapi: ats_v3.yml - examples: - - headers: - X-Account-Token: X-Account-Token - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/departments.yml b/.mock/definition/ATS/departments.yml deleted file mode 100644 index d8eee7ec7..000000000 --- a/.mock/definition/ATS/departments.yml +++ /dev/null @@ -1,158 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/departments - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Department` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: DepartmentsListRequest - 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: atsRoot.PaginatedDepartmentList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - remote_id: '23456' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Engineering - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /departments - data: - - Varies by platform - retrieve: - path: /ats/v1/departments/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Department` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: DepartmentsRetrieveRequest - 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: atsRoot.Department - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - remote_id: '23456' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Engineering - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /departments - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/eeocs.yml b/.mock/definition/ATS/eeocs.yml deleted file mode 100644 index a5b85dc56..000000000 --- a/.mock/definition/ATS/eeocs.yml +++ /dev/null @@ -1,329 +0,0 @@ -types: - EeocsListRequestRemoteFields: - enum: - - disability_status - - value: disability_status,gender - name: DisabilityStatusGender - - value: disability_status,gender,race - name: DisabilityStatusGenderRace - - value: disability_status,gender,race,veteran_status - name: DisabilityStatusGenderRaceVeteranStatus - - value: disability_status,gender,veteran_status - name: DisabilityStatusGenderVeteranStatus - - value: disability_status,race - name: DisabilityStatusRace - - value: disability_status,race,veteran_status - name: DisabilityStatusRaceVeteranStatus - - value: disability_status,veteran_status - name: DisabilityStatusVeteranStatus - - gender - - value: gender,race - name: GenderRace - - value: gender,race,veteran_status - name: GenderRaceVeteranStatus - - value: gender,veteran_status - name: GenderVeteranStatus - - race - - value: race,veteran_status - name: RaceVeteranStatus - - veteran_status - source: - openapi: ats_v3.yml - EeocsListRequestShowEnumOrigins: - enum: - - disability_status - - value: disability_status,gender - name: DisabilityStatusGender - - value: disability_status,gender,race - name: DisabilityStatusGenderRace - - value: disability_status,gender,race,veteran_status - name: DisabilityStatusGenderRaceVeteranStatus - - value: disability_status,gender,veteran_status - name: DisabilityStatusGenderVeteranStatus - - value: disability_status,race - name: DisabilityStatusRace - - value: disability_status,race,veteran_status - name: DisabilityStatusRaceVeteranStatus - - value: disability_status,veteran_status - name: DisabilityStatusVeteranStatus - - gender - - value: gender,race - name: GenderRace - - value: gender,race,veteran_status - name: GenderRaceVeteranStatus - - value: gender,veteran_status - name: GenderVeteranStatus - - race - - value: race,veteran_status - name: RaceVeteranStatus - - veteran_status - source: - openapi: ats_v3.yml - EeocsRetrieveRequestRemoteFields: - enum: - - disability_status - - value: disability_status,gender - name: DisabilityStatusGender - - value: disability_status,gender,race - name: DisabilityStatusGenderRace - - value: disability_status,gender,race,veteran_status - name: DisabilityStatusGenderRaceVeteranStatus - - value: disability_status,gender,veteran_status - name: DisabilityStatusGenderVeteranStatus - - value: disability_status,race - name: DisabilityStatusRace - - value: disability_status,race,veteran_status - name: DisabilityStatusRaceVeteranStatus - - value: disability_status,veteran_status - name: DisabilityStatusVeteranStatus - - gender - - value: gender,race - name: GenderRace - - value: gender,race,veteran_status - name: GenderRaceVeteranStatus - - value: gender,veteran_status - name: GenderVeteranStatus - - race - - value: race,veteran_status - name: RaceVeteranStatus - - veteran_status - source: - openapi: ats_v3.yml - EeocsRetrieveRequestShowEnumOrigins: - enum: - - disability_status - - value: disability_status,gender - name: DisabilityStatusGender - - value: disability_status,gender,race - name: DisabilityStatusGenderRace - - value: disability_status,gender,race,veteran_status - name: DisabilityStatusGenderRaceVeteranStatus - - value: disability_status,gender,veteran_status - name: DisabilityStatusGenderVeteranStatus - - value: disability_status,race - name: DisabilityStatusRace - - value: disability_status,race,veteran_status - name: DisabilityStatusRaceVeteranStatus - - value: disability_status,veteran_status - name: DisabilityStatusVeteranStatus - - gender - - value: gender,race - name: GenderRace - - value: gender,race,veteran_status - name: GenderRaceVeteranStatus - - value: gender,veteran_status - name: GenderVeteranStatus - - race - - value: race,veteran_status - name: RaceVeteranStatus - - veteran_status - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/eeocs - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `EEOC` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: EeocsListRequest - query-parameters: - candidate_id: - type: optional - docs: If provided, will only return EEOC info for this candidate. - 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> - allow-multiple: true - 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_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: atsRoot.PaginatedEeocList - status-code: 200 - examples: - - query-parameters: - candidate_id: candidate_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: disability_status - remote_id: remote_id - show_enum_origins: disability_status - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: f7dd7b4f-237e-4772-8bd4-3246384c6c58 - remote_id: '76' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - candidate: candidate - submitted_at: '2021-10-15T00:00:00Z' - race: AMERICAN_INDIAN_OR_ALASKAN_NATIVE - gender: MALE - veteran_status: I_AM_NOT_A_PROTECTED_VETERAN - disability_status: YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /eeoc - data: - - Varies by platform - retrieve: - path: /ats/v1/eeocs/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `EEOC` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: EeocsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: atsRoot.Eeoc - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: disability_status - show_enum_origins: disability_status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: f7dd7b4f-237e-4772-8bd4-3246384c6c58 - remote_id: '76' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - candidate: candidate - submitted_at: '2021-10-15T00:00:00Z' - race: AMERICAN_INDIAN_OR_ALASKAN_NATIVE - gender: MALE - veteran_status: I_AM_NOT_A_PROTECTED_VETERAN - disability_status: YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /eeoc - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/fieldMapping.yml b/.mock/definition/ATS/fieldMapping.yml deleted file mode 100644 index bda9917a7..000000000 --- a/.mock/definition/ATS/fieldMapping.yml +++ /dev/null @@ -1,911 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - field_mappings_retrieve: - path: /ats/v1/field-mappings - method: GET - auth: - - tokenAuth: [] - 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: ats_v3.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: atsRoot.FieldMappingApiInstanceResponse - status-code: 200 - examples: - - query-parameters: - exclude_remote_field_metadata: true - headers: - X-Account-Token: X-Account-Token - response: - body: - Activity: - - 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 - Application: - - 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 - 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 - Candidate: - - 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 - Department: - - 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 - EEOC: - - 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 - ScheduledInterview: - - 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 - Job: - - 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 - JobPosting: - - 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 - JobInterviewStage: - - 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 - Offer: - - 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 - Office: - - 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 - RejectReason: - - 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 - Scorecard: - - 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 - Tag: - - 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 - RemoteUser: - - 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 - field_mappings_create: - path: /ats/v1/field-mappings - method: POST - auth: - - tokenAuth: [] - 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: ats_v3.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 - content-type: application/json - response: - docs: '' - type: atsRoot.FieldMappingInstanceResponse - status-code: 201 - examples: - - query-parameters: - exclude_remote_field_metadata: true - 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 - 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: /ats/v1/field-mappings/{field_mapping_id} - method: DELETE - auth: - - tokenAuth: [] - 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: ats_v3.yml - path-parameters: - field_mapping_id: string - response: - docs: '' - type: atsRoot.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 - 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: /ats/v1/field-mappings/{field_mapping_id} - method: PATCH - auth: - - tokenAuth: [] - 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: ats_v3.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 - content-type: application/json - response: - docs: '' - type: atsRoot.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 - 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: /ats/v1/remote-fields - method: GET - auth: - - tokenAuth: [] - 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: ats_v3.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: atsRoot.RemoteFieldApiResponse - status-code: 200 - examples: - - query-parameters: - common_models: common_models - include_example_values: include_example_values - headers: - X-Account-Token: X-Account-Token - response: - body: - Activity: - - 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 - Application: - - 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 - Candidate: - - 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 - Department: - - 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 - EEOC: - - 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 - ScheduledInterview: - - 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 - Job: - - 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 - JobPosting: - - 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 - JobInterviewStage: - - 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 - Offer: - - 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 - Office: - - 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 - RejectReason: - - 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 - Scorecard: - - 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 - Tag: - - 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 - RemoteUser: - - 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: /ats/v1/target-fields - method: GET - auth: - - tokenAuth: [] - 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: ats_v3.yml - response: - docs: '' - type: atsRoot.ExternalTargetFieldApiResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - Activity: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Application: - - 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 - Candidate: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Department: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - EEOC: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - ScheduledInterview: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Job: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - JobPosting: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - JobInterviewStage: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Offer: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Office: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - RejectReason: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Scorecard: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Tag: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - RemoteUser: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/forceResync.yml b/.mock/definition/ATS/forceResync.yml deleted file mode 100644 index c19f53b4d..000000000 --- a/.mock/definition/ATS/forceResync.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - sync_status_resync_create: - path: /ats/v1/sync-status/resync - method: POST - auth: - - tokenAuth: [] - 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: ats_v3.yml - response: - docs: '' - type: list - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - - model_name: Candidate - model_id: ats.Candidate - 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: ats_v3.yml diff --git a/.mock/definition/ATS/generateKey.yml b/.mock/definition/ATS/generateKey.yml deleted file mode 100644 index b9f011f38..000000000 --- a/.mock/definition/ATS/generateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ats/v1/generate-key - method: POST - auth: - - tokenAuth: [] - docs: Create a remote key. - source: - openapi: ats_v3.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: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/interviews.yml b/.mock/definition/ATS/interviews.yml deleted file mode 100644 index 9fb16f5dd..000000000 --- a/.mock/definition/ATS/interviews.yml +++ /dev/null @@ -1,521 +0,0 @@ -types: - InterviewsListRequestExpandItem: - enum: - - application - - interviewers - - job_interview_stage - - organizer - source: - openapi: ats_v3.yml - InterviewsRetrieveRequestExpandItem: - enum: - - application - - interviewers - - job_interview_stage - - organizer - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/interviews - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `ScheduledInterview` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: InterviewsListRequest - query-parameters: - application_id: - type: optional - docs: If provided, will only return interviews for this application. - 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 - allow-multiple: true - 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). - job_id: - type: optional - docs: If provided, wll only return interviews organized for this job. - job_interview_stage_id: - type: optional - docs: If provided, will only return interviews at this stage. - 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. - organizer_id: - type: optional - docs: If provided, will only return interviews organized by this user. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.PaginatedScheduledInterviewList - status-code: 200 - examples: - - query-parameters: - application_id: application_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - job_id: job_id - job_interview_stage_id: job_interview_stage_id - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - organizer_id: organizer_id - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: b8faf072-98b9-4445-8a9a-6b4950efca19 - remote_id: '3' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - application: application - job_interview_stage: job_interview_stage - organizer: organizer - interviewers: - - f9813dd5-e70b-484c-91d8-00acd6065b07 - - 89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c - location: Embarcadero Center 2 - start_at: '2021-10-15T00:00:00Z' - end_at: '2021-10-15T02:00:00Z' - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-15T00:00:00Z' - status: SCHEDULED - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /interviews - data: - - Varies by platform - create: - path: /ats/v1/interviews - method: POST - auth: - - tokenAuth: [] - docs: Creates a `ScheduledInterview` object with the given values. - source: - openapi: ats_v3.yml - request: - name: ScheduledInterviewEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: atsRoot.ScheduledInterviewRequest - remote_user_id: string - content-type: application/json - response: - docs: '' - type: atsRoot.ScheduledInterviewResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - remote_user_id: remote_user_id - response: - body: - model: - id: b8faf072-98b9-4445-8a9a-6b4950efca19 - remote_id: '3' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - application: application - job_interview_stage: job_interview_stage - organizer: organizer - interviewers: - - f9813dd5-e70b-484c-91d8-00acd6065b07 - - 89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c - location: Embarcadero Center 2 - start_at: '2021-10-15T00:00:00Z' - end_at: '2021-10-15T02:00:00Z' - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-15T00:00:00Z' - status: SCHEDULED - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /interviews - data: - - Varies by platform - 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 - retrieve: - path: /ats/v1/interviews/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `ScheduledInterview` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: InterviewsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.ScheduledInterview - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: b8faf072-98b9-4445-8a9a-6b4950efca19 - remote_id: '3' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - application: application - job_interview_stage: job_interview_stage - organizer: organizer - interviewers: - - f9813dd5-e70b-484c-91d8-00acd6065b07 - - 89a86fcf-d540-4e6b-ac3d-ce07c4ec9b3c - location: Embarcadero Center 2 - start_at: '2021-10-15T00:00:00Z' - end_at: '2021-10-15T02:00:00Z' - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-15T00:00:00Z' - status: SCHEDULED - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /interviews - data: - - Varies by platform - metaPostRetrieve: - path: /ats/v1/interviews/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `ScheduledInterview` POSTs. - source: - openapi: ats_v3.yml - response: - docs: '' - type: atsRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/issues.yml b/.mock/definition/ATS/issues.yml deleted file mode 100644 index b446519fc..000000000 --- a/.mock/definition/ATS/issues.yml +++ /dev/null @@ -1,154 +0,0 @@ -types: - IssuesListRequestStatus: - enum: - - ONGOING - - RESOLVED - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/issues - method: GET - auth: - - tokenAuth: [] - docs: Gets all issues for Organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.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: atsRoot.PaginatedIssueList - status-code: 200 - examples: - - query-parameters: - account_token: account_token - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - end_user_organization_name: end_user_organization_name - first_incident_time_after: '2024-01-15T09:30:00Z' - first_incident_time_before: '2024-01-15T09:30:00Z' - include_muted: include_muted - integration_name: integration_name - last_incident_time_after: '2024-01-15T09:30:00Z' - last_incident_time_before: '2024-01-15T09:30:00Z' - linked_account_id: linked_account_id - page_size: 1 - start_date: start_date - status: ONGOING - 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: /ats/v1/issues/{id} - method: GET - auth: - - tokenAuth: [] - docs: Get a specific issue. - source: - openapi: ats_v3.yml - path-parameters: - id: string - response: - docs: '' - type: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/jobInterviewStages.yml b/.mock/definition/ATS/jobInterviewStages.yml deleted file mode 100644 index 413ae6f94..000000000 --- a/.mock/definition/ATS/jobInterviewStages.yml +++ /dev/null @@ -1,178 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/job-interview-stages - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `JobInterviewStage` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: JobInterviewStagesListRequest - 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> - allow-multiple: true - 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). - job_id: - type: optional - docs: If provided, will only return interview stages for this job. - 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: atsRoot.PaginatedJobInterviewStageList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - job_id: job_id - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: f9813dd5-e70b-484c-91d8-00acd6065b07 - remote_id: '876556788' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Phone Screen - job: job - stage_order: 2 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /interview-stages - data: - - Varies by platform - retrieve: - path: /ats/v1/job-interview-stages/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `JobInterviewStage` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: JobInterviewStagesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: atsRoot.JobInterviewStage - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: f9813dd5-e70b-484c-91d8-00acd6065b07 - remote_id: '876556788' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Phone Screen - job: job - stage_order: 2 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /interview-stages - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/jobPostings.yml b/.mock/definition/ATS/jobPostings.yml deleted file mode 100644 index 3863a2d7b..000000000 --- a/.mock/definition/ATS/jobPostings.yml +++ /dev/null @@ -1,220 +0,0 @@ -types: - JobPostingsListRequestStatus: - enum: - - CLOSED - - DRAFT - - INTERNAL - - PENDING - - PUBLISHED - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/job-postings - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `JobPosting` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: JobPostingsListRequest - 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> - allow-multiple: true - 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. - status: - type: optional - docs: >- - If provided, will only return Job Postings with this status. - Options: ('PUBLISHED', 'CLOSED', 'DRAFT', 'INTERNAL', 'PENDING') - - - * `PUBLISHED` - PUBLISHED - - * `CLOSED` - CLOSED - - * `DRAFT` - DRAFT - - * `INTERNAL` - INTERNAL - - * `PENDING` - PENDING - response: - docs: '' - type: atsRoot.PaginatedJobPostingList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - status: CLOSED - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 156a2bef-57e5-4def-8ed2-7c41bd9a554t - remote_id: '1341324' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - title: Platform - NYC - job_posting_urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: https://merge.dev/careers - url_type: JOB_POSTING - job: job - status: PUBLISHED - content: Apply at https://merge.dev/careers - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - is_internal: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /positions - data: - - Varies by platform - retrieve: - path: /ats/v1/job-postings/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `JobPosting` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: JobPostingsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: atsRoot.JobPosting - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 156a2bef-57e5-4def-8ed2-7c41bd9a554t - remote_id: '1341324' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - title: Platform - NYC - job_posting_urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: https://merge.dev/careers - url_type: JOB_POSTING - remote_was_deleted: true - job: job - status: PUBLISHED - content: Apply at https://merge.dev/careers - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - is_internal: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /positions - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/jobs.yml b/.mock/definition/ATS/jobs.yml deleted file mode 100644 index 3c8d1a781..000000000 --- a/.mock/definition/ATS/jobs.yml +++ /dev/null @@ -1,392 +0,0 @@ -types: - JobsListRequestExpandItem: - enum: - - departments - - hiring_managers - - job_postings - - offices - - recruiters - source: - openapi: ats_v3.yml - JobsListRequestStatus: - enum: - - ARCHIVED - - CLOSED - - DRAFT - - OPEN - - PENDING - source: - openapi: ats_v3.yml - JobsRetrieveRequestExpandItem: - enum: - - departments - - hiring_managers - - job_postings - - offices - - recruiters - source: - openapi: ats_v3.yml - JobsScreeningQuestionsListRequestExpandItem: - enum: - - job - - options - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/jobs - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Job` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: JobsListRequest - query-parameters: - code: - type: optional - docs: If provided, will only return jobs with this code. - 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 - allow-multiple: true - 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. - offices: - type: optional - docs: >- - If provided, will only return jobs for this office; multiple - offices can be separated by commas. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - status: - type: optional - docs: >- - If provided, will only return jobs with this status. Options: - ('OPEN', 'CLOSED', 'DRAFT', 'ARCHIVED', 'PENDING') - - - * `OPEN` - OPEN - - * `CLOSED` - CLOSED - - * `DRAFT` - DRAFT - - * `ARCHIVED` - ARCHIVED - - * `PENDING` - PENDING - response: - docs: '' - type: atsRoot.PaginatedJobList - status-code: 200 - examples: - - query-parameters: - code: code - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - offices: offices - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - status: ARCHIVED - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 022a2bef-57e5-4def-8ed2-7c41bd9a5ed8 - remote_id: '8765432' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Software Engineer (Merge is actually hiring btw) - description: >- - If you're reading this documentation, you might be a good - fit for Merge! - code: C0025 - status: OPEN - type: POSTING - job_postings: - - 2r3c1341-a20f-4e51-b72c-f3830a16c97b - - 543ed912-33ec-444e-a215-8d71cc42fc12 - job_posting_urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: https://merge.dev/careers - url_type: JOB_POSTING - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - confidential: true - departments: - - 5b3c1341-a20f-4e51-b72c-f3830a16c97b - - d6e687d6-0c36-48a1-8114-35324b5cb38f - offices: - - 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - hiring_managers: - - 787ed912-33ec-444e-a215-8d71cc42fc12 - recruiters: - - 787ed912-33ec-444e-a215-8d71cc42fc12 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /positions - data: - - Varies by platform - retrieve: - path: /ats/v1/jobs/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Job` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: JobsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.Job - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 022a2bef-57e5-4def-8ed2-7c41bd9a5ed8 - remote_id: '8765432' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Software Engineer (Merge is actually hiring btw) - description: >- - If you're reading this documentation, you might be a good fit - for Merge! - code: C0025 - status: OPEN - type: POSTING - job_postings: - - 2r3c1341-a20f-4e51-b72c-f3830a16c97b - - 543ed912-33ec-444e-a215-8d71cc42fc12 - job_posting_urls: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - value: https://merge.dev/careers - url_type: JOB_POSTING - remote_was_deleted: true - remote_created_at: '2021-10-15T00:00:00Z' - remote_updated_at: '2021-10-16T00:00:00Z' - confidential: true - departments: - - 5b3c1341-a20f-4e51-b72c-f3830a16c97b - - d6e687d6-0c36-48a1-8114-35324b5cb38f - offices: - - 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - hiring_managers: - - 787ed912-33ec-444e-a215-8d71cc42fc12 - recruiters: - - 787ed912-33ec-444e-a215-8d71cc42fc12 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /positions - data: - - Varies by platform - screeningQuestionsList: - path: /ats/v1/jobs/{job_id}/screening-questions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `ScreeningQuestion` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - path-parameters: - job_id: string - request: - name: JobsScreeningQuestionsListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - allow-multiple: true - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: atsRoot.PaginatedScreeningQuestionList - status-code: 200 - examples: - - path-parameters: - job_id: job_id - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0238cbc6-6040-430a-848e-aaiehfhdbadf4ae - remote_id: '23729392' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - job: job - description: >- - Are you currently authorized to work for any employer in the - country outlined for this role? - title: Work Authorisation - type: DATE - required: true - options: - - remote_id: '19281' - label: I am currently authorised - - remote_id: '38372' - label: I am currently not eligible - remote_was_deleted: true - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/linkToken.yml b/.mock/definition/ATS/linkToken.yml deleted file mode 100644 index df4d0a840..000000000 --- a/.mock/definition/ATS/linkToken.yml +++ /dev/null @@ -1,155 +0,0 @@ -imports: - atsRoot: __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: - - atsRoot.LanguageEnum - - string - source: - openapi: ats_v3.yml - inline: true -service: - auth: false - base-path: '' - endpoints: - create: - path: /ats/v1/link-token - method: POST - auth: - - tokenAuth: [] - docs: Creates a link token to be used when linking a new end user. - source: - openapi: ats_v3.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: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/linkedAccounts.yml b/.mock/definition/ATS/linkedAccounts.yml deleted file mode 100644 index fec205e74..000000000 --- a/.mock/definition/ATS/linkedAccounts.yml +++ /dev/null @@ -1,169 +0,0 @@ -types: - LinkedAccountsListRequestCategory: - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/linked-accounts - method: GET - auth: - - tokenAuth: [] - docs: List linked accounts for your organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: LinkedAccountsListRequest - query-parameters: - category: - type: optional - docs: >- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, - `mktg`, `ticketing` - - - * `hris` - hris - - * `ats` - ats - - * `accounting` - accounting - - * `ticketing` - ticketing - - * `crm` - crm - - * `mktg` - mktg - - * `filestorage` - filestorage - 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: atsRoot.PaginatedAccountDetailsAndActionsList - status-code: 200 - examples: - - query-parameters: - category: accounting - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - 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: true - integration_name: integration_name - is_test_account: is_test_account - page_size: 1 - status: status - 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' - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/offers.yml b/.mock/definition/ATS/offers.yml deleted file mode 100644 index 37733768f..000000000 --- a/.mock/definition/ATS/offers.yml +++ /dev/null @@ -1,227 +0,0 @@ -types: - OffersListRequestExpandItem: - enum: - - application - - creator - source: - openapi: ats_v3.yml - OffersRetrieveRequestExpandItem: - enum: - - application - - creator - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/offers - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Offer` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: OffersListRequest - query-parameters: - application_id: - type: optional - docs: If provided, will only return offers for this application. - 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. - creator_id: - type: optional - docs: If provided, will only return offers created by this user. - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - allow-multiple: true - 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_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.PaginatedOfferList - status-code: 200 - examples: - - query-parameters: - application_id: application_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - creator_id: creator_id - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: dd85625c-6a59-446f-a317-6de64d83bae7 - remote_id: '9876' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - application: application - creator: creator - remote_created_at: '2021-10-15T00:00:00Z' - closed_at: '2021-10-16T00:00:00Z' - sent_at: '2021-10-15T00:00:00Z' - start_date: '2021-11-15T00:00:00Z' - status: DRAFT - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /offers - data: - - Varies by platform - retrieve: - path: /ats/v1/offers/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Offer` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: OffersRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.Offer - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: dd85625c-6a59-446f-a317-6de64d83bae7 - remote_id: '9876' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - application: application - creator: creator - remote_created_at: '2021-10-15T00:00:00Z' - closed_at: '2021-10-16T00:00:00Z' - sent_at: '2021-10-15T00:00:00Z' - start_date: '2021-11-15T00:00:00Z' - status: DRAFT - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /offers - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/offices.yml b/.mock/definition/ATS/offices.yml deleted file mode 100644 index 9d144f262..000000000 --- a/.mock/definition/ATS/offices.yml +++ /dev/null @@ -1,160 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/offices - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Office` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: OfficesListRequest - 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: atsRoot.PaginatedOfficeList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '876556788' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: SF Office - location: Embarcadero Center 2 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /locations - data: - - Varies by platform - retrieve: - path: /ats/v1/offices/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Office` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: OfficesRetrieveRequest - 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: atsRoot.Office - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '876556788' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: SF Office - location: Embarcadero Center 2 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /locations - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/passthrough.yml b/.mock/definition/ATS/passthrough.yml deleted file mode 100644 index 52615aad9..000000000 --- a/.mock/definition/ATS/passthrough.yml +++ /dev/null @@ -1,42 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ats/v1/passthrough - method: POST - auth: - - tokenAuth: [] - docs: Pull data from an endpoint not currently supported by Merge. - source: - openapi: ats_v3.yml - request: - body: atsRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/regenerateKey.yml b/.mock/definition/ATS/regenerateKey.yml deleted file mode 100644 index 08d64644e..000000000 --- a/.mock/definition/ATS/regenerateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ats/v1/regenerate-key - method: POST - auth: - - tokenAuth: [] - docs: Exchange remote keys. - source: - openapi: ats_v3.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: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/rejectReasons.yml b/.mock/definition/ATS/rejectReasons.yml deleted file mode 100644 index 563303a42..000000000 --- a/.mock/definition/ATS/rejectReasons.yml +++ /dev/null @@ -1,158 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/reject-reasons - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RejectReason` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: RejectReasonsListRequest - 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: atsRoot.PaginatedRejectReasonList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 8be99a4a-f8d4-4339-bf1e-30eac970e217 - remote_id: '876556788' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Not passionate enough about APIs. - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /rejection-reasons - data: - - Varies by platform - retrieve: - path: /ats/v1/reject-reasons/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `RejectReason` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: RejectReasonsRetrieveRequest - 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: atsRoot.RejectReason - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 8be99a4a-f8d4-4339-bf1e-30eac970e217 - remote_id: '876556788' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Not passionate enough about APIs. - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /rejection-reasons - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/scopes.yml b/.mock/definition/ATS/scopes.yml deleted file mode 100644 index 9fc4d12f8..000000000 --- a/.mock/definition/ATS/scopes.yml +++ /dev/null @@ -1,167 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - default_scopes_retrieve: - path: /ats/v1/default-scopes - method: GET - auth: - - tokenAuth: [] - 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: ats_v3.yml - response: - docs: '' - type: atsRoot.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: /ats/v1/linked-account-scopes - method: GET - auth: - - tokenAuth: [] - 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: ats_v3.yml - response: - docs: '' - type: atsRoot.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: /ats/v1/linked-account-scopes - method: POST - auth: - - tokenAuth: [] - 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: ats_v3.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: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/ATS/scorecards.yml b/.mock/definition/ATS/scorecards.yml deleted file mode 100644 index 5856ace67..000000000 --- a/.mock/definition/ATS/scorecards.yml +++ /dev/null @@ -1,231 +0,0 @@ -types: - ScorecardsListRequestExpandItem: - enum: - - application - - interview - - interviewer - source: - openapi: ats_v3.yml - ScorecardsRetrieveRequestExpandItem: - enum: - - application - - interview - - interviewer - source: - openapi: ats_v3.yml -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/scorecards - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Scorecard` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: ScorecardsListRequest - query-parameters: - application_id: - type: optional - docs: If provided, will only return scorecards for this application. - 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 - allow-multiple: true - 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). - interview_id: - type: optional - docs: If provided, will only return scorecards for this interview. - interviewer_id: - type: optional - docs: If provided, will only return scorecards for this interviewer. - 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_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.PaginatedScorecardList - status-code: 200 - examples: - - query-parameters: - application_id: application_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - interview_id: interview_id - interviewer_id: interviewer_id - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: overall_recommendation - remote_id: remote_id - show_enum_origins: overall_recommendation - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 3eab2f17-eeb1-450d-97f0-029d8be1e06f - remote_id: '22234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - application: application - interview: interview - interviewer: interviewer - remote_created_at: '2021-10-15T00:00:00Z' - submitted_at: '2021-10-15T00:00:00Z' - overall_recommendation: DEFINITELY_NO - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /ratings - data: - - Varies by platform - retrieve: - path: /ats/v1/scorecards/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Scorecard` object with the given `id`. - source: - openapi: ats_v3.yml - path-parameters: - id: string - request: - name: ScorecardsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.Scorecard - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: overall_recommendation - show_enum_origins: overall_recommendation - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 3eab2f17-eeb1-450d-97f0-029d8be1e06f - remote_id: '22234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - application: application - interview: interview - interviewer: interviewer - remote_created_at: '2021-10-15T00:00:00Z' - submitted_at: '2021-10-15T00:00:00Z' - overall_recommendation: DEFINITELY_NO - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /ratings - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/syncStatus.yml b/.mock/definition/ATS/syncStatus.yml deleted file mode 100644 index 6430f8d03..000000000 --- a/.mock/definition/ATS/syncStatus.yml +++ /dev/null @@ -1,64 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/sync-status - method: GET - auth: - - tokenAuth: [] - 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). - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.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: atsRoot.PaginatedSyncStatusList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - model_name: Candidate - model_id: ats.Candidate - 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: ats_v3.yml diff --git a/.mock/definition/ATS/tags.yml b/.mock/definition/ATS/tags.yml deleted file mode 100644 index 33e751f61..000000000 --- a/.mock/definition/ATS/tags.yml +++ /dev/null @@ -1,105 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/tags - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Tag` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.yml - request: - name: TagsListRequest - 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: atsRoot.PaginatedTagList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - remote_id: '4567' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: High-Priority - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /tags - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/users.yml b/.mock/definition/ATS/users.yml deleted file mode 100644 index 13abe7c91..000000000 --- a/.mock/definition/ATS/users.yml +++ /dev/null @@ -1,200 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/users - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteUser` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ats_v3.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. - email: - type: optional - docs: >- - If provided, will only return remote users with the given email - address - validation: - format: email - 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_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.PaginatedRemoteUserList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email: email - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: access_role - remote_id: remote_id - show_enum_origins: access_role - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: b82302de-852e-4e60-b050-edf9da3b7c02 - remote_id: '344321' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Shensi - last_name: Ding - email: hello@merge.dev - disabled: true - remote_created_at: '2020-11-10T00:00:00Z' - access_role: SUPER_ADMIN - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /users - data: - - Varies by platform - retrieve: - path: /ats/v1/users/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `RemoteUser` object with the given `id`. - source: - openapi: ats_v3.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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: atsRoot.RemoteUser - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: access_role - show_enum_origins: access_role - headers: - X-Account-Token: X-Account-Token - response: - body: - id: b82302de-852e-4e60-b050-edf9da3b7c02 - remote_id: '344321' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Shensi - last_name: Ding - email: hello@merge.dev - disabled: true - remote_created_at: '2020-11-10T00:00:00Z' - access_role: SUPER_ADMIN - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /users - data: - - Varies by platform - source: - openapi: ats_v3.yml diff --git a/.mock/definition/ATS/webhookReceivers.yml b/.mock/definition/ATS/webhookReceivers.yml deleted file mode 100644 index b65ab6cc9..000000000 --- a/.mock/definition/ATS/webhookReceivers.yml +++ /dev/null @@ -1,65 +0,0 @@ -imports: - atsRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ats/v1/webhook-receivers - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `WebhookReceiver` objects. - source: - openapi: ats_v3.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: /ats/v1/webhook-receivers - method: POST - auth: - - tokenAuth: [] - docs: Creates a `WebhookReceiver` object with the given values. - source: - openapi: ats_v3.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: atsRoot.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: ats_v3.yml diff --git a/.mock/definition/Accounting/__package__.yml b/.mock/definition/Accounting/__package__.yml deleted file mode 100644 index 231b8311f..000000000 --- a/.mock/definition/Accounting/__package__.yml +++ /dev/null @@ -1,52736 +0,0 @@ -types: - AccountClassification: - discriminated: false - docs: |- - The account's broadest grouping. - - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - union: - - ClassificationEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountAccountType: - discriminated: false - docs: >- - Normalized account type- which is a narrower and more specific grouping - within the account's classification. - - - * `BANK` - BANK - - * `CREDIT_CARD` - CREDIT_CARD - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - - * `FIXED_ASSET` - FIXED_ASSET - - * `OTHER_ASSET` - OTHER_ASSET - - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - - * `OTHER_EXPENSE` - OTHER_EXPENSE - - * `OTHER_INCOME` - OTHER_INCOME - - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - - * `NON_POSTING` - NON_POSTING - union: - - AccountAccountTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountStatus: - discriminated: false - docs: |- - The account's status. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - union: - - AccountStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountCurrency: - discriminated: false - docs: >- - The account's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - Account: - docs: >- - # The Account Object - - ### Description - - An `Account` represents a category in a company’s ledger in which a - financial transaction is recorded against. The aggregation of each - `Account` object is often referred to as the **Chart of Accounts**. - - - An `Account` can be classified into one of the following categories, - determined through the `classification` field: - - * __Asset:__ Accounts Receivable and Bank Accounts - - * __Liability:__ Accounts Payable and Credit Card Accounts - - * __Equity:__ Treasury Accounts and Retained Earnings - - * __Revenue:__ Income and Other Income - - * __Expense:__ Cost of Goods Sold and Office Expenses - - - ### Usage Example - - Fetch from the `LIST Accounts` endpoint and view a company's accounts. - 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 account's name. - description: - type: optional - docs: The account's description. - classification: - type: optional - docs: |- - The account's broadest grouping. - - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - type: - type: optional - docs: >- - The account's type is a narrower and more specific grouping within the - account's classification. - account_type: - type: optional - docs: >- - Normalized account type- which is a narrower and more specific - grouping within the account's classification. - - - * `BANK` - BANK - - * `CREDIT_CARD` - CREDIT_CARD - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - - * `FIXED_ASSET` - FIXED_ASSET - - * `OTHER_ASSET` - OTHER_ASSET - - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - - * `OTHER_EXPENSE` - OTHER_EXPENSE - - * `OTHER_INCOME` - OTHER_INCOME - - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - - * `NON_POSTING` - NON_POSTING - status: - type: optional - docs: |- - The account's status. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - current_balance: - type: optional - docs: The account's current balance. - currency: - type: optional - docs: >- - The account's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - account_number: - type: optional - docs: The account's number. - parent_account: - type: optional - docs: ID of the parent account. - validation: - format: uuid - company: - type: optional - docs: The company the account belongs to. - validation: - format: uuid - 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: accounting_v3.yml - AccountAccountTypeEnum: - enum: - - BANK - - CREDIT_CARD - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - - FIXED_ASSET - - OTHER_ASSET - - OTHER_CURRENT_ASSET - - OTHER_EXPENSE - - OTHER_INCOME - - COST_OF_GOODS_SOLD - - OTHER_CURRENT_LIABILITY - - LONG_TERM_LIABILITY - - NON_POSTING - docs: |- - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `FIXED_ASSET` - FIXED_ASSET - * `OTHER_ASSET` - OTHER_ASSET - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - * `OTHER_EXPENSE` - OTHER_EXPENSE - * `OTHER_INCOME` - OTHER_INCOME - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - * `NON_POSTING` - NON_POSTING - source: - openapi: accounting_v3.yml - 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: accounting_v3.yml - AccountDetailsAndActionsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountDetailsAndActionsStatus: - discriminated: false - union: - - AccountDetailsAndActionsStatusEnum - - string - source: - openapi: accounting_v3.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 - source: - openapi: accounting_v3.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: accounting_v3.yml - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - docs: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - source: - openapi: accounting_v3.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: accounting_v3.yml - AccountRequestClassification: - discriminated: false - docs: |- - The account's broadest grouping. - - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - union: - - ClassificationEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountRequestAccountType: - discriminated: false - docs: >- - Normalized account type- which is a narrower and more specific grouping - within the account's classification. - - - * `BANK` - BANK - - * `CREDIT_CARD` - CREDIT_CARD - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - - * `FIXED_ASSET` - FIXED_ASSET - - * `OTHER_ASSET` - OTHER_ASSET - - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - - * `OTHER_EXPENSE` - OTHER_EXPENSE - - * `OTHER_INCOME` - OTHER_INCOME - - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - - * `NON_POSTING` - NON_POSTING - union: - - AccountAccountTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountRequestStatus: - discriminated: false - docs: |- - The account's status. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - union: - - AccountStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountRequestCurrency: - discriminated: false - docs: >- - The account's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountRequest: - docs: >- - # The Account Object - - ### Description - - An `Account` represents a category in a company’s ledger in which a - financial transaction is recorded against. The aggregation of each - `Account` object is often referred to as the **Chart of Accounts**. - - - An `Account` can be classified into one of the following categories, - determined through the `classification` field: - - * __Asset:__ Accounts Receivable and Bank Accounts - - * __Liability:__ Accounts Payable and Credit Card Accounts - - * __Equity:__ Treasury Accounts and Retained Earnings - - * __Revenue:__ Income and Other Income - - * __Expense:__ Cost of Goods Sold and Office Expenses - - - ### Usage Example - - Fetch from the `LIST Accounts` endpoint and view a company's accounts. - properties: - name: - type: optional - docs: The account's name. - description: - type: optional - docs: The account's description. - classification: - type: optional - docs: |- - The account's broadest grouping. - - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - type: - type: optional - docs: >- - The account's type is a narrower and more specific grouping within the - account's classification. - account_type: - type: optional - docs: >- - Normalized account type- which is a narrower and more specific - grouping within the account's classification. - - - * `BANK` - BANK - - * `CREDIT_CARD` - CREDIT_CARD - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - - * `FIXED_ASSET` - FIXED_ASSET - - * `OTHER_ASSET` - OTHER_ASSET - - * `OTHER_CURRENT_ASSET` - OTHER_CURRENT_ASSET - - * `OTHER_EXPENSE` - OTHER_EXPENSE - - * `OTHER_INCOME` - OTHER_INCOME - - * `COST_OF_GOODS_SOLD` - COST_OF_GOODS_SOLD - - * `OTHER_CURRENT_LIABILITY` - OTHER_CURRENT_LIABILITY - - * `LONG_TERM_LIABILITY` - LONG_TERM_LIABILITY - - * `NON_POSTING` - NON_POSTING - status: - type: optional - docs: |- - The account's status. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - current_balance: - type: optional - docs: The account's current balance. - currency: - type: optional - docs: >- - The account's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - account_number: - type: optional - docs: The account's number. - parent_account: - type: optional - docs: ID of the parent account. - validation: - format: uuid - company: - type: optional - docs: The company the account belongs to. - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - AccountResponse: - properties: - model: Account - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - AccountStatusEnum: - enum: - - ACTIVE - - PENDING - - INACTIVE - docs: |- - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - source: - openapi: accounting_v3.yml - AccountToken: - properties: - account_token: string - integration: AccountIntegration - id: string - source: - openapi: accounting_v3.yml - AccountingAttachment: - docs: >- - # The Accounting Attachment Object - - ### Description - - The `AccountingAttachment` object is used to represent a company's - attachments. - - - ### Usage Example - - Fetch from the `LIST AccountingAttachments` endpoint and view a company's - 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 - file_name: - type: optional - docs: The attachment's name. - file_url: - type: optional - docs: The attachment's url. - validation: - format: uri - maxLength: 2000 - company: - type: optional - docs: The company the accounting attachment belongs to. - validation: - format: uuid - 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: accounting_v3.yml - AccountingAttachmentRequest: - docs: >- - # The Accounting Attachment Object - - ### Description - - The `AccountingAttachment` object is used to represent a company's - attachments. - - - ### Usage Example - - Fetch from the `LIST AccountingAttachments` endpoint and view a company's - attachments. - properties: - file_name: - type: optional - docs: The attachment's name. - file_url: - type: optional - docs: The attachment's url. - validation: - format: uri - maxLength: 2000 - company: - type: optional - docs: The company the accounting attachment belongs to. - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - AccountingAttachmentResponse: - properties: - model: AccountingAttachment - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - AccountingPeriodStatus: - discriminated: false - union: - - Status895Enum - - string - source: - openapi: accounting_v3.yml - inline: true - AccountingPeriod: - docs: >- - # The AccountingPeriod Object - - ### Description - - The `AccountingPeriod` object is used to define a period of time in which - events occurred. - - - ### Usage Example - - Common models like `Invoice` and `Transaction` will have - `AccountingPeriod` objects which will denote when they occurred. - 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 accounting period. - validation: - maxLength: 100 - status: optional - start_date: - type: optional - docs: Beginning date of the period - end_date: - type: optional - docs: End date of the period - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - AccountingPhoneNumber: - docs: >- - # The AccountingPhoneNumber Object - - ### Description - - The `AccountingPhoneNumber` object is used to represent a contact's or - company's phone number. - - - ### Usage Example - - Fetch from the `GET CompanyInfo` endpoint and view the company's phone - numbers. - properties: - 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 - number: - type: optional - docs: The phone number. - type: - type: optional - docs: The phone number's type. - source: - openapi: accounting_v3.yml - AccountingPhoneNumberRequest: - docs: >- - # The AccountingPhoneNumber Object - - ### Description - - The `AccountingPhoneNumber` object is used to represent a contact's or - company's phone number. - - - ### Usage Example - - Fetch from the `GET CompanyInfo` endpoint and view the company's phone - numbers. - properties: - number: - type: optional - docs: The phone number. - type: - type: optional - docs: The phone number's type. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - AddressType: - discriminated: false - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - union: - - AddressTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AddressCountry: - discriminated: false - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - union: - - CountryEnum - - string - source: - openapi: accounting_v3.yml - inline: true - Address: - docs: >- - # The Address Object - - ### Description - - The `Address` object is used to represent a contact's or company's - address. - - - ### Usage Example - - Fetch from the `GET CompanyInfo` endpoint and view the company's - addresses. - properties: - 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 - type: - type: optional - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - street_1: - type: optional - docs: Line 1 of the address's street. - street_2: - type: optional - docs: Line 2 of the address's street. - city: - type: optional - docs: The address's city. - state: - type: optional - access: read-only - country_subdivision: - type: optional - docs: The address's state or region. - country: - type: optional - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - zip_code: - type: optional - docs: The address's zip code. - source: - openapi: accounting_v3.yml - AddressRequestType: - discriminated: false - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - union: - - AddressTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AddressRequestCountry: - discriminated: false - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - union: - - CountryEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AddressRequest: - docs: >- - # The Address Object - - ### Description - - The `Address` object is used to represent a contact's or company's - address. - - - ### Usage Example - - Fetch from the `GET CompanyInfo` endpoint and view the company's - addresses. - properties: - type: - type: optional - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - street_1: - type: optional - docs: Line 1 of the address's street. - street_2: - type: optional - docs: Line 2 of the address's street. - city: - type: optional - docs: The address's city. - country_subdivision: - type: optional - docs: The address's state or region. - country: - type: optional - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - zip_code: - type: optional - docs: The address's zip code. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - AddressTypeEnum: - enum: - - BILLING - - SHIPPING - docs: |- - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - source: - openapi: accounting_v3.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: accounting_v3.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid - source: - openapi: accounting_v3.yml - AsyncPostTaskStatus: - discriminated: false - union: - - AsyncPostTaskStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - AsyncPostTask: - properties: - status: AsyncPostTaskStatus - result: AsyncPostTaskResult - source: - openapi: accounting_v3.yml - AsyncPostTaskResult: - properties: - status_code: optional - response: optional> - source: - openapi: accounting_v3.yml - AsyncPostTaskStatusEnum: - enum: - - QUEUED - - IN_PROGRESS - - COMPLETED - - FAILURE - docs: |- - * `QUEUED` - QUEUED - * `IN_PROGRESS` - IN_PROGRESS - * `COMPLETED` - COMPLETED - * `FAILURE` - FAILURE - source: - openapi: accounting_v3.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: accounting_v3.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: accounting_v3.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: accounting_v3.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: accounting_v3.yml - BalanceSheetCurrency: - discriminated: false - docs: >- - The balance sheet's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BalanceSheetCompany: - discriminated: false - docs: '`Company` object for the given `BalanceSheet` object.' - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - BalanceSheet: - docs: >- - # The BalanceSheet Object - - ### Description - - The `BalanceSheet` object shows a company’s assets, liabilities, and - equity. Assets should be equal to liability and equity combined. This - shows the company’s financial health at a specific point in time. - - - ### Usage Example - - Fetch from the `LIST BalanceSheets` endpoint and view a company's balance - sheets. - 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 balance sheet's name. - currency: - type: optional - docs: >- - The balance sheet's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - company: - type: optional - docs: '`Company` object for the given `BalanceSheet` object.' - date: - type: optional - docs: >- - The balance sheet's date. The balance sheet data will reflect the - company's financial position this point in time. - net_assets: - type: optional - docs: The balance sheet's net assets. - assets: - type: optional> - access: read-only - liabilities: - type: optional> - access: read-only - equity: - type: optional> - access: read-only - remote_generated_at: - type: optional - docs: The time that balance sheet was generated by the accounting system. - 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: accounting_v3.yml - BankFeedAccountCurrency: - discriminated: false - docs: >- - The currency code of the bank feed. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedAccountFeedStatus: - discriminated: false - docs: |- - The status of the bank feed. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - union: - - FeedStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedAccountAccountType: - discriminated: false - docs: |- - The type of the account. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - union: - - BankFeedAccountAccountTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedAccount: - docs: >- - # The BankFeedAccount Object - - ### Description - - The `BankFeedAccount` object represents a bank feed account, detailing - various attributes including account identifiers, names, currency, and - balance information. This object is central to managing and tracking bank - feed accounts within the system. - - - ### Usage Example - - Fetch from the `GET BankFeedAccount` endpoint to view details of a bank - feed account. - 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 - source_account_id: - type: optional - docs: >- - The unique identifier of the source account from our customer’s - platform. - validation: - maxLength: 1024 - target_account_id: - type: optional - docs: >- - The unique identifier of the target account from the third party - software. - validation: - maxLength: 1024 - source_account_name: - type: optional - docs: The name of the source account as stored in our customer’s platform. - validation: - maxLength: 1024 - source_account_number: - type: optional - docs: >- - The human-readable account number of the source account as stored in - our customer’s platform. - validation: - maxLength: 1024 - target_account_name: - type: optional - docs: The name of the target account from the third party software. - validation: - maxLength: 1024 - currency: - type: optional - docs: >- - The currency code of the bank feed. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - feed_status: - type: optional - docs: |- - The status of the bank feed. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - feed_start_date: - type: optional - docs: The start date of the bank feed’s transactions. - source_account_balance: - type: optional - docs: The current balance of funds in the source account. - account_type: - type: optional - docs: |- - The type of the account. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: optional>>> - source: - openapi: accounting_v3.yml - BankFeedAccountAccountTypeEnum: - enum: - - BANK - - CREDIT_CARD - docs: |- - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - source: - openapi: accounting_v3.yml - BankFeedAccountRequestCurrency: - discriminated: false - docs: >- - The currency code of the bank feed. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedAccountRequestFeedStatus: - discriminated: false - docs: |- - The status of the bank feed. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - union: - - FeedStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedAccountRequestAccountType: - discriminated: false - docs: |- - The type of the account. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - union: - - BankFeedAccountAccountTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedAccountRequest: - docs: >- - # The BankFeedAccount Object - - ### Description - - The `BankFeedAccount` object represents a bank feed account, detailing - various attributes including account identifiers, names, currency, and - balance information. This object is central to managing and tracking bank - feed accounts within the system. - - - ### Usage Example - - Fetch from the `GET BankFeedAccount` endpoint to view details of a bank - feed account. - properties: - source_account_id: - type: optional - docs: >- - The unique identifier of the source account from our customer’s - platform. - validation: - maxLength: 1024 - target_account_id: - type: optional - docs: >- - The unique identifier of the target account from the third party - software. - validation: - maxLength: 1024 - source_account_name: - type: optional - docs: The name of the source account as stored in our customer’s platform. - validation: - maxLength: 1024 - source_account_number: - type: optional - docs: >- - The human-readable account number of the source account as stored in - our customer’s platform. - validation: - maxLength: 1024 - target_account_name: - type: optional - docs: The name of the target account from the third party software. - validation: - maxLength: 1024 - currency: - type: optional - docs: >- - The currency code of the bank feed. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - feed_status: - type: optional - docs: |- - The status of the bank feed. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - feed_start_date: - type: optional - docs: The start date of the bank feed’s transactions. - source_account_balance: - type: optional - docs: The current balance of funds in the source account. - account_type: - type: optional - docs: |- - The type of the account. - - * `BANK` - BANK - * `CREDIT_CARD` - CREDIT_CARD - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - BankFeedAccountResponse: - properties: - model: BankFeedAccount - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - BankFeedTransactionBankFeedAccount: - discriminated: false - docs: The bank feed account associated with the transaction. - union: - - type: string - validation: - format: uuid - - BankFeedAccount - source: - openapi: accounting_v3.yml - inline: true - BankFeedTransactionCreditOrDebit: - discriminated: false - docs: |- - If the transaction is of type debit or credit. - - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - union: - - CreditOrDebitEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedTransaction: - docs: >- - # The BankFeedTransaction Object - - ### Description - - The `BankFeedTransaction` object is used to represent transactions linked - to a bank feed account. This includes details about the transaction such - as the date, amount, description, and type. - - - ### Usage Example - - Fetch from the `GET BankFeedTransaction` endpoint to view details of a - transaction associated with a bank feed account. - 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 - bank_feed_account: - type: optional - docs: The bank feed account associated with the transaction. - transaction_date: - type: optional - docs: The date that the transaction occurred. - posted_date: - type: optional - docs: The date the transaction was posted to the bank account. - amount: - type: optional - docs: The amount of the transaction. - description: - type: optional - docs: The description of the transaction. - validation: - maxLength: 1024 - transaction_type: - type: optional - docs: The underlying type of the transaction. - validation: - maxLength: 1024 - payee: - type: optional - docs: >- - The person or merchant who initiated the transaction, or - alternatively, to whom the transaction was paid. - validation: - maxLength: 1024 - credit_or_debit: - type: optional - docs: |- - If the transaction is of type debit or credit. - - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - source_transaction_id: - type: optional - docs: The customer’s identifier for the transaction. - validation: - maxLength: 1024 - 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 - is_processed: - type: optional - docs: >- - Whether or not this transaction has been processed by the external - system. For example, NetSuite writes this field as True when the - SuiteApp has processed the transaction. - access: read-only - source: - openapi: accounting_v3.yml - BankFeedTransactionRequestRequestBankFeedAccount: - discriminated: false - docs: The bank feed account associated with the transaction. - union: - - type: string - validation: - format: uuid - - BankFeedAccount - source: - openapi: accounting_v3.yml - inline: true - BankFeedTransactionRequestRequestCreditOrDebit: - discriminated: false - docs: |- - If the transaction is of type debit or credit. - - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - union: - - CreditOrDebitEnum - - string - source: - openapi: accounting_v3.yml - inline: true - BankFeedTransactionRequestRequest: - docs: >- - # The BankFeedTransaction Object - - ### Description - - The `BankFeedTransaction` object is used to represent transactions linked - to a bank feed account. This includes details about the transaction such - as the date, amount, description, and type. - - - ### Usage Example - - Fetch from the `GET BankFeedTransaction` endpoint to view details of a - transaction associated with a bank feed account. - properties: - bank_feed_account: - type: optional - docs: The bank feed account associated with the transaction. - transaction_date: - type: optional - docs: The date that the transaction occurred. - posted_date: - type: optional - docs: The date the transaction was posted to the bank account. - amount: - type: optional - docs: The amount of the transaction. - description: - type: optional - docs: The description of the transaction. - validation: - maxLength: 1024 - transaction_type: - type: optional - docs: The underlying type of the transaction. - validation: - maxLength: 1024 - payee: - type: optional - docs: >- - The person or merchant who initiated the transaction, or - alternatively, to whom the transaction was paid. - validation: - maxLength: 1024 - credit_or_debit: - type: optional - docs: |- - If the transaction is of type debit or credit. - - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - source_transaction_id: - type: optional - docs: The customer’s identifier for the transaction. - validation: - maxLength: 1024 - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - BankFeedTransactionResponse: - properties: - model: BankFeedTransaction - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - CashFlowStatementCurrency: - discriminated: false - docs: >- - The cash flow statement's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - CashFlowStatementCompany: - discriminated: false - docs: The company the cash flow statement belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - CashFlowStatement: - docs: >- - # The CashFlowStatement Object - - ### Description - - The `CashFlowStatement` object shows operating activities, investing - activities, and financing activities over a period of time (month, - quarter, or year). - - - ### Usage Example - - Fetch from the `LIST CashFlowStatements` endpoint and view a company's - cash flow statements. - 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 cash flow statement's name. - currency: - type: optional - docs: >- - The cash flow statement's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - company: - type: optional - docs: The company the cash flow statement belongs to. - start_period: - type: optional - docs: The cash flow statement's start period. - end_period: - type: optional - docs: The cash flow statement's end period. - cash_at_beginning_of_period: - type: optional - docs: >- - Cash and cash equivalents at the beginning of the cash flow - statement's period. - cash_at_end_of_period: - type: optional - docs: >- - Cash and cash equivalents at the beginning of the cash flow - statement's period. - operating_activities: - type: optional> - access: read-only - investing_activities: - type: optional> - access: read-only - financing_activities: - type: optional> - access: read-only - remote_generated_at: - type: optional - docs: >- - The time that cash flow statement was generated by the accounting - system. - 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: accounting_v3.yml - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: accounting_v3.yml - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: accounting_v3.yml - CategoryTypeEnum: - enum: - - CLASS - - DEPARTMENT - docs: |- - * `CLASS` - CLASS - * `DEPARTMENT` - DEPARTMENT - source: - openapi: accounting_v3.yml - ClassificationEnum: - enum: - - ASSET - - EQUITY - - EXPENSE - - LIABILITY - - REVENUE - docs: |- - * `ASSET` - ASSET - * `EQUITY` - EQUITY - * `EXPENSE` - EXPENSE - * `LIABILITY` - LIABILITY - * `REVENUE` - REVENUE - source: - openapi: accounting_v3.yml - CommonModelScopeApi: - properties: - common_models: - docs: The common models you want to update the scopes for - type: list - source: - openapi: accounting_v3.yml - CommonModelScopesBodyRequest: - properties: - model_id: - type: string - validation: - minLength: 1 - enabled_actions: list - disabled_fields: list - source: - openapi: accounting_v3.yml - CompanyInfo: - docs: >- - # The CompanyInfo Object - - ### Description - - The `CompanyInfo` object contains information about the company of the - linked account. If the company has multiple entities (also known as - subsidiaries), each entity may show up as a single `CompanyInfo` record. - - - ### Usage Example - - Fetch from the `GET CompanyInfo` endpoint and view a company's - information. - 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 company's name. - legal_name: - type: optional - docs: The company's legal name. - tax_number: - type: optional - docs: The company's tax number. - fiscal_year_end_month: - type: optional - docs: The company's fiscal year end month. - validation: - min: 1 - max: 12 - fiscal_year_end_day: - type: optional - docs: The company's fiscal year end day. - validation: - min: 1 - max: 31 - currency: optional - remote_created_at: - type: optional - docs: When the third party's company was created. - urls: - type: optional>> - docs: The company's urls. - addresses: optional> - phone_numbers: 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: accounting_v3.yml - ComponentTypeEnum: - enum: - - SALES - - PURCHASE - docs: |- - * `SALES` - SALES - * `PURCHASE` - PURCHASE - source: - openapi: accounting_v3.yml - ContactStatus: - discriminated: false - docs: |- - The contact's status - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - union: - - Status7D1Enum - - string - source: - openapi: accounting_v3.yml - inline: true - ContactAddressesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Address - source: - openapi: accounting_v3.yml - inline: true - Contact: - docs: >- - # The Contact Object - - ### Description - - A `Contact` is an individual or business entity to which products and - services are sold to or purchased from. The `Contact` model contains both - Customers, in which products and services are sold to, and Vendors (or - Suppliers), in which products and services are purchased from. - - * A `Contact` is a Vendor/Supplier if the `is_supplier` property is true. - - * A `Contact` is a customer if the `is_customer` property is true. - - - ### Usage Example - - Fetch from the `LIST Contacts` endpoint and view a company's contacts. - 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 contact's name. - is_supplier: - type: optional - docs: Whether the contact is a supplier. - is_customer: - type: optional - docs: Whether the contact is a customer. - email_address: - type: optional - docs: The contact's email address. - tax_number: - type: optional - docs: The contact's tax number. - status: - type: optional - docs: |- - The contact's status - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - currency: - type: optional - docs: The currency the contact's transactions are in. - remote_updated_at: - type: optional - docs: When the third party's contact was updated. - company: - type: optional - docs: The company the contact belongs to. - validation: - format: uuid - addresses: - type: optional>> - docs: '`Address` object IDs for the given `Contacts` object.' - phone_numbers: - type: optional> - docs: '`AccountingPhoneNumber` object for the given `Contacts` object.' - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - ContactRequestStatus: - discriminated: false - docs: |- - The contact's status - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - union: - - Status7D1Enum - - string - source: - openapi: accounting_v3.yml - inline: true - ContactRequestAddressesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Address - source: - openapi: accounting_v3.yml - inline: true - ContactRequest: - docs: >- - # The Contact Object - - ### Description - - A `Contact` is an individual or business entity to which products and - services are sold to or purchased from. The `Contact` model contains both - Customers, in which products and services are sold to, and Vendors (or - Suppliers), in which products and services are purchased from. - - * A `Contact` is a Vendor/Supplier if the `is_supplier` property is true. - - * A `Contact` is a customer if the `is_customer` property is true. - - - ### Usage Example - - Fetch from the `LIST Contacts` endpoint and view a company's contacts. - properties: - name: - type: optional - docs: The contact's name. - is_supplier: - type: optional - docs: Whether the contact is a supplier. - is_customer: - type: optional - docs: Whether the contact is a customer. - email_address: - type: optional - docs: The contact's email address. - tax_number: - type: optional - docs: The contact's tax number. - status: - type: optional - docs: |- - The contact's status - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - currency: - type: optional - docs: The currency the contact's transactions are in. - company: - type: optional - docs: The company the contact belongs to. - validation: - format: uuid - addresses: - type: optional>> - docs: '`Address` object IDs for the given `Contacts` object.' - phone_numbers: - type: optional> - docs: '`AccountingPhoneNumber` object for the given `Contacts` object.' - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - ContactResponse: - properties: - model: Contact - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - CountryEnum: - enum: - - AF - - AX - - AL - - DZ - - AS - - AD - - AO - - AI - - AQ - - AG - - AR - - AM - - AW - - AU - - AT - - AZ - - BS - - BH - - BD - - BB - - BY - - BE - - BZ - - BJ - - BM - - BT - - BO - - BQ - - BA - - BW - - BV - - BR - - IO - - BN - - BG - - BF - - BI - - CV - - KH - - CM - - CA - - KY - - CF - - TD - - CL - - CN - - CX - - CC - - CO - - KM - - CG - - CD - - CK - - CR - - CI - - HR - - CU - - CW - - CY - - CZ - - DK - - DJ - - DM - - DO - - EC - - EG - - SV - - GQ - - ER - - EE - - SZ - - ET - - FK - - FO - - FJ - - FI - - FR - - GF - - PF - - TF - - GA - - GM - - GE - - DE - - GH - - GI - - GR - - GL - - GD - - GP - - GU - - GT - - GG - - GN - - GW - - GY - - HT - - HM - - VA - - HN - - HK - - HU - - IS - - IN - - ID - - IR - - IQ - - IE - - IM - - IL - - IT - - JM - - JP - - JE - - JO - - KZ - - KE - - KI - - KW - - KG - - LA - - LV - - LB - - LS - - LR - - LY - - LI - - LT - - LU - - MO - - MG - - MW - - MY - - MV - - ML - - MT - - MH - - MQ - - MR - - MU - - YT - - MX - - FM - - MD - - MC - - MN - - ME - - MS - - MA - - MZ - - MM - - NA - - NR - - NP - - NL - - NC - - NZ - - NI - - NE - - NG - - NU - - NF - - KP - - MK - - MP - - 'NO' - - OM - - PK - - PW - - PS - - PA - - PG - - PY - - PE - - PH - - PN - - PL - - PT - - PR - - QA - - RE - - RO - - RU - - RW - - BL - - SH - - KN - - LC - - MF - - PM - - VC - - WS - - SM - - ST - - SA - - SN - - RS - - SC - - SL - - SG - - SX - - SK - - SI - - SB - - SO - - ZA - - GS - - KR - - SS - - ES - - LK - - SD - - SR - - SJ - - SE - - CH - - SY - - TW - - TJ - - TZ - - TH - - TL - - TG - - TK - - TO - - TT - - TN - - TR - - TM - - TC - - TV - - UG - - UA - - AE - - GB - - UM - - US - - UY - - UZ - - VU - - VE - - VN - - VG - - VI - - WF - - EH - - YE - - ZM - - ZW - docs: |- - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - source: - openapi: accounting_v3.yml - CreditNoteStatus: - discriminated: false - docs: |- - The credit note's status. - - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - union: - - CreditNoteStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - CreditNoteContact: - discriminated: false - docs: The credit note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - CreditNoteCompany: - discriminated: false - docs: The company the credit note belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - CreditNoteTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - CreditNoteCurrency: - discriminated: false - docs: >- - The credit note's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - CreditNotePaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: accounting_v3.yml - inline: true - CreditNoteAppliedPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItem - source: - openapi: accounting_v3.yml - inline: true - CreditNoteAccountingPeriod: - discriminated: false - docs: The accounting period that the CreditNote was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - CreditNote: - docs: >- - # The CreditNote Object - - ### Description - - A `CreditNote` is transaction issued to a customer, indicating a reduction - or cancellation of the amount owed by the customer. It is most generally - used as an adjustment note used to rectify errors, returns, or - overpayments related to a sales transaction. A `CreditNote` can be applied - to *Accounts Receivable* Invoices to decrease the overall amount of the - Invoice. - - - ### Usage Example - - Fetch from the `LIST CreditNotes` endpoint and view a company's credit - notes. - 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 - transaction_date: - type: optional - docs: The credit note's transaction date. - status: - type: optional - docs: |- - The credit note's status. - - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - number: - type: optional - docs: The credit note's number. - contact: - type: optional - docs: The credit note's contact. - company: - type: optional - docs: The company the credit note belongs to. - exchange_rate: - type: optional - docs: The credit note's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - total_amount: - type: optional - docs: The credit note's total amount. - remaining_credit: - type: optional - docs: >- - The amount of value remaining in the credit note that the customer can - use. - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - line_items: - type: optional> - access: read-only - tracking_categories: optional>> - currency: - type: optional - docs: >- - The credit note's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - remote_created_at: - type: optional - docs: When the third party's credit note was created. - remote_updated_at: - type: optional - docs: When the third party's credit note was updated. - payments: - type: optional>> - docs: Array of `Payment` object IDs - applied_payments: - type: optional>> - docs: >- - A list of the Payment Applied to Lines common models related to a - given Invoice, Credit Note, or Journal Entry. - accounting_period: - type: optional - docs: The accounting period that the CreditNote was generated in. - applied_to_lines: - type: optional> - docs: >- - A list of the CreditNote Applied to Lines common models related to a - given Credit Note - 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: accounting_v3.yml - CreditNoteApplyLineForCreditNoteInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: accounting_v3.yml - inline: true - CreditNoteApplyLineForCreditNote: - docs: >- - # The CreditNoteApplyLine Object - - ### Description - - The `CreditNoteApplyLine` is attached to the CreditNote model. - - - ### Usage Example - - Fetch from the `GET CreditNote` endpoint and view the invoice's applied to - lines. - properties: - 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 - invoice: optional - applied_date: - type: optional - docs: Date that the credit note is applied to the invoice. - applied_amount: - type: optional - docs: The amount of the Credit Note applied to the invoice. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - 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 - source: - openapi: accounting_v3.yml - CreditNoteApplyLineForCreditNoteRequestInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: accounting_v3.yml - inline: true - CreditNoteApplyLineForCreditNoteRequest: - docs: >- - # The CreditNoteApplyLine Object - - ### Description - - The `CreditNoteApplyLine` is attached to the CreditNote model. - - - ### Usage Example - - Fetch from the `GET CreditNote` endpoint and view the invoice's applied to - lines. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - invoice: optional - applied_date: - type: optional - docs: Date that the credit note is applied to the invoice. - applied_amount: - type: optional - docs: The amount of the Credit Note applied to the invoice. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - CreditNoteApplyLineForInvoiceCreditNote: - discriminated: false - union: - - type: string - validation: - format: uuid - - CreditNote - source: - openapi: accounting_v3.yml - inline: true - CreditNoteApplyLineForInvoice: - docs: >- - # The CreditNoteApplyLine Object - - ### Description - - The `CreditNoteApplyLine` is attached to the CreditNote model. - - - ### Usage Example - - Fetch from the `GET CreditNote` endpoint and view the invoice's applied to - lines. - properties: - 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 - credit_note: optional - applied_date: - type: optional - docs: Date that the credit note is applied to the invoice. - applied_amount: - type: optional - docs: The amount of the Credit Note applied to the invoice. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - 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 - source: - openapi: accounting_v3.yml - CreditNoteLineItemItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItemCompany: - discriminated: false - docs: The company the credit note belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItemContact: - discriminated: false - docs: The credit note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItemProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItem: - docs: >- - # The CreditNoteLineItem Object - - ### Description - - The `CreditNoteLineItem` object is used to represent a credit note's line - items. - - - ### Usage Example - - Fetch from the `GET CreditNote` endpoint and view the credit note's line - items. - 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 - item: optional - name: - type: optional - docs: The credit note line item's name. - description: - type: optional - docs: The description of the item that is owed. - quantity: - type: optional - docs: The credit note line item's quantity. - validation: - pattern: ^-?\d{0,24}(?:\.\d{0,8})?$ - memo: - type: optional - docs: The credit note line item's memo. - unit_price: - type: optional - docs: The credit note line item's unit price. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - total_line_amount: - type: optional - docs: The credit note line item's total. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tracking_category: - type: optional - docs: The credit note line item's associated tracking category. - validation: - format: uuid - availability: deprecated - tracking_categories: - type: optional>> - docs: The credit note line item's associated tracking categories. - account: - type: optional - docs: The credit note line item's account. - validation: - format: uuid - company: - type: optional - docs: The company the credit note belongs to. - contact: - type: optional - docs: The credit note's contact. - project: 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 - source: - openapi: accounting_v3.yml - CreditNoteLineItemRequestItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItemRequestCompany: - discriminated: false - docs: The company the credit note belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItemRequestContact: - discriminated: false - docs: The credit note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItemRequestProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - CreditNoteLineItemRequest: - docs: >- - # The CreditNoteLineItem Object - - ### Description - - The `CreditNoteLineItem` object is used to represent a credit note's line - items. - - - ### Usage Example - - Fetch from the `GET CreditNote` endpoint and view the credit note's line - items. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - item: optional - name: - type: optional - docs: The credit note line item's name. - description: - type: optional - docs: The description of the item that is owed. - quantity: - type: optional - docs: The credit note line item's quantity. - validation: - pattern: ^-?\d{0,24}(?:\.\d{0,8})?$ - memo: - type: optional - docs: The credit note line item's memo. - unit_price: - type: optional - docs: The credit note line item's unit price. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - total_line_amount: - type: optional - docs: The credit note line item's total. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tracking_category: - type: optional - docs: The credit note line item's associated tracking category. - validation: - format: uuid - availability: deprecated - tracking_categories: - type: optional>> - docs: The credit note line item's associated tracking categories. - account: - type: optional - docs: The credit note line item's account. - validation: - format: uuid - company: - type: optional - docs: The company the credit note belongs to. - contact: - type: optional - docs: The credit note's contact. - project: optional - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - CreditNoteRequestStatus: - discriminated: false - docs: |- - The credit note's status. - - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - union: - - CreditNoteStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestContact: - discriminated: false - docs: The credit note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestCompany: - discriminated: false - docs: The company the credit note belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestLineItemsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - CreditNoteLineItemRequest - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestCurrency: - discriminated: false - docs: >- - The credit note's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestAppliedPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItem - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequestAccountingPeriod: - discriminated: false - docs: The accounting period that the CreditNote was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - CreditNoteRequest: - docs: >- - # The CreditNote Object - - ### Description - - A `CreditNote` is transaction issued to a customer, indicating a reduction - or cancellation of the amount owed by the customer. It is most generally - used as an adjustment note used to rectify errors, returns, or - overpayments related to a sales transaction. A `CreditNote` can be applied - to *Accounts Receivable* Invoices to decrease the overall amount of the - Invoice. - - - ### Usage Example - - Fetch from the `LIST CreditNotes` endpoint and view a company's credit - notes. - properties: - transaction_date: - type: optional - docs: The credit note's transaction date. - status: - type: optional - docs: |- - The credit note's status. - - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - number: - type: optional - docs: The credit note's number. - contact: - type: optional - docs: The credit note's contact. - company: - type: optional - docs: The company the credit note belongs to. - exchange_rate: - type: optional - docs: The credit note's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - total_amount: - type: optional - docs: The credit note's total amount. - remaining_credit: - type: optional - docs: >- - The amount of value remaining in the credit note that the customer can - use. - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - line_items: optional> - tracking_categories: optional>> - currency: - type: optional - docs: >- - The credit note's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - payments: - type: optional>> - docs: Array of `Payment` object IDs - applied_payments: - type: optional>> - docs: >- - A list of the Payment Applied to Lines common models related to a - given Invoice, Credit Note, or Journal Entry. - accounting_period: - type: optional - docs: The accounting period that the CreditNote was generated in. - applied_to_lines: - type: optional> - docs: >- - A list of the CreditNote Applied to Lines common models related to a - given Credit Note - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - CreditNoteResponse: - properties: - model: CreditNote - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - CreditNoteStatusEnum: - enum: - - SUBMITTED - - AUTHORIZED - - PAID - docs: |- - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `PAID` - PAID - source: - openapi: accounting_v3.yml - CreditOrDebitEnum: - enum: - - CREDIT - - DEBIT - docs: |- - * `CREDIT` - CREDIT - * `DEBIT` - DEBIT - source: - openapi: accounting_v3.yml - 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: MethodEnum - 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: accounting_v3.yml - DebugModeLog: - properties: - log_id: string - dashboard_view: string - log_summary: DebugModelLogSummary - source: - openapi: accounting_v3.yml - DebugModelLogSummary: - properties: - url: string - method: string - status_code: integer - source: - openapi: accounting_v3.yml - EmployeeCompany: - discriminated: false - docs: The subsidiary that the employee belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - EmployeeStatus: - discriminated: false - docs: |- - The employee's status in the accounting system. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - union: - - Status895Enum - - string - source: - openapi: accounting_v3.yml - inline: true - Employee: - docs: >- - # The Employee Object - - ### Description - - An `Employee` is an individual who works for the company of the linked - account. The `Employee` model contains both contractors and full time - employees. - - * An `Employee` is a contractor if `is_contractor` property is `True` - - * An `Employee` is a full time employee if `is_contractor` property is - `False` - - - ### Usage Example - - Fetch from the `LIST Employees` endpoint and view a company's employees. - 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 - first_name: - type: optional - docs: The employee's first name. - validation: - maxLength: 255 - last_name: - type: optional - docs: The employee's last name. - validation: - maxLength: 255 - is_contractor: - type: optional - docs: '`True` if the employee is a contractor, `False` if not.' - employee_number: - type: optional - docs: The employee's internal identification number. - validation: - maxLength: 50 - email_address: - type: optional - docs: The employee's email address. - company: - type: optional - docs: The subsidiary that the employee belongs to. - status: - type: EmployeeStatus - docs: |- - The employee's status in the accounting system. - - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - 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: accounting_v3.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: accounting_v3.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: accounting_v3.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: accounting_v3.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: accounting_v3.yml - ExpenseAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ExpenseContact: - discriminated: false - docs: The expense's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - ExpenseCurrency: - discriminated: false - docs: >- - The expense's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - ExpenseCompany: - discriminated: false - docs: The company the expense belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - ExpenseEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - ExpenseTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - ExpenseAccountingPeriod: - discriminated: false - docs: The accounting period that the Expense was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - Expense: - docs: >- - # The Expense Object - - ### Description - - The `Expense` object is used to represent a direct purchase by a business, - typically made with a check, credit card, or cash. Each `Expense` object - is dedicated to a grouping of expenses, with each expense recorded in the - lines object. - - - The `Expense` object is used also used to represent refunds to direct - purchases. Refunds can be distinguished from purchases by the amount sign - of the records. Expense objects with a negative amount are purchases and - `Expense` objects with a positive amount are refunds to those purchases. - - - ### Usage Example - - Fetch from the `GET Expense` endpoint and view a company's expense. - 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 - transaction_date: - type: optional - docs: When the transaction occurred. - remote_created_at: - type: optional - docs: When the expense was created. - account: - type: optional - docs: The expense's payment account. - contact: - type: optional - docs: The expense's contact. - total_amount: - type: optional - docs: The expense's total amount. - sub_total: - type: optional - docs: The expense's total amount before tax. - total_tax_amount: - type: optional - docs: The expense's total tax amount. - currency: - type: optional - docs: >- - The expense's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The expense's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - company: - type: optional - docs: The company the expense belongs to. - employee: - type: optional - docs: The employee this overall transaction relates to. - memo: - type: optional - docs: The expense's private note. - lines: optional> - tracking_categories: 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 - accounting_period: - type: optional - docs: The accounting period that the Expense was generated in. - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - ExpenseLineItem: - discriminated: false - docs: The line's item. - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineContact: - discriminated: false - docs: The expense's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - ExpenseLine: - docs: |- - # The ExpenseLine Object - ### Description - The `ExpenseLine` object is used to represent an expense's line items. - - ### Usage Example - Fetch from the `GET Expense` endpoint and view the expense's line items. - 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 - item: - type: optional - docs: The line's item. - net_amount: - type: optional - docs: The line's net amount. - tracking_category: - type: optional - availability: deprecated - tracking_categories: - type: optional>> - docs: The expense line item's associated tracking categories. - company: - type: optional - docs: The company the expense belongs to. - validation: - format: uuid - employee: - type: optional - docs: The employee this overall transaction relates to. - currency: - type: optional - docs: >- - The expense line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - account: - type: optional - docs: The expense's payment account. - contact: - type: optional - docs: The expense's contact. - project: optional - description: - type: optional - docs: The description of the item that was purchased by the company. - exchange_rate: - type: optional - docs: The expense line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - 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 - source: - openapi: accounting_v3.yml - ExpenseLineRequestItem: - discriminated: false - docs: The line's item. - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequestTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequestCurrency: - discriminated: false - docs: >- - The expense line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequestAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequestContact: - discriminated: false - docs: The expense's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequestProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - ExpenseLineRequest: - docs: |- - # The ExpenseLine Object - ### Description - The `ExpenseLine` object is used to represent an expense's line items. - - ### Usage Example - Fetch from the `GET Expense` endpoint and view the expense's line items. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - item: - type: optional - docs: The line's item. - net_amount: - type: optional - docs: The line's net amount. - tracking_category: - type: optional - availability: deprecated - tracking_categories: - type: optional>> - docs: The expense line item's associated tracking categories. - company: - type: optional - docs: The company the expense belongs to. - validation: - format: uuid - employee: - type: optional - docs: The employee this overall transaction relates to. - currency: - type: optional - docs: >- - The expense line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - account: - type: optional - docs: The expense's payment account. - contact: - type: optional - docs: The expense's contact. - project: optional - description: - type: optional - docs: The description of the item that was purchased by the company. - exchange_rate: - type: optional - docs: The expense line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - ExpenseRequestAccount: - discriminated: false - docs: The expense's payment account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ExpenseRequestContact: - discriminated: false - docs: The expense's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - ExpenseRequestCompany: - discriminated: false - docs: The company the expense belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - ExpenseRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - ExpenseRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - ExpenseRequestAccountingPeriod: - discriminated: false - docs: The accounting period that the Expense was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - ExpenseRequest: - docs: >- - # The Expense Object - - ### Description - - The `Expense` object is used to represent a direct purchase by a business, - typically made with a check, credit card, or cash. Each `Expense` object - is dedicated to a grouping of expenses, with each expense recorded in the - lines object. - - - The `Expense` object is used also used to represent refunds to direct - purchases. Refunds can be distinguished from purchases by the amount sign - of the records. Expense objects with a negative amount are purchases and - `Expense` objects with a positive amount are refunds to those purchases. - - - ### Usage Example - - Fetch from the `GET Expense` endpoint and view a company's expense. - properties: - transaction_date: - type: optional - docs: When the transaction occurred. - account: - type: optional - docs: The expense's payment account. - contact: - type: optional - docs: The expense's contact. - total_amount: - type: optional - docs: The expense's total amount. - sub_total: - type: optional - docs: The expense's total amount before tax. - total_tax_amount: - type: optional - docs: The expense's total tax amount. - currency: - type: optional - docs: >- - The expense's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The expense's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - company: - type: optional - docs: The company the expense belongs to. - employee: - type: optional - docs: The employee this overall transaction relates to. - memo: - type: optional - docs: The expense's private note. - lines: optional> - tracking_categories: optional>> - accounting_period: - type: optional - docs: The accounting period that the Expense was generated in. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - ExpenseResponse: - properties: - model: Expense - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - ExternalTargetFieldApi: - properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only - source: - openapi: accounting_v3.yml - ExternalTargetFieldApiResponse: - properties: - Account: optional> - AccountingAttachment: optional> - BalanceSheet: optional> - CashFlowStatement: optional> - CompanyInfo: optional> - Contact: optional> - IncomeStatement: optional> - CreditNote: optional> - Item: optional> - PurchaseOrder: optional> - TrackingCategory: optional> - JournalEntry: optional> - TaxRate: optional> - Invoice: optional> - Payment: optional> - Expense: optional> - VendorCredit: optional> - Transaction: optional> - AccountingPeriod: optional> - GeneralLedgerTransaction: optional> - BankFeedAccount: optional> - Employee: optional> - PaymentMethod: optional> - Project: optional> - PaymentTerm: optional> - source: - openapi: accounting_v3.yml - FeedStatusEnum: - enum: - - ACTIVE - - INACTIVE - docs: |- - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - source: - openapi: accounting_v3.yml - FieldFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: accounting_v3.yml - FieldMappingApiInstanceTargetField: - properties: - name: string - description: string - is_organization_wide: boolean - source: - openapi: accounting_v3.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: - properties: - method: optional - url_path: optional - field_traversal_path: optional> - source: - openapi: accounting_v3.yml - inline: true - FieldMappingApiInstanceRemoteField: - properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - source: - openapi: accounting_v3.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 - source: - openapi: accounting_v3.yml - FieldMappingApiInstanceResponse: - properties: - Account: optional> - AccountingAttachment: optional> - BalanceSheet: optional> - CashFlowStatement: optional> - CompanyInfo: optional> - Contact: optional> - IncomeStatement: optional> - CreditNote: optional> - Item: optional> - PurchaseOrder: optional> - TrackingCategory: optional> - JournalEntry: optional> - TaxRate: optional> - Invoice: optional> - Payment: optional> - Expense: optional> - VendorCredit: optional> - Transaction: optional> - AccountingPeriod: optional> - GeneralLedgerTransaction: optional> - BankFeedAccount: optional> - Employee: optional> - PaymentMethod: optional> - Project: optional> - PaymentTerm: optional> - source: - openapi: accounting_v3.yml - FieldMappingInstanceResponse: - properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - FieldPermissionDeserializer: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: accounting_v3.yml - FieldPermissionDeserializerRequest: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: accounting_v3.yml - FieldTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: accounting_v3.yml - GeneralLedgerTransactionUnderlyingTransactionType: - discriminated: false - docs: |- - The type of the underlying transaction. - - * `INVOICE` - INVOICE - * `EXPENSE` - EXPENSE - * `TRANSACTION` - TRANSACTION - * `JOURNAL_ENTRY` - JOURNAL_ENTRY - * `PAYMENT` - PAYMENT - * `VENDOR_CREDIT` - VENDOR_CREDIT - * `CREDIT_NOTE` - CREDIT_NOTE - union: - - UnderlyingTransactionTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionAccountingPeriod: - discriminated: false - docs: The accounting period that the GeneralLedgerTransaction was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionCompany: - discriminated: false - docs: The company the GeneralLedgerTransaction belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionGeneralLedgerTransactionLinesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - GeneralLedgerTransactionLine - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransaction: - docs: >- - # The GeneralLedgerTransaction Object - - ### Description - - A General Ledger Entry is a record of a financial transaction that is - posted to the general ledger, the central repository of a company’s - financial data. - - - The `GeneralLedgerTransaction` object is a singular endpoint to pull all - transactions posted to a company’s general ledger. The transaction that - generated the `GeneralLedgerTransaction` can be found by referencing the - `underlying_transaction_type` and `underlying_transaction_remote_id` - fields. - - - The lines of a `GeneralLedgerTransaction` object will always have equal - amounts of debits and credits. - - - ### Usage Example - - Fetch from the `GET GeneralLedgerTransaction` endpoint and view a general - ledger transaction. - 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 - underlying_transaction_remote_id: - type: optional - docs: The third party remote ID of the underlying transaction. - validation: - maxLength: 50 - underlying_transaction_type: - type: optional - docs: |- - The type of the underlying transaction. - - * `INVOICE` - INVOICE - * `EXPENSE` - EXPENSE - * `TRANSACTION` - TRANSACTION - * `JOURNAL_ENTRY` - JOURNAL_ENTRY - * `PAYMENT` - PAYMENT - * `VENDOR_CREDIT` - VENDOR_CREDIT - * `CREDIT_NOTE` - CREDIT_NOTE - accounting_period: - type: optional - docs: >- - The accounting period that the GeneralLedgerTransaction was generated - in. - company: - type: optional - docs: The company the GeneralLedgerTransaction belongs to. - remote_updated_at: - type: optional - docs: When the third party's GeneralLedgerTransaction entry was updated. - remote_created_at: - type: optional - docs: When the third party's GeneralLedgerTransaction entry was created. - tracking_categories: optional>> - posting_date: - type: optional - docs: The date that the transaction was posted to the general ledger. - general_ledger_transaction_lines: - type: >- - optional> - docs: A list of “General Ledger Transaction Applied to Lines” objects. - access: read-only - 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: accounting_v3.yml - GeneralLedgerTransactionLineAccount: - discriminated: false - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLineCompany: - discriminated: false - docs: The company the GeneralLedgerTransaction belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLineEmployee: - discriminated: false - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLineContact: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLineProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLineTransactionCurrency: - discriminated: false - docs: >- - The transaction currency that the transaction is made in. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLineTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLineItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - GeneralLedgerTransactionLine: - docs: >- - # The GeneralLedgerTransactionLineSerializer Object - - ### Description - - The `GeneralLedgerTransactionLineSerializer` object represents general - ledger transaction line item. - - - ### Usage Example Fetch from the `GET - GeneralLedgerTransactionLineSerializer` endpoint and view an - - `GeneralLedgerTransaction` line item. - 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 - account: optional - company: - type: optional - docs: The company the GeneralLedgerTransaction belongs to. - employee: optional - contact: optional - project: optional - base_currency: - type: optional - docs: >- - The base currency of the transaction - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - transaction_currency: - type: optional - docs: >- - The transaction currency that the transaction is made in. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: >- - The exchange rate between the base currency and the transaction - currency. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - description: - type: optional - docs: A description of the line item. - tracking_categories: - type: optional> - access: read-only - debit_amount: string - credit_amount: string - item: optional - foreign_debit_amount: string - foreign_credit_amount: string - 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: accounting_v3.yml - IncomeStatementCurrency: - discriminated: false - docs: >- - The income statement's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - IncomeStatementCompany: - discriminated: false - docs: The company the income statement belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - IncomeStatement: - docs: >- - # The IncomeStatement Object - - ### Description - - The `IncomeStatement` object is used to represent a company’s income, the - cost of sales, operating expenses, and other non-operating expenses. The - object also includes other important values like gross profit, gross - operating profit, and net income. This represents a period of time (month, - quarter, or year). - - - ### Usage Example - - Fetch from the `GET IncomeStatement` endpoint and view a company's income - statement for a given period. - 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 income statement's name. - currency: - type: optional - docs: >- - The income statement's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - company: - type: optional - docs: The company the income statement belongs to. - start_period: - type: optional - docs: The income statement's start period. - end_period: - type: optional - docs: The income statement's end period. - income: - type: optional> - access: read-only - cost_of_sales: - type: optional> - access: read-only - gross_profit: - type: optional - docs: The revenue minus the cost of sale. - operating_expenses: - type: optional> - access: read-only - net_operating_income: - type: optional - docs: The revenue minus the operating expenses. - non_operating_expenses: - type: optional> - access: read-only - net_income: - type: optional - docs: The gross profit minus the total expenses. - 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: accounting_v3.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: accounting_v3.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: accounting_v3.yml - InvoiceContact: - discriminated: false - docs: The invoice's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - InvoiceCompany: - discriminated: false - docs: The company the invoice belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - InvoiceEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - InvoiceCurrency: - discriminated: false - docs: >- - The invoice's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - InvoicePaymentTerm: - discriminated: false - docs: The payment term that applies to this transaction. - union: - - type: string - validation: - format: uuid - - PaymentTerm - source: - openapi: accounting_v3.yml - inline: true - InvoiceStatus: - discriminated: false - docs: |- - The status of the invoice. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - union: - - InvoiceStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - InvoiceTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - InvoiceAccountingPeriod: - discriminated: false - docs: The accounting period that the Invoice was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - InvoicePurchaseOrdersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PurchaseOrder - source: - openapi: accounting_v3.yml - inline: true - InvoicePaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: accounting_v3.yml - inline: true - InvoiceAppliedPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItem - source: - openapi: accounting_v3.yml - inline: true - InvoiceAppliedCreditNotesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - CreditNoteApplyLineForInvoice - source: - openapi: accounting_v3.yml - inline: true - InvoiceAppliedVendorCreditsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - VendorCreditApplyLineForInvoice - source: - openapi: accounting_v3.yml - inline: true - Invoice: - docs: >- - # The Invoice Object - - ### Description - - The `Invoice` object represents an itemized record of goods and/or - services sold to a customer or bought from a vendor. - - - - Represents a Bill when the `Invoice` type is `ACCOUNTS_PAYABLE`. - References an Invoice when the `Invoice` type is `ACCOUNTS_RECEIVABLE`. - - - ### Usage Example - - Fetch from the `LIST Invoices` endpoint and view a company's invoices. - 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 - type: - type: optional - docs: >- - Whether the invoice is an accounts receivable or accounts payable. If - `type` is `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is - `ACCOUNTS_RECEIVABLE`, it is an invoice. - - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - contact: - type: optional - docs: The invoice's contact. - number: - type: optional - docs: The invoice's number. - issue_date: - type: optional - docs: The invoice's issue date. - due_date: - type: optional - docs: The invoice's due date. - paid_on_date: - type: optional - docs: The invoice's paid date. - memo: - type: optional - docs: The invoice's private note. - company: - type: optional - docs: The company the invoice belongs to. - employee: - type: optional - docs: The employee this overall transaction relates to. - currency: - type: optional - docs: >- - The invoice's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The invoice's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - payment_term: - type: optional - docs: The payment term that applies to this transaction. - total_discount: - type: optional - docs: The total discounts applied to the total cost. - sub_total: - type: optional - docs: The total amount being paid before taxes. - status: - type: optional - docs: |- - The status of the invoice. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - total_tax_amount: - type: optional - docs: The total amount being paid in taxes. - total_amount: - type: optional - docs: The invoice's total amount. - balance: - type: optional - docs: The invoice's remaining balance. - remote_updated_at: - type: optional - docs: When the third party's invoice entry was updated. - tracking_categories: optional>> - accounting_period: - type: optional - docs: The accounting period that the Invoice was generated in. - purchase_orders: optional>> - payments: - type: optional>> - docs: Array of `Payment` object IDs. - applied_payments: - type: optional>> - docs: >- - A list of the Payment Applied to Lines common models related to a - given Invoice, Credit Note, or Journal Entry. - line_items: - type: optional> - access: read-only - applied_credit_notes: - type: optional> - docs: '`CreditNoteApplyLines` applied to the Invoice.' - access: read-only - applied_vendor_credits: - type: optional> - docs: '`VendorCreditApplyLines` applied to the Invoice.' - access: read-only - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - InvoiceLineItemEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemContact: - discriminated: false - docs: The invoice's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemCurrency: - discriminated: false - docs: >- - The line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemAccount: - discriminated: false - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItem: - docs: >- - # The InvoiceLineItem Object - - ### Description - - The `InvoiceLineItem` object represents an itemized record of goods and/or - services sold to a customer. - - - ### Usage Example - - Fetch from the `GET Invoice` endpoint and view the invoice's line items. - 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 - description: - type: optional - docs: The line item's description. - unit_price: - type: optional - docs: The line item's unit price. - quantity: - type: optional - docs: The line item's quantity. - total_amount: - type: optional - docs: The line item's total amount. - employee: - type: optional - docs: The employee this overall transaction relates to. - project: optional - contact: - type: optional - docs: The invoice's contact. - currency: - type: optional - docs: >- - The line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - item: optional - account: optional - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - tracking_category: - type: optional - availability: deprecated - tracking_categories: - type: optional>> - docs: The invoice line item's associated tracking categories. - company: - type: optional - docs: The company the invoice belongs to. - validation: - format: uuid - 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_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - InvoiceLineItemRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequestProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequestContact: - discriminated: false - docs: The invoice's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequestCurrency: - discriminated: false - docs: >- - The line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequestItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequestAccount: - discriminated: false - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequestTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - InvoiceLineItemRequest: - docs: >- - # The InvoiceLineItem Object - - ### Description - - The `InvoiceLineItem` object represents an itemized record of goods and/or - services sold to a customer. - - - ### Usage Example - - Fetch from the `GET Invoice` endpoint and view the invoice's line items. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - description: - type: optional - docs: The line item's description. - unit_price: - type: optional - docs: The line item's unit price. - quantity: - type: optional - docs: The line item's quantity. - total_amount: - type: optional - docs: The line item's total amount. - employee: - type: optional - docs: The employee this overall transaction relates to. - project: optional - contact: - type: optional - docs: The invoice's contact. - currency: - type: optional - docs: >- - The line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - item: optional - account: optional - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - tracking_category: - type: optional - availability: deprecated - tracking_categories: - type: optional>> - docs: The invoice line item's associated tracking categories. - company: - type: optional - docs: The company the invoice belongs to. - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - InvoiceRequestType: - discriminated: false - docs: >- - Whether the invoice is an accounts receivable or accounts payable. If - `type` is `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is - `ACCOUNTS_RECEIVABLE`, it is an invoice. - - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - union: - - InvoiceTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestContact: - discriminated: false - docs: The invoice's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestEmployee: - discriminated: false - docs: The employee this overall transaction relates to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestStatus: - discriminated: false - docs: |- - The status of the invoice. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - union: - - InvoiceStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestCompany: - discriminated: false - docs: The company the invoice belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestCurrency: - discriminated: false - docs: >- - The invoice's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestPaymentTerm: - discriminated: false - docs: The payment term that applies to this transaction. - union: - - type: string - validation: - format: uuid - - PaymentTerm - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequestPurchaseOrdersItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PurchaseOrder - source: - openapi: accounting_v3.yml - inline: true - InvoiceRequest: - docs: >- - # The Invoice Object - - ### Description - - The `Invoice` object represents an itemized record of goods and/or - services sold to a customer or bought from a vendor. - - - - Represents a Bill when the `Invoice` type is `ACCOUNTS_PAYABLE`. - References an Invoice when the `Invoice` type is `ACCOUNTS_RECEIVABLE`. - - - ### Usage Example - - Fetch from the `LIST Invoices` endpoint and view a company's invoices. - properties: - type: - type: optional - docs: >- - Whether the invoice is an accounts receivable or accounts payable. If - `type` is `ACCOUNTS_PAYABLE`, the invoice is a bill. If `type` is - `ACCOUNTS_RECEIVABLE`, it is an invoice. - - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - contact: - type: optional - docs: The invoice's contact. - number: - type: optional - docs: The invoice's number. - issue_date: - type: optional - docs: The invoice's issue date. - due_date: - type: optional - docs: The invoice's due date. - paid_on_date: - type: optional - docs: The invoice's paid date. - employee: - type: optional - docs: The employee this overall transaction relates to. - memo: - type: optional - docs: The invoice's private note. - status: - type: optional - docs: |- - The status of the invoice. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - company: - type: optional - docs: The company the invoice belongs to. - currency: - type: optional - docs: >- - The invoice's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The invoice's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - total_discount: - type: optional - docs: The total discounts applied to the total cost. - sub_total: - type: optional - docs: The total amount being paid before taxes. - payment_term: - type: optional - docs: The payment term that applies to this transaction. - total_tax_amount: - type: optional - docs: The total amount being paid in taxes. - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - total_amount: - type: optional - docs: The invoice's total amount. - balance: - type: optional - docs: The invoice's remaining balance. - payments: - type: optional>> - docs: Array of `Payment` object IDs. - tracking_categories: optional>> - line_items: optional> - purchase_orders: optional>> - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - InvoiceResponse: - properties: - model: Invoice - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - InvoiceStatusEnum: - enum: - - PAID - - DRAFT - - SUBMITTED - - PARTIALLY_PAID - - OPEN - - VOID - docs: |- - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - source: - openapi: accounting_v3.yml - InvoiceTypeEnum: - enum: - - ACCOUNTS_RECEIVABLE - - ACCOUNTS_PAYABLE - docs: |- - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - source: - openapi: accounting_v3.yml - IssueStatus: - discriminated: false - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - union: - - IssueStatusEnum - - string - source: - openapi: accounting_v3.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: accounting_v3.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: accounting_v3.yml - ItemStatus: - discriminated: false - docs: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - union: - - Status7D1Enum - - string - source: - openapi: accounting_v3.yml - inline: true - ItemType: - discriminated: false - docs: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - union: - - Type2BbEnum - - string - source: - openapi: accounting_v3.yml - inline: true - ItemPurchaseAccount: - discriminated: false - docs: References the default account used to record a purchase of the item. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ItemSalesAccount: - discriminated: false - docs: References the default account used to record a sale. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ItemCompany: - discriminated: false - docs: The company the item belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - ItemPurchaseTaxRate: - discriminated: false - docs: The default purchase tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: accounting_v3.yml - inline: true - ItemSalesTaxRate: - discriminated: false - docs: The default sales tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: accounting_v3.yml - inline: true - Item: - docs: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. - - ### Usage Example - Fetch from the `LIST Items` endpoint and view a company's items. - 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 item's name. - status: - type: optional - docs: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - type: - type: optional - docs: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - unit_price: - type: optional - docs: The item's unit price. - purchase_price: - type: optional - docs: The price at which the item is purchased from a vendor. - purchase_account: - type: optional - docs: References the default account used to record a purchase of the item. - sales_account: - type: optional - docs: References the default account used to record a sale. - company: - type: optional - docs: The company the item belongs to. - purchase_tax_rate: - type: optional - docs: The default purchase tax rate for this item. - sales_tax_rate: - type: optional - docs: The default sales tax rate for this item. - remote_updated_at: - type: optional - docs: When the third party's item note was updated. - 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: accounting_v3.yml - ItemFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - uuid - * `number` - url - * `date` - email - * `datetime` - phone - * `bool` - currency - * `list` - decimal - source: - openapi: accounting_v3.yml - ItemRequestRequestStatus: - discriminated: false - docs: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - union: - - Status7D1Enum - - string - source: - openapi: accounting_v3.yml - inline: true - ItemRequestRequestType: - discriminated: false - docs: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - union: - - Type2BbEnum - - string - source: - openapi: accounting_v3.yml - inline: true - ItemRequestRequestPurchaseAccount: - discriminated: false - docs: References the default account used to record a purchase of the item. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ItemRequestRequestSalesAccount: - discriminated: false - docs: References the default account used to record a sale. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - ItemRequestRequestCompany: - discriminated: false - docs: The company the item belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - ItemRequestRequestPurchaseTaxRate: - discriminated: false - docs: The default purchase tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: accounting_v3.yml - inline: true - ItemRequestRequestSalesTaxRate: - discriminated: false - docs: The default sales tax rate for this item. - union: - - type: string - validation: - format: uuid - - TaxRate - source: - openapi: accounting_v3.yml - inline: true - ItemRequestRequest: - docs: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. - - ### Usage Example - Fetch from the `LIST Items` endpoint and view a company's items. - properties: - name: - type: optional - docs: The item's name. - status: - type: optional - docs: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - type: - type: optional - docs: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - unit_price: - type: optional - docs: The item's unit price. - purchase_price: - type: optional - docs: The price at which the item is purchased from a vendor. - purchase_account: - type: optional - docs: References the default account used to record a purchase of the item. - sales_account: - type: optional - docs: References the default account used to record a sale. - company: - type: optional - docs: The company the item belongs to. - purchase_tax_rate: - type: optional - docs: The default purchase tax rate for this item. - sales_tax_rate: - type: optional - docs: The default sales tax rate for this item. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - ItemResponse: - properties: - model: Item - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - ItemSchema: - properties: - item_type: optional - item_format: optional - item_choices: optional> - source: - openapi: accounting_v3.yml - ItemTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: accounting_v3.yml - JournalEntryPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: accounting_v3.yml - inline: true - JournalEntryAppliedPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItem - source: - openapi: accounting_v3.yml - inline: true - JournalEntryCurrency: - discriminated: false - docs: >- - The journal's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - JournalEntryCompany: - discriminated: false - docs: The company the journal entry belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - JournalEntryTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - JournalEntryPostingStatus: - discriminated: false - docs: |- - The journal's posting status. - - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - union: - - PostingStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - JournalEntryAccountingPeriod: - discriminated: false - docs: The accounting period that the JournalEntry was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - JournalEntry: - docs: >- - # The JournalEntry Object - - ### Description - - A `JournalEntry` is a record of a transaction or event that is entered - into a company's accounting system. - - - The `JournalEntry` common model contains records that are automatically - created as a result of a certain type of transaction, like an Invoice, and - records that are manually created against a company’s ledger. - - - The lines of a given `JournalEntry` object should always sum to 0. A - positive `net_amount` means the line represents a debit and a negative - net_amount represents a credit. - - - ### Usage Example - - Fetch from the `GET JournalEntry` endpoint and view a company's journey - entry. - 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 - transaction_date: - type: optional - docs: The journal entry's transaction date. - payments: - type: optional>> - docs: Array of `Payment` object IDs. - applied_payments: - type: optional>> - docs: >- - A list of the Payment Applied to Lines common models related to a - given Invoice, Credit Note, or Journal Entry. - memo: - type: optional - docs: The journal entry's private note. - currency: - type: optional - docs: >- - The journal's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The journal entry's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the journal entry belongs to. - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - lines: - type: optional> - access: read-only - journal_number: - type: optional - docs: Reference number for identifying journal entries. - validation: - maxLength: 70 - tracking_categories: 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 - posting_status: - type: optional - docs: |- - The journal's posting status. - - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - accounting_period: - type: optional - docs: The accounting period that the JournalEntry was generated in. - remote_created_at: - type: optional - docs: When the third party's journal entry was created. - remote_updated_at: - type: optional - docs: When the third party's journal entry was updated. - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - JournalEntryRequestPaymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Payment - source: - openapi: accounting_v3.yml - inline: true - JournalEntryRequestCurrency: - discriminated: false - docs: >- - The journal's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - JournalEntryRequestCompany: - discriminated: false - docs: The company the journal entry belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - JournalEntryRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - JournalEntryRequestPostingStatus: - discriminated: false - docs: |- - The journal's posting status. - - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - union: - - PostingStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - JournalEntryRequest: - docs: >- - # The JournalEntry Object - - ### Description - - The `JournalEntry` object is used to get a record of all manually created - entries made in a company’s general ledger. The journal line items for - each journal entry should sum to zero. - - - ### Usage Example - - Fetch from the `GET JournalEntry` endpoint and view a company's journey - entry. - properties: - transaction_date: - type: optional - docs: The journal entry's transaction date. - payments: - type: optional>> - docs: Array of `Payment` object IDs. - memo: - type: optional - docs: The journal entry's private note. - currency: - type: optional - docs: >- - The journal's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The journal entry's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the journal entry belongs to. - tracking_categories: optional>> - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - lines: optional> - journal_number: - type: optional - docs: Reference number for identifying journal entries. - validation: - maxLength: 70 - posting_status: - type: optional - docs: |- - The journal's posting status. - - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - JournalEntryResponse: - properties: - model: JournalEntry - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - JournalLineAccount: - discriminated: false - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - JournalLineTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - JournalLineTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - JournalLineCurrency: - discriminated: false - docs: >- - The journal line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - JournalLineProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - JournalLine: - docs: >- - # The JournalLine Object - - ### Description - - The `JournalLine` object is used to represent a journal entry's line - items. - - - ### Usage Example - - Fetch from the `GET JournalEntry` endpoint and view the journal entry's - line items. - 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 - account: optional - net_amount: - type: optional - docs: The value of the line item including taxes and other fees. - tracking_category: - type: optional - availability: deprecated - tracking_categories: - type: optional>> - docs: The journal line item's associated tracking categories. - currency: - type: optional - docs: >- - The journal line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - company: - type: optional - docs: The company the journal entry belongs to. - validation: - format: uuid - employee: - type: optional - validation: - format: uuid - project: optional - contact: - type: optional - validation: - format: uuid - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - description: - type: optional - docs: The line's description. - exchange_rate: - type: optional - docs: The journal line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - JournalLineRequestAccount: - discriminated: false - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - JournalLineRequestTrackingCategory: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - JournalLineRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - JournalLineRequestCurrency: - discriminated: false - docs: >- - The journal line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - JournalLineRequestProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - JournalLineRequest: - docs: >- - # The JournalLine Object - - ### Description - - The `JournalLine` object is used to represent a journal entry's line - items. - - - ### Usage Example - - Fetch from the `GET JournalEntry` endpoint and view the journal entry's - line items. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - account: optional - net_amount: - type: optional - docs: The value of the line item including taxes and other fees. - tracking_category: - type: optional - availability: deprecated - tracking_categories: - type: optional>> - docs: The journal line item's associated tracking categories. - currency: - type: optional - docs: >- - The journal line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - company: - type: optional - docs: The company the journal entry belongs to. - validation: - format: uuid - employee: - type: optional - validation: - format: uuid - project: optional - contact: - type: optional - validation: - format: uuid - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - description: - type: optional - docs: The line's description. - exchange_rate: - type: optional - docs: The journal line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: accounting_v3.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: accounting_v3.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: accounting_v3.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean - source: - openapi: accounting_v3.yml - MetaResponse: - properties: - request_schema: map - remote_field_classes: optional> - status: optional - has_conditional_params: boolean - has_required_linked_account_params: boolean - source: - openapi: accounting_v3.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: accounting_v3.yml - MethodTypeEnum: - enum: - - CREDIT_CARD - - DEBIT_CARD - - ACH - - CASH - - CHECK - docs: |- - * `CREDIT_CARD` - CREDIT_CARD - * `DEBIT_CARD` - DEBIT_CARD - * `ACH` - ACH - * `CASH` - CASH - * `CHECK` - CHECK - source: - openapi: accounting_v3.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: accounting_v3.yml - ModelPermissionDeserializer: - properties: - is_enabled: optional - source: - openapi: accounting_v3.yml - ModelPermissionDeserializerRequest: - properties: - is_enabled: optional - source: - openapi: accounting_v3.yml - 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: accounting_v3.yml - PaginatedAccountDetailsAndActionsList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedAccountList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedAccountingAttachmentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedAccountingPeriodList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedAuditLogEventList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedBalanceSheetList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedBankFeedAccountList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedBankFeedTransactionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedCashFlowStatementList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedCompanyInfoList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedContactList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedCreditNoteList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedEmployeeList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedExpenseList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedGeneralLedgerTransactionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedIncomeStatementList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedInvoiceList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedIssueList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedItemList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedJournalEntryList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedPaymentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedPaymentMethodList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedPaymentTermList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedProjectList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedPurchaseOrderList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedRemoteFieldClassList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedSyncStatusList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedTaxRateList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedTrackingCategoryList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedTransactionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PaginatedVendorCreditList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: accounting_v3.yml - PatchedItemRequestRequestStatus: - discriminated: false - docs: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - union: - - Status7D1Enum - - string - source: - openapi: accounting_v3.yml - inline: true - PatchedItemRequestRequestType: - discriminated: false - docs: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - union: - - Type2BbEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PatchedItemRequestRequest: - docs: |- - # The Item Object - ### Description - The `Item` object refers to the goods involved in a transaction. - - ### Usage Example - Fetch from the `LIST Items` endpoint and view a company's items. - properties: - name: - type: optional - docs: The item's name. - status: - type: optional - docs: |- - The item's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - type: - type: optional - docs: |- - The item's type. - - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - unit_price: - type: optional - docs: The item's unit price. - purchase_price: - type: optional - docs: The price at which the item is purchased from a vendor. - purchase_account: - type: optional - docs: References the default account used to record a purchase of the item. - validation: - format: uuid - sales_account: - type: optional - docs: References the default account used to record a sale. - validation: - format: uuid - company: - type: optional - docs: The company the item belongs to. - validation: - format: uuid - purchase_tax_rate: - type: optional - docs: The default purchase tax rate for this item. - validation: - format: uuid - sales_tax_rate: - type: optional - docs: The default sales tax rate for this item. - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - PatchedPaymentRequestContact: - discriminated: false - docs: The supplier, or customer involved in the payment. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestAccount: - discriminated: false - docs: The supplier’s or customer’s account in which the payment is made. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestPaymentMethod: - discriminated: false - docs: The method which this payment was made by. - union: - - type: string - validation: - format: uuid - - PaymentMethod - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestCurrency: - discriminated: false - docs: >- - The payment's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestCompany: - discriminated: false - docs: The company the payment belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestType: - discriminated: false - docs: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - union: - - PaymentTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestAccountingPeriod: - discriminated: false - docs: The accounting period that the Payment was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequestAppliedToLinesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItemRequest - source: - openapi: accounting_v3.yml - inline: true - PatchedPaymentRequest: - docs: >- - # The Payment Object - - ### Description - - The `Payment` object represents general payments made towards a specific - transaction. - - - ### Usage Example - - Fetch from the `GET Payment` endpoint and view an invoice's payment. - properties: - transaction_date: - type: optional - docs: The payment's transaction date. - contact: - type: optional - docs: The supplier, or customer involved in the payment. - account: - type: optional - docs: The supplier’s or customer’s account in which the payment is made. - payment_method: - type: optional - docs: The method which this payment was made by. - currency: - type: optional - docs: >- - The payment's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The payment's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the payment belongs to. - total_amount: - type: optional - docs: >- - The total amount of money being paid to the supplier, or customer, - after taxes. - type: - type: optional - docs: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - tracking_categories: optional>> - accounting_period: - type: optional - docs: The accounting period that the Payment was generated in. - applied_to_lines: - type: optional> - docs: A list of “Payment Applied to Lines” objects. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - PaymentContact: - discriminated: false - docs: The supplier, or customer involved in the payment. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - PaymentAccount: - discriminated: false - docs: The supplier’s or customer’s account in which the payment is made. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - PaymentPaymentMethod: - discriminated: false - docs: The method which this payment was made by. - union: - - type: string - validation: - format: uuid - - PaymentMethod - source: - openapi: accounting_v3.yml - inline: true - PaymentCurrency: - discriminated: false - docs: >- - The payment's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PaymentCompany: - discriminated: false - docs: The company the payment belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - PaymentType: - discriminated: false - docs: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - union: - - PaymentTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PaymentTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - PaymentAccountingPeriod: - discriminated: false - docs: The accounting period that the Payment was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - PaymentAppliedToLinesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItem - source: - openapi: accounting_v3.yml - inline: true - Payment: - docs: >- - # The Payment Object - - ### Description - - The `Payment` object represents general payments made towards a specific - transaction. - - - ### Usage Example - - Fetch from the `GET Payment` endpoint and view an invoice's payment. - 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 - transaction_date: - type: optional - docs: The payment's transaction date. - contact: - type: optional - docs: The supplier, or customer involved in the payment. - account: - type: optional - docs: The supplier’s or customer’s account in which the payment is made. - payment_method: - type: optional - docs: The method which this payment was made by. - currency: - type: optional - docs: >- - The payment's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The payment's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the payment belongs to. - total_amount: - type: optional - docs: >- - The total amount of money being paid to the supplier, or customer, - after taxes. - type: - type: optional - docs: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - tracking_categories: optional>> - accounting_period: - type: optional - docs: The accounting period that the Payment was generated in. - applied_to_lines: - type: optional> - docs: A list of “Payment Applied to Lines” objects. - remote_updated_at: - type: optional - docs: When the third party's payment entry was updated. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - PaymentLineItem: - docs: >- - # The PaymentLineItem Object - - ### Description - - The `PaymentLineItem` object is an applied-to-line on a `Payment` that can - either be a `Invoice`, `CreditNote`, or `JournalEntry`. - - - ### Usage Example - - `Payment` will have a field called `applied-to-lines` which will be an - array of `PaymentLineItemInternalMappingSerializer` objects that can - either be a `Invoice`, `CreditNote`, or `JournalEntry`. - 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 - applied_amount: - type: optional - docs: The amount being applied to the transaction. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - applied_date: - type: optional - docs: The date the payment portion is applied. - related_object_id: - type: optional - docs: >- - The Merge ID of the transaction the payment portion is being applied - to. - validation: - format: uuid - related_object_type: - type: optional - docs: >- - The type of transaction the payment portion is being applied to. - Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE. - source: - openapi: accounting_v3.yml - PaymentLineItemRequest: - docs: >- - # The PaymentLineItem Object - - ### Description - - The `PaymentLineItem` object is an applied-to-line on a `Payment` that can - either be a `Invoice`, `CreditNote`, or `JournalEntry`. - - - ### Usage Example - - `Payment` will have a field called `applied-to-lines` which will be an - array of `PaymentLineItemInternalMappingSerializer` objects that can - either be a `Invoice`, `CreditNote`, or `JournalEntry`. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - applied_amount: - type: optional - docs: The amount being applied to the transaction. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - applied_date: - type: optional - docs: The date the payment portion is applied. - related_object_id: - type: optional - docs: >- - The Merge ID of the transaction the payment portion is being applied - to. - validation: - format: uuid - related_object_type: - type: optional - docs: >- - The type of transaction the payment portion is being applied to. - Possible values include: INVOICE, JOURNAL_ENTRY, or CREDIT_NOTE. - validation: - minLength: 1 - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - PaymentMethodMethodType: - discriminated: false - docs: |- - The type of the payment method. - - * `CREDIT_CARD` - CREDIT_CARD - * `DEBIT_CARD` - DEBIT_CARD - * `ACH` - ACH - * `CASH` - CASH - * `CHECK` - CHECK - union: - - MethodTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PaymentMethod: - docs: >- - # The PaymentMethod Object - - ### Description - - The `PaymentMethod` object defines how a payment against an invoice is - made. - - - ### Usage Example - - Fetch from the `GET PaymentMethod` endpoint and view payment method - information. - 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 - method_type: - type: PaymentMethodMethodType - docs: |- - The type of the payment method. - - * `CREDIT_CARD` - CREDIT_CARD - * `DEBIT_CARD` - DEBIT_CARD - * `ACH` - ACH - * `CASH` - CASH - * `CHECK` - CHECK - name: - type: string - docs: The payment method’s name - validation: - maxLength: 255 - is_active: - type: optional - docs: '`True` if the payment method is active, `False` if not.' - remote_updated_at: - type: optional - docs: When the third party's payment method was updated. - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - PaymentRequestContact: - discriminated: false - docs: The supplier, or customer involved in the payment. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestAccount: - discriminated: false - docs: The supplier’s or customer’s account in which the payment is made. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestPaymentMethod: - discriminated: false - docs: The method which this payment was made by. - union: - - type: string - validation: - format: uuid - - PaymentMethod - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestCurrency: - discriminated: false - docs: >- - The payment's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestCompany: - discriminated: false - docs: The company the payment belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestType: - discriminated: false - docs: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - union: - - PaymentTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestAccountingPeriod: - discriminated: false - docs: The accounting period that the Payment was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - PaymentRequestAppliedToLinesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PaymentLineItemRequest - source: - openapi: accounting_v3.yml - inline: true - PaymentRequest: - docs: >- - # The Payment Object - - ### Description - - The `Payment` object represents general payments made towards a specific - transaction. - - - ### Usage Example - - Fetch from the `GET Payment` endpoint and view an invoice's payment. - properties: - transaction_date: - type: optional - docs: The payment's transaction date. - contact: - type: optional - docs: The supplier, or customer involved in the payment. - account: - type: optional - docs: The supplier’s or customer’s account in which the payment is made. - payment_method: - type: optional - docs: The method which this payment was made by. - currency: - type: optional - docs: >- - The payment's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The payment's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the payment belongs to. - total_amount: - type: optional - docs: >- - The total amount of money being paid to the supplier, or customer, - after taxes. - type: - type: optional - docs: |- - The type of the invoice. - - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - tracking_categories: optional>> - accounting_period: - type: optional - docs: The accounting period that the Payment was generated in. - applied_to_lines: - type: optional> - docs: A list of “Payment Applied to Lines” objects. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - PaymentResponse: - properties: - model: Payment - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - PaymentTermCompany: - discriminated: false - docs: The subsidiary that the payment term belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - PaymentTerm: - docs: >- - # The PaymentTerm Object - - ### Description - - The `PaymentTerm` object is the agreed-upon conditions between a buyer and - a seller that define the timing, - - amount, and conditions under which payment for goods or services must be - made. - - - ### Usage Example - - Fetch from the `GET PaymentTerm` endpoint and view payment term - information. - 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: string - docs: The name of the payment term. - validation: - maxLength: 255 - is_active: - type: optional - docs: '`True` if the payment term is active, `False` if not.' - company: - type: optional - docs: The subsidiary that the payment term belongs to. - days_until_due: - type: optional - docs: The number of days after the invoice date that payment is due. - validation: - min: -2147483648 - max: 2147483647 - discount_days: - type: optional - docs: The number of days the invoice must be paid before discounts expire. - validation: - min: -2147483648 - max: 2147483647 - remote_last_modified_at: - type: optional - docs: When the third party's payment term was modified. - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - PaymentTypeEnum: - enum: - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - docs: |- - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - source: - openapi: accounting_v3.yml - PostingStatusEnum: - enum: - - UNPOSTED - - POSTED - docs: |- - * `UNPOSTED` - UNPOSTED - * `POSTED` - POSTED - source: - openapi: accounting_v3.yml - ProjectCompany: - discriminated: false - docs: The subsidiary that the project belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - ProjectContact: - discriminated: false - docs: The supplier, or customer involved in the project. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - Project: - docs: >- - # The Project Object - - ### Description - - The `Project` object is used to track and manage time, costs, resources, - and revenue for specific initiatives or work efforts. - - It provides classification on transactions for allocating expenses, - revenue, and activities to a specific project for financial reporting. - - - ### Usage Example - - Fetch from the `GET Project` endpoint and view project information. - 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: string - docs: The project’s name - validation: - maxLength: 255 - is_active: - type: optional - docs: '`True` if the project is active, `False` if the project is not active.' - company: - type: optional - docs: The subsidiary that the project belongs to. - contact: - type: optional - docs: The supplier, or customer involved in the project. - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - PurchaseOrderStatus: - discriminated: false - docs: |- - The purchase order's status. - - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - union: - - PurchaseOrderStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderDeliveryAddress: - discriminated: false - docs: The purchase order's delivery address. - union: - - type: string - validation: - format: uuid - - Address - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderVendor: - discriminated: false - docs: The party fulfilling the purchase order. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderCompany: - discriminated: false - docs: The company the purchase order belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderCurrency: - discriminated: false - docs: >- - The purchase order's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderPaymentTerm: - discriminated: false - docs: The payment term that applies to this transaction. - union: - - type: string - validation: - format: uuid - - PaymentTerm - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderAccountingPeriod: - discriminated: false - docs: The accounting period that the PurchaseOrder was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrder: - docs: >- - # The PurchaseOrder Object - - ### Description - - A `PurchaseOrder` represents a request to purchase goods or services from - a vendor. It outlines the details of the purchase, such as the items or - services requested, quantities, prices, and delivery details. - - - A `PurchaseOrder` is a crucial component of the procurement process, but - does not typically result in any impact on the company’s general ledger. - The general ledger is typically only affected when the `PurchaseOrder` is - fulfilled as an *Accounts Payable* `Invoice` object (also known as a - Bill). - - - ### Usage Example - - Fetch from the `LIST PurchaseOrders` endpoint and view a company's - purchase orders. - 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 - status: - type: optional - docs: |- - The purchase order's status. - - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - issue_date: - type: optional - docs: The purchase order's issue date. - purchase_order_number: - type: optional - docs: The human-readable number of the purchase order. - validation: - maxLength: 100 - delivery_date: - type: optional - docs: The purchase order's delivery date. - delivery_address: - type: optional - docs: The purchase order's delivery address. - customer: - type: optional - docs: The contact making the purchase order. - validation: - format: uuid - vendor: - type: optional - docs: The party fulfilling the purchase order. - memo: - type: optional - docs: A memo attached to the purchase order. - company: - type: optional - docs: The company the purchase order belongs to. - total_amount: - type: optional - docs: The purchase order's total amount. - currency: - type: optional - docs: >- - The purchase order's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The purchase order's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - payment_term: - type: optional - docs: The payment term that applies to this transaction. - line_items: - type: optional> - access: read-only - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - tracking_categories: optional>> - accounting_period: - type: optional - docs: The accounting period that the PurchaseOrder was generated in. - remote_created_at: - type: optional - docs: When the third party's purchase order note was created. - remote_updated_at: - type: optional - docs: When the third party's purchase order note was updated. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - PurchaseOrderLineItemItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderLineItemCurrency: - discriminated: false - docs: >- - The purchase order line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderLineItem: - docs: >- - # The PurchaseOrderLineItem Object - - ### Description - - The `PurchaseOrderLineItem` object is used to represent a purchase order's - line item. - - - ### Usage Example - - Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase - orders. - 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 - description: - type: optional - docs: A description of the good being purchased. - unit_price: - type: optional - docs: The line item's unit price. - quantity: - type: optional - docs: The line item's quantity. - item: optional - account: - type: optional - docs: The purchase order line item's account. - validation: - format: uuid - tracking_category: - type: optional - docs: The purchase order line item's associated tracking category. - validation: - format: uuid - availability: deprecated - tracking_categories: - type: optional>> - docs: The purchase order line item's associated tracking categories. - tax_amount: - type: optional - docs: The purchase order line item's tax amount. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - total_line_amount: - type: optional - docs: The purchase order line item's total amount. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - currency: - type: optional - docs: >- - The purchase order line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - exchange_rate: - type: optional - docs: The purchase order line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the purchase order line item belongs to. - validation: - format: uuid - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - PurchaseOrderLineItemRequestItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderLineItemRequestCurrency: - discriminated: false - docs: >- - The purchase order line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderLineItemRequest: - docs: >- - # The PurchaseOrderLineItem Object - - ### Description - - The `PurchaseOrderLineItem` object is used to represent a purchase order's - line item. - - - ### Usage Example - - Fetch from the `GET PurchaseOrder` endpoint and view a company's purchase - orders. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - description: - type: optional - docs: A description of the good being purchased. - unit_price: - type: optional - docs: The line item's unit price. - quantity: - type: optional - docs: The line item's quantity. - item: optional - account: - type: optional - docs: The purchase order line item's account. - validation: - format: uuid - tracking_category: - type: optional - docs: The purchase order line item's associated tracking category. - validation: - format: uuid - availability: deprecated - tracking_categories: - type: optional>> - docs: The purchase order line item's associated tracking categories. - tax_amount: - type: optional - docs: The purchase order line item's tax amount. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - total_line_amount: - type: optional - docs: The purchase order line item's total amount. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - currency: - type: optional - docs: >- - The purchase order line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - exchange_rate: - type: optional - docs: The purchase order line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the purchase order line item belongs to. - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - PurchaseOrderRequestStatus: - discriminated: false - docs: |- - The purchase order's status. - - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - union: - - PurchaseOrderStatusEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderRequestDeliveryAddress: - discriminated: false - docs: The purchase order's delivery address. - union: - - type: string - validation: - format: uuid - - Address - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderRequestVendor: - discriminated: false - docs: The party fulfilling the purchase order. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderRequestCompany: - discriminated: false - docs: The company the purchase order belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderRequestPaymentTerm: - discriminated: false - docs: The payment term that applies to this transaction. - union: - - type: string - validation: - format: uuid - - PaymentTerm - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderRequestCurrency: - discriminated: false - docs: >- - The purchase order's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - PurchaseOrderRequest: - docs: >- - # The PurchaseOrder Object - - ### Description - - The `PurchaseOrder` object is a record of request for a product or service - between a buyer and seller. - - - ### Usage Example - - Fetch from the `LIST PurchaseOrders` endpoint and view a company's - purchase orders. - properties: - status: - type: optional - docs: |- - The purchase order's status. - - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - issue_date: - type: optional - docs: The purchase order's issue date. - delivery_date: - type: optional - docs: The purchase order's delivery date. - delivery_address: - type: optional - docs: The purchase order's delivery address. - customer: - type: optional - docs: The contact making the purchase order. - validation: - format: uuid - vendor: - type: optional - docs: The party fulfilling the purchase order. - memo: - type: optional - docs: A memo attached to the purchase order. - company: - type: optional - docs: The company the purchase order belongs to. - total_amount: - type: optional - docs: The purchase order's total amount. - payment_term: - type: optional - docs: The payment term that applies to this transaction. - currency: - type: optional - docs: >- - The purchase order's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - exchange_rate: - type: optional - docs: The purchase order's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tracking_categories: optional>> - line_items: optional> - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - PurchaseOrderResponse: - properties: - model: PurchaseOrder - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - PurchaseOrderStatusEnum: - enum: - - DRAFT - - SUBMITTED - - AUTHORIZED - - BILLED - - DELETED - docs: |- - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `AUTHORIZED` - AUTHORIZED - * `BILLED` - BILLED - * `DELETED` - DELETED - source: - openapi: accounting_v3.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: accounting_v3.yml - RemoteEndpointInfo: - properties: - method: string - url_path: string - field_traversal_path: list - source: - openapi: accounting_v3.yml - RemoteFieldRemoteFieldClass: - discriminated: false - union: - - string - - RemoteFieldClass - source: - openapi: accounting_v3.yml - inline: true - RemoteField: - properties: - remote_field_class: RemoteFieldRemoteFieldClass - value: optional - source: - openapi: accounting_v3.yml - RemoteFieldApiCoverage: - discriminated: false - union: - - integer - - double - source: - openapi: accounting_v3.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: accounting_v3.yml - RemoteFieldApiResponse: - properties: - Account: optional> - AccountingAttachment: optional> - BalanceSheet: optional> - CashFlowStatement: optional> - CompanyInfo: optional> - Contact: optional> - IncomeStatement: optional> - CreditNote: optional> - Item: optional> - PurchaseOrder: optional> - TrackingCategory: optional> - JournalEntry: optional> - TaxRate: optional> - Invoice: optional> - Payment: optional> - Expense: optional> - VendorCredit: optional> - Transaction: optional> - AccountingPeriod: optional> - GeneralLedgerTransaction: optional> - BankFeedAccount: optional> - Employee: optional> - PaymentMethod: optional> - Project: optional> - PaymentTerm: optional> - source: - openapi: accounting_v3.yml - RemoteFieldClass: - properties: - id: optional - display_name: optional - remote_key_name: optional - description: optional - is_custom: optional - is_required: optional - field_type: optional - field_format: optional - field_choices: optional> - item_schema: optional - source: - openapi: accounting_v3.yml - RemoteFieldRequestRemoteFieldClass: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteFieldClass - source: - openapi: accounting_v3.yml - inline: true - RemoteFieldRequest: - properties: - remote_field_class: RemoteFieldRequestRemoteFieldClass - value: optional - source: - openapi: accounting_v3.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: accounting_v3.yml - 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: accounting_v3.yml - ReportItem: - docs: >- - # The ReportItem Object - - ### Description - - The `ReportItem` object is used to represent a report item for a Balance - Sheet, Cash Flow Statement or Profit and Loss Report. - - - ### Usage Example - - Fetch from the `GET BalanceSheet` endpoint and view the balance sheet's - report items. - properties: - 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 report item's name. - value: - type: optional - docs: The report item's value. - sub_items: - type: optional>> - access: read-only - company: - type: optional - docs: The company the report item belongs to. - validation: - format: uuid - 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/). - source: - openapi: accounting_v3.yml - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - docs: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - source: - openapi: accounting_v3.yml - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - docs: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - source: - openapi: accounting_v3.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: accounting_v3.yml - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - docs: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - source: - openapi: accounting_v3.yml - Status7D1Enum: - enum: - - ACTIVE - - ARCHIVED - docs: |- - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - source: - openapi: accounting_v3.yml - Status895Enum: - enum: - - ACTIVE - - INACTIVE - docs: |- - * `ACTIVE` - ACTIVE - * `INACTIVE` - INACTIVE - source: - openapi: accounting_v3.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: accounting_v3.yml - SyncStatusLastSyncResult: - discriminated: false - union: - - LastSyncResultEnum - - string - source: - openapi: accounting_v3.yml - inline: true - SyncStatusStatus: - discriminated: false - union: - - StatusFd5Enum - - string - source: - openapi: accounting_v3.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: accounting_v3.yml - TaxComponentComponentType: - discriminated: false - docs: >- - Returns PURCHASE if the tax component corresponds to a purchase tax or - SALES if the tax component corresponds to a sales tax. - - - * `SALES` - SALES - - * `PURCHASE` - PURCHASE - union: - - ComponentTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - TaxComponent: - docs: >- - # The TaxRate Object - - ### Description - - The `TaxComponent` object is used to represent any sub-taxes that make up - the `TaxRate`. - - - ### Usage Example - - Fetch from the `LIST TaxRates` endpoint and view tax components relevant - to a tax rate. - 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 tax rate’s name. - validation: - maxLength: 100 - rate: - type: optional - docs: The tax component’s rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - is_compound: - type: optional - docs: Returns True if the tax component is compound, False if not. - component_type: - type: optional - docs: >- - Returns PURCHASE if the tax component corresponds to a purchase tax or - SALES if the tax component corresponds to a sales tax. - - - * `SALES` - SALES - - * `PURCHASE` - PURCHASE - 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 - source: - openapi: accounting_v3.yml - TaxRateCompany: - discriminated: false - docs: >- - The subsidiary that the tax rate belongs to (in the case of multi-entity - systems). - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - TaxRateStatus: - discriminated: false - docs: >- - The tax rate’s status - `ACTIVE` if an active tax rate, `ARCHIVED` if not - active. - - - * `ACTIVE` - ACTIVE - - * `ARCHIVED` - ARCHIVED - union: - - Status7D1Enum - - string - source: - openapi: accounting_v3.yml - inline: true - TaxRateTaxComponentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TaxComponent - source: - openapi: accounting_v3.yml - inline: true - TaxRate: - docs: >- - # The TaxRate Object - - ### Description - - The `TaxRate` object is used to represent a tax rate. - - - ### Usage Example - - Fetch from the `LIST TaxRates` endpoint and view tax rates relevant to a - company. - 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 - company: - type: optional - docs: >- - The subsidiary that the tax rate belongs to (in the case of - multi-entity systems). - code: - type: optional - docs: >- - The tax code associated with this tax rate or group of tax rates from - the third-party platform. - validation: - maxLength: 100 - name: - type: optional - docs: The tax rate’s name. - validation: - maxLength: 100 - description: - type: optional - docs: The tax rate's description. - status: - type: optional - docs: >- - The tax rate’s status - `ACTIVE` if an active tax rate, `ARCHIVED` if - not active. - - - * `ACTIVE` - ACTIVE - - * `ARCHIVED` - ARCHIVED - country: - type: optional - docs: The country the tax rate is associated with. - validation: - maxLength: 100 - total_tax_rate: - type: optional - docs: The tax’s total tax rate - sum of the tax components (not compounded). - effective_tax_rate: - type: optional - docs: >- - The tax rate’s effective tax rate - total amount of tax with - compounding. - tax_components: - type: optional> - docs: The related tax components of the tax rate. - 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: accounting_v3.yml - TrackingCategoryStatus: - discriminated: false - docs: |- - The tracking category's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - union: - - Status7D1Enum - - string - source: - openapi: accounting_v3.yml - inline: true - TrackingCategoryCategoryType: - discriminated: false - docs: |- - The tracking category’s type. - - * `CLASS` - CLASS - * `DEPARTMENT` - DEPARTMENT - union: - - CategoryTypeEnum - - string - source: - openapi: accounting_v3.yml - inline: true - TrackingCategoryCompany: - discriminated: false - docs: The company the GeneralLedgerTransaction belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - TrackingCategory: - docs: >- - # The TrackingCategory Object - - ### Description - - A `TrackingCategory` object represents a categorization method used to - classify transactions within an accounting platform. They are often used - to group records for reporting and analysis purposes. The most common - types of `TrackingCategories` are Classes and Departments. - - - ### Usage Example - - Fetch from the `GET TrackingCategory` endpoint and view a company's - tracking category. - 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 tracking category's name. - status: - type: optional - docs: |- - The tracking category's status. - - * `ACTIVE` - ACTIVE - * `ARCHIVED` - ARCHIVED - category_type: - type: optional - docs: |- - The tracking category’s type. - - * `CLASS` - CLASS - * `DEPARTMENT` - DEPARTMENT - parent_category: - type: optional - validation: - format: uuid - company: - type: optional - docs: The company the GeneralLedgerTransaction belongs to. - 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: accounting_v3.yml - TransactionAccount: - discriminated: false - docs: The transaction's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - TransactionContact: - discriminated: false - docs: The contact to whom the transaction relates to. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - TransactionCurrency: - discriminated: false - docs: >- - The transaction's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - TransactionTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - TransactionAccountingPeriod: - discriminated: false - docs: The accounting period that the Transaction was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - Transaction: - docs: >- - # The Transaction Object - - ### Description - - The `Transaction` common model includes records of all types of - transactions that do not appear in other common models. The type of - transaction can be identified through the type field. More specifically, - it will contain all types of transactions outside of: - - * __Credit Notes__ - - * __Expenses__ - - * __Invoices__ - - * __Journal Entries__ - - * __Payments__ - - * __Purchase Orders__ - - * __Vendor Credits__ - - - ### Usage Example - - Fetch from the `GET Transaction` endpoint and view a company's - transactions. - 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 - transaction_type: - type: optional - docs: >- - The type of transaction, which can by any transaction object not - already included in Merge’s common model. - number: - type: optional - docs: The transaction's number used for identifying purposes. - transaction_date: - type: optional - docs: The date upon which the transaction occurred. - account: - type: optional - docs: The transaction's account. - contact: - type: optional - docs: The contact to whom the transaction relates to. - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - total_amount: - type: optional - docs: The total amount being paid after taxes. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - currency: - type: optional - docs: >- - The transaction's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The transaction's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the transaction belongs to. - validation: - format: uuid - tracking_categories: optional>> - line_items: - type: optional> - access: read-only - 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 - accounting_period: - type: optional - docs: The accounting period that the Transaction was generated in. - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - TransactionCurrencyEnum: - enum: - - XUA - - AFN - - AFA - - ALL - - ALK - - DZD - - ADP - - AOA - - AOK - - AON - - AOR - - ARA - - ARS - - ARM - - ARP - - ARL - - AMD - - AWG - - AUD - - ATS - - AZN - - AZM - - BSD - - BHD - - BDT - - BBD - - BYN - - BYB - - BYR - - BEF - - BEC - - BEL - - BZD - - BMD - - BTN - - BOB - - BOL - - BOV - - BOP - - BAM - - BAD - - BAN - - BWP - - BRC - - BRZ - - BRE - - BRR - - BRN - - BRB - - BRL - - GBP - - BND - - BGL - - BGN - - BGO - - BGM - - BUK - - BIF - - XPF - - KHR - - CAD - - CVE - - KYD - - XAF - - CLE - - CLP - - CLF - - CNX - - CNY - - CNH - - COP - - COU - - KMF - - CDF - - CRC - - HRD - - HRK - - CUC - - CUP - - CYP - - CZK - - CSK - - DKK - - DJF - - DOP - - NLG - - XCD - - DDM - - ECS - - ECV - - EGP - - GQE - - ERN - - EEK - - ETB - - EUR - - XBA - - XEU - - XBB - - XBC - - XBD - - FKP - - FJD - - FIM - - FRF - - XFO - - XFU - - GMD - - GEK - - GEL - - DEM - - GHS - - GHC - - GIP - - XAU - - GRD - - GTQ - - GWP - - GNF - - GNS - - GYD - - HTG - - HNL - - HKD - - HUF - - IMP - - ISK - - ISJ - - INR - - IDR - - IRR - - IQD - - IEP - - ILS - - ILP - - ILR - - ITL - - JMD - - JPY - - JOD - - KZT - - KES - - KWD - - KGS - - LAK - - LVL - - LVR - - LBP - - LSL - - LRD - - LYD - - LTL - - LTT - - LUL - - LUC - - LUF - - MOP - - MKD - - MKN - - MGA - - MGF - - MWK - - MYR - - MVR - - MVP - - MLF - - MTL - - MTP - - MRU - - MRO - - MUR - - MXV - - MXN - - MXP - - MDC - - MDL - - MCF - - MNT - - MAD - - MAF - - MZE - - MZN - - MZM - - MMK - - NAD - - NPR - - ANG - - TWD - - NZD - - NIO - - NIC - - NGN - - KPW - - NOK - - OMR - - PKR - - XPD - - PAB - - PGK - - PYG - - PEI - - PEN - - PES - - PHP - - XPT - - PLN - - PLZ - - PTE - - GWE - - QAR - - XRE - - RHD - - RON - - ROL - - RUB - - RUR - - RWF - - SVC - - WST - - SAR - - RSD - - CSD - - SCR - - SLL - - XAG - - SGD - - SKK - - SIT - - SBD - - SOS - - ZAR - - ZAL - - KRH - - KRW - - KRO - - SSP - - SUR - - ESP - - ESA - - ESB - - XDR - - LKR - - SHP - - XSU - - SDD - - SDG - - SDP - - SRD - - SRG - - SZL - - SEK - - CHF - - SYP - - STN - - STD - - TVD - - TJR - - TJS - - TZS - - XTS - - THB - - XXX - - TPE - - TOP - - TTD - - TND - - TRY - - TRL - - TMT - - TMM - - USD - - USN - - USS - - UGX - - UGS - - UAH - - UAK - - AED - - UYW - - UYU - - UYP - - UYI - - UZS - - VUV - - VES - - VEB - - VEF - - VND - - VNN - - CHE - - CHW - - XOF - - YDD - - YER - - YUN - - YUD - - YUM - - YUR - - ZWN - - ZRN - - ZRZ - - ZMW - - ZMK - - ZWD - - ZWR - - ZWL - docs: >- - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - source: - openapi: accounting_v3.yml - TransactionLineItemItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Item - source: - openapi: accounting_v3.yml - inline: true - TransactionLineItemCurrency: - discriminated: false - docs: >- - The line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - TransactionLineItem: - docs: >- - # The TransactionLineItem Object - - ### Description - - The `TransactionLineItem` object is used to represent a transaction's line - items. - - - ### Usage Example - - Fetch from the `GET TransactionLineItem` endpoint and view the - transaction's line items. - 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 - memo: - type: optional - docs: >- - An internal note used by the business to clarify purpose of the - transaction. - unit_price: - type: optional - docs: The line item's unit price. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - quantity: - type: optional - docs: The line item's quantity. - validation: - pattern: ^-?\d{0,24}(?:\.\d{0,8})?$ - item: optional - account: - type: optional - docs: The line item's account. - validation: - format: uuid - tracking_category: - type: optional - docs: The line's associated tracking category. - validation: - format: uuid - availability: deprecated - tracking_categories: - type: optional>> - docs: The transaction line item's associated tracking categories. - total_line_amount: - type: optional - docs: The line item's total. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - currency: - type: optional - docs: >- - The line item's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - company: - type: optional - docs: The company the line belongs to. - validation: - format: uuid - 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 - source: - openapi: accounting_v3.yml - Type2BbEnum: - enum: - - INVENTORY - - NON_INVENTORY - - SERVICE - - UNKNOWN - docs: |- - * `INVENTORY` - INVENTORY - * `NON_INVENTORY` - NON_INVENTORY - * `SERVICE` - SERVICE - * `UNKNOWN` - UNKNOWN - source: - openapi: accounting_v3.yml - UnderlyingTransactionTypeEnum: - enum: - - INVOICE - - EXPENSE - - TRANSACTION - - JOURNAL_ENTRY - - PAYMENT - - VENDOR_CREDIT - - CREDIT_NOTE - docs: |- - * `INVOICE` - INVOICE - * `EXPENSE` - EXPENSE - * `TRANSACTION` - TRANSACTION - * `JOURNAL_ENTRY` - JOURNAL_ENTRY - * `PAYMENT` - PAYMENT - * `VENDOR_CREDIT` - VENDOR_CREDIT - * `CREDIT_NOTE` - CREDIT_NOTE - source: - openapi: accounting_v3.yml - ValidationProblemSource: - properties: - pointer: string - source: - openapi: accounting_v3.yml - VendorCreditVendor: - discriminated: false - docs: The vendor that owes the gift or refund. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - VendorCreditCurrency: - discriminated: false - docs: >- - The vendor credit's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - VendorCreditCompany: - discriminated: false - docs: The company the vendor credit belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - VendorCreditTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - VendorCreditAccountingPeriod: - discriminated: false - docs: The accounting period that the VendorCredit was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - VendorCredit: - docs: >- - # The VendorCredit Object - - ### Description - - A `VendorCredit` is transaction issued by a vendor to the accounting - company, indicating a reduction or cancellation of the amount owed to the - vendor. It is most generally used as an adjustment note used to rectify - errors, returns, or overpayments related to a purchasing transaction. A - `VendorCredit` can be applied to `Accounts Payable` Invoices to decrease - the overall amount of the `Invoice`. - - - ### Usage Example - - Fetch from the `GET VendorCredit` endpoint and view a company's vendor - credits. - 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 - number: - type: optional - docs: The vendor credit's number. - transaction_date: - type: optional - docs: The vendor credit's transaction date. - vendor: - type: optional - docs: The vendor that owes the gift or refund. - total_amount: - type: optional - docs: The vendor credit's total amount. - currency: - type: optional - docs: >- - The vendor credit's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The vendor credit's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - company: - type: optional - docs: The company the vendor credit belongs to. - lines: - type: optional> - access: read-only - tracking_categories: optional>> - applied_to_lines: - type: optional> - docs: A list of VendorCredit Applied to Lines objects. - 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 - accounting_period: - type: optional - docs: The accounting period that the VendorCredit was generated in. - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: accounting_v3.yml - VendorCreditApplyLineForInvoiceVendorCredit: - discriminated: false - union: - - type: string - validation: - format: uuid - - VendorCredit - source: - openapi: accounting_v3.yml - inline: true - VendorCreditApplyLineForInvoice: - docs: >- - # The VendorCreditApplyLine Object - - ### Description - - The `VendorCreditApplyLine` object is used to represent a applied vendor - credit. - - - ### Usage Example - - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's - applied to lines. - properties: - 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 - vendor_credit: optional - applied_date: - type: optional - docs: Date that the vendor credit is applied to the invoice. - applied_amount: - type: optional - docs: The amount of the VendorCredit applied to the invoice. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - 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 - source: - openapi: accounting_v3.yml - VendorCreditApplyLineForVendorCreditInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: accounting_v3.yml - inline: true - VendorCreditApplyLineForVendorCredit: - docs: >- - # The VendorCreditApplyLine Object - - ### Description - - The `VendorCreditApplyLine` object is used to represent a applied vendor - credit. - - - ### Usage Example - - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's - applied to lines. - properties: - 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 - invoice: optional - applied_date: - type: optional - docs: Date that the vendor credit is applied to the invoice. - applied_amount: - type: optional - docs: The amount of the VendorCredit applied to the invoice. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - 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 - source: - openapi: accounting_v3.yml - VendorCreditApplyLineForVendorCreditRequestInvoice: - discriminated: false - union: - - type: string - validation: - format: uuid - - Invoice - source: - openapi: accounting_v3.yml - inline: true - VendorCreditApplyLineForVendorCreditRequest: - docs: >- - # The VendorCreditApplyLine Object - - ### Description - - The `VendorCreditApplyLine` object is used to represent a applied vendor - credit. - - - ### Usage Example - - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's - applied to lines. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - invoice: optional - applied_date: - type: optional - docs: Date that the vendor credit is applied to the invoice. - applied_amount: - type: optional - docs: The amount of the VendorCredit applied to the invoice. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - VendorCreditLineAccount: - discriminated: false - docs: The line's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - VendorCreditLineProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - VendorCreditLineContact: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - VendorCreditLine: - docs: >- - # The VendorCreditLine Object - - ### Description - - The `VendorCreditLine` object is used to represent a vendor credit's line - items. - - - ### Usage Example - - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's - line items. - 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 - net_amount: - type: optional - docs: The full value of the credit. - tracking_category: - type: optional - docs: The line's associated tracking category. - validation: - format: uuid - availability: deprecated - tracking_categories: - type: optional>> - docs: The vendor credit line item's associated tracking categories. - description: - type: optional - docs: The line's description. - account: - type: optional - docs: The line's account. - company: - type: optional - docs: The company the line belongs to. - validation: - format: uuid - project: optional - contact: optional - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - exchange_rate: - type: optional - docs: The vendor credit line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - 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 - source: - openapi: accounting_v3.yml - VendorCreditLineRequestAccount: - discriminated: false - docs: The line's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: accounting_v3.yml - inline: true - VendorCreditLineRequestProject: - discriminated: false - union: - - type: string - validation: - format: uuid - - Project - source: - openapi: accounting_v3.yml - inline: true - VendorCreditLineRequestContact: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - VendorCreditLineRequest: - docs: >- - # The VendorCreditLine Object - - ### Description - - The `VendorCreditLine` object is used to represent a vendor credit's line - items. - - - ### Usage Example - - Fetch from the `GET VendorCredit` endpoint and view the vendor credit's - line items. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - net_amount: - type: optional - docs: The full value of the credit. - tracking_category: - type: optional - docs: The line's associated tracking category. - validation: - format: uuid - availability: deprecated - tracking_categories: - type: optional>> - docs: The vendor credit line item's associated tracking categories. - description: - type: optional - docs: The line's description. - account: - type: optional - docs: The line's account. - company: - type: optional - docs: The company the line belongs to. - validation: - format: uuid - project: optional - contact: optional - tax_rate: - type: optional - docs: The tax rate that applies to this line item. - validation: - format: uuid - exchange_rate: - type: optional - docs: The vendor credit line item's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - VendorCreditRequestVendor: - discriminated: false - docs: The vendor that owes the gift or refund. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: accounting_v3.yml - inline: true - VendorCreditRequestCurrency: - discriminated: false - docs: >- - The vendor credit's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - TransactionCurrencyEnum - - string - source: - openapi: accounting_v3.yml - inline: true - VendorCreditRequestCompany: - discriminated: false - docs: The company the vendor credit belongs to. - union: - - type: string - validation: - format: uuid - - CompanyInfo - source: - openapi: accounting_v3.yml - inline: true - VendorCreditRequestTrackingCategoriesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - TrackingCategory - source: - openapi: accounting_v3.yml - inline: true - VendorCreditRequestAccountingPeriod: - discriminated: false - docs: The accounting period that the VendorCredit was generated in. - union: - - type: string - validation: - format: uuid - - AccountingPeriod - source: - openapi: accounting_v3.yml - inline: true - VendorCreditRequest: - docs: >- - # The VendorCredit Object - - ### Description - - A `VendorCredit` is transaction issued by a vendor to the accounting - company, indicating a reduction or cancellation of the amount owed to the - vendor. It is most generally used as an adjustment note used to rectify - errors, returns, or overpayments related to a purchasing transaction. A - `VendorCredit` can be applied to `Accounts Payable` Invoices to decrease - the overall amount of the `Invoice`. - - - ### Usage Example - - Fetch from the `GET VendorCredit` endpoint and view a company's vendor - credits. - properties: - number: - type: optional - docs: The vendor credit's number. - transaction_date: - type: optional - docs: The vendor credit's transaction date. - vendor: - type: optional - docs: The vendor that owes the gift or refund. - total_amount: - type: optional - docs: The vendor credit's total amount. - currency: - type: optional - docs: >- - The vendor credit's currency. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - exchange_rate: - type: optional - docs: The vendor credit's exchange rate. - validation: - pattern: ^-?\d{0,32}(?:\.\d{0,16})?$ - inclusive_of_tax: - type: optional - docs: >- - If the transaction is inclusive or exclusive of tax. `True` if - inclusive, `False` if exclusive. - company: - type: optional - docs: The company the vendor credit belongs to. - tracking_categories: optional>> - applied_to_lines: - type: optional> - docs: A list of VendorCredit Applied to Lines objects. - accounting_period: - type: optional - docs: The accounting period that the VendorCredit was generated in. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: accounting_v3.yml - VendorCreditResponse: - properties: - model: VendorCredit - warnings: list - errors: list - logs: optional> - source: - openapi: accounting_v3.yml - WarningValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: accounting_v3.yml - WebhookReceiver: - properties: - event: string - is_active: boolean - key: optional - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/accountDetails.yml b/.mock/definition/Accounting/accountDetails.yml deleted file mode 100644 index 865ea0552..000000000 --- a/.mock/definition/Accounting/accountDetails.yml +++ /dev/null @@ -1,38 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /accounting/v1/account-details - method: GET - auth: - - tokenAuth: [] - docs: Get details for a linked account. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/accountToken.yml b/.mock/definition/Accounting/accountToken.yml deleted file mode 100644 index 5218fcc77..000000000 --- a/.mock/definition/Accounting/accountToken.yml +++ /dev/null @@ -1,47 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /accounting/v1/account-token/{public_token} - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns the account token for the end user with the provided public - token. - source: - openapi: accounting_v3.yml - path-parameters: - public_token: string - response: - docs: '' - type: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/accountingPeriods.yml b/.mock/definition/Accounting/accountingPeriods.yml deleted file mode 100644 index 871b63667..000000000 --- a/.mock/definition/Accounting/accountingPeriods.yml +++ /dev/null @@ -1,136 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/accounting-periods - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `AccountingPeriod` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: AccountingPeriodsListRequest - query-parameters: - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedAccountingPeriodList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 3015f7b1-4d01-460d-bfab-02a52d16cbd0 - remote_id: '2804580' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: April 2020 Financials - status: ACTIVE - start_date: '2020-03-31T00:00:00Z' - end_date: '2020-05-01T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/accounting-periods/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `AccountingPeriod` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: AccountingPeriodsRetrieveRequest - 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: accountingRoot.AccountingPeriod - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 3015f7b1-4d01-460d-bfab-02a52d16cbd0 - remote_id: '2804580' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: April 2020 Financials - status: ACTIVE - start_date: '2020-03-31T00:00:00Z' - end_date: '2020-05-01T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/accounts.yml b/.mock/definition/Accounting/accounts.yml deleted file mode 100644 index f1fb20b8b..000000000 --- a/.mock/definition/Accounting/accounts.yml +++ /dev/null @@ -1,556 +0,0 @@ -types: - AccountsListRequestClassification: - enum: - - value: '' - name: EMPTY - - ASSET - - EQUITY - - EXPENSE - - LIABILITY - - REVENUE - source: - openapi: accounting_v3.yml - AccountsListRequestRemoteFields: - enum: - - classification - - value: classification,status - name: ClassificationStatus - - status - source: - openapi: accounting_v3.yml - AccountsListRequestShowEnumOrigins: - enum: - - classification - - value: classification,status - name: ClassificationStatus - - status - source: - openapi: accounting_v3.yml - AccountsListRequestStatus: - enum: - - value: '' - name: EMPTY - - ACTIVE - - INACTIVE - - PENDING - source: - openapi: accounting_v3.yml - AccountsRetrieveRequestRemoteFields: - enum: - - classification - - value: classification,status - name: ClassificationStatus - - status - source: - openapi: accounting_v3.yml - AccountsRetrieveRequestShowEnumOrigins: - enum: - - classification - - value: classification,status - name: ClassificationStatus - - status - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/accounts - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Account` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: AccountsListRequest - query-parameters: - account_type: - type: optional - docs: If provided, will only return accounts with the passed in enum. - classification: - type: optional - docs: If provided, will only return accounts with this classification. - company_id: - type: optional - docs: If provided, will only return accounts for this company. - 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> - allow-multiple: true - 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. - name: - type: optional - docs: If provided, will only return Accounts with this name. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional - docs: >- - 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) - status: - type: optional - docs: If provided, will only return accounts with this status. - response: - docs: '' - type: accountingRoot.PaginatedAccountList - status-code: 200 - examples: - - query-parameters: - account_type: account_type - classification: '' - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - remote_fields: classification - remote_id: remote_id - show_enum_origins: classification - status: '' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '21' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Cash - description: Cash - classification: ASSET - type: Asset - account_type: BANK - status: ACTIVE - current_balance: 1.1 - currency: XUA - account_number: X12Y9AB - parent_account: 22d92d6c-22f9-11ed-861d-0242ac120002 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - create: - path: /accounting/v1/accounts - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Account` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: AccountEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.AccountRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.AccountResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '21' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Cash - description: Cash - classification: ASSET - type: Asset - account_type: BANK - status: ACTIVE - current_balance: 1.1 - currency: XUA - account_number: X12Y9AB - parent_account: 22d92d6c-22f9-11ed-861d-0242ac120002 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - 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 - retrieve: - path: /accounting/v1/accounts/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Account` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: AccountsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: accountingRoot.Account - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: classification - show_enum_origins: classification - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '21' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Cash - description: Cash - classification: ASSET - type: Asset - account_type: BANK - status: ACTIVE - current_balance: 1.1 - currency: XUA - account_number: X12Y9AB - parent_account: 22d92d6c-22f9-11ed-861d-0242ac120002 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - metaPostRetrieve: - path: /accounting/v1/accounts/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Account` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/addresses.yml b/.mock/definition/Accounting/addresses.yml deleted file mode 100644 index c7dc06e93..000000000 --- a/.mock/definition/Accounting/addresses.yml +++ /dev/null @@ -1,68 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /accounting/v1/addresses/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Address` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: AddressesRetrieveRequest - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.Address - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: type - show_enum_origins: type - headers: - X-Account-Token: X-Account-Token - response: - body: - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - type: BILLING - street_1: 2920 Broadway - street_2: 2nd Floor - city: New York - state: - key: value - country_subdivision: NY - country: AF - zip_code: '10027' - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/asyncPassthrough.yml b/.mock/definition/Accounting/asyncPassthrough.yml deleted file mode 100644 index 72b58442c..000000000 --- a/.mock/definition/Accounting/asyncPassthrough.yml +++ /dev/null @@ -1,74 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /accounting/v1/async-passthrough - method: POST - auth: - - tokenAuth: [] - docs: >- - Asynchronously pull data from an endpoint not currently supported by - Merge. - source: - openapi: accounting_v3.yml - request: - body: accountingRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.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: /accounting/v1/async-passthrough/{async_passthrough_receipt_id} - method: GET - auth: - - tokenAuth: [] - docs: Retrieves data from earlier async-passthrough POST request - source: - openapi: accounting_v3.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: accounting_v3.yml -types: - AsyncPassthroughRetrieveResponse: - discriminated: false - union: - - accountingRoot.RemoteResponse - - string - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/asyncTasks.yml b/.mock/definition/Accounting/asyncTasks.yml deleted file mode 100644 index f4ca6af13..000000000 --- a/.mock/definition/Accounting/asyncTasks.yml +++ /dev/null @@ -1,83 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /accounting/v1/async-tasks/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `AsyncPostTask` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - response: - docs: '' - type: accountingRoot.AsyncPostTask - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - status: QUEUED - result: - status_code: 201 - response: - model: - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '990110' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - integration_params: - unique_integration_field: unique_integration_field_value - linked_account_params: - unique_linked_account_field: unique_linked_account_field_value - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - type: ACCOUNTS_RECEIVABLE - contact: 022a2bef-57e5-4def-8ed2-7c41bd9a5ed8 - number: AIQ12546 - issue_date: '2020-03-31T00:00:00Z' - due_date: '2020-04-15T00:00:00Z' - memo: Weekly Payment - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - paid_on_date: '2020-04-01T00:00:00Z' - currency: USD - exchange_rate: '2.9' - status: DRAFT - total_discount: 0 - sub_total: 100 - total_tax_amount: 5 - total_amount: 105 - balance: 105 - inclusive_of_tax: false - remote_updated_at: '2020-04-01T00:00:00Z' - tracking_categories: - - 7dc5ca17-d311-44cd-9ce0-333080367a18 - - 6aa0700c-48e1-4c4a-8162-02e6a582df05 - - 8c933d61-8f5b-4360-ac0c-c9dc87bee763 - purchase_orders: - - e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7 - - dd70ca2f-b120-46fa-889a-9604037f45fd - - 889b281d-739c-4759-95b8-0aedb3947131 - accounting_period: 7dc5ca17-d311-44cd-9ce0-333080367a18 - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 9017594e-dc33-4113-a5d2-b0f928e34fdd - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/attachments.yml b/.mock/definition/Accounting/attachments.yml deleted file mode 100644 index fd49f37f5..000000000 --- a/.mock/definition/Accounting/attachments.yml +++ /dev/null @@ -1,432 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/attachments - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `AccountingAttachment` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: AttachmentsListRequest - query-parameters: - company_id: - type: optional - docs: >- - If provided, will only return accounting attachments for this - company. - 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: accountingRoot.PaginatedAccountingAttachmentList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '1018270' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - file_name: invoice.png - file_url: >- - https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - create: - path: /accounting/v1/attachments - method: POST - auth: - - tokenAuth: [] - docs: Creates an `AccountingAttachment` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: AccountingAttachmentEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.AccountingAttachmentRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.AccountingAttachmentResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '1018270' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - file_name: invoice.png - file_url: >- - https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - 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 - retrieve: - path: /accounting/v1/attachments/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `AccountingAttachment` object with the given `id`. - source: - openapi: accounting_v3.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: accountingRoot.AccountingAttachment - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '1018270' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - file_name: invoice.png - file_url: >- - https://merge-brand.s3.amazonaws.com/20210315/rect-logo-270x80%402x.png - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - metaPostRetrieve: - path: /accounting/v1/attachments/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `AccountingAttachment` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/auditTrail.yml b/.mock/definition/Accounting/auditTrail.yml deleted file mode 100644 index f8feeb9b3..000000000 --- a/.mock/definition/Accounting/auditTrail.yml +++ /dev/null @@ -1,108 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/audit-trail - method: GET - auth: - - tokenAuth: [] - docs: Gets a list of audit trail events. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.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: accountingRoot.PaginatedAuditLogEventList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - event_type: event_type - page_size: 1 - start_date: start_date - user_email: user_email - 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: accounting_v3.yml diff --git a/.mock/definition/Accounting/availableActions.yml b/.mock/definition/Accounting/availableActions.yml deleted file mode 100644 index 8a30ab4bd..000000000 --- a/.mock/definition/Accounting/availableActions.yml +++ /dev/null @@ -1,52 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /accounting/v1/available-actions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of models and actions available for an account. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/balanceSheets.yml b/.mock/definition/Accounting/balanceSheets.yml deleted file mode 100644 index 7f0352bc4..000000000 --- a/.mock/definition/Accounting/balanceSheets.yml +++ /dev/null @@ -1,266 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/balance-sheets - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `BalanceSheet` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: BalanceSheetsListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return balance sheets for this company. - 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> - allow-multiple: true - 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: accountingRoot.PaginatedBalanceSheetList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '8937018' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: BalanceSheet - currency: XUA - company: company - date: '2021-10-01T00:00:00Z' - net_assets: 1000 - assets: - - remote_id: '10010' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Assets - value: 1000 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - liabilities: - - remote_id: '10011' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Liabilities - value: 500 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - equity: - - remote_id: '10012' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Equity - value: 500 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - remote_generated_at: '2021-10-01T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /accounting/v1/balance-sheets/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `BalanceSheet` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: BalanceSheetsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: accountingRoot.BalanceSheet - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '8937018' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: BalanceSheet - currency: XUA - company: company - date: '2021-10-01T00:00:00Z' - net_assets: 1000 - assets: - - remote_id: '10010' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Assets - value: 1000 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - liabilities: - - remote_id: '10011' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Liabilities - value: 500 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - equity: - - remote_id: '10012' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Equity - value: 500 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - remote_generated_at: '2021-10-01T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/bankFeedAccounts.yml b/.mock/definition/Accounting/bankFeedAccounts.yml deleted file mode 100644 index edf14a7a9..000000000 --- a/.mock/definition/Accounting/bankFeedAccounts.yml +++ /dev/null @@ -1,412 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/bank-feed-accounts - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `BankFeedAccount` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: BankFeedAccountsListRequest - query-parameters: - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedBankFeedAccountList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_account_id: '123566909' - target_account_id: 49cd5a42-b311-4750-9361-52e2ed1d4653 - source_account_name: Travel Bank Account - source_account_number: '12567' - target_account_name: Netsuite Travel Bank Account - currency: XUA - feed_status: ACTIVE - feed_start_date: '2024-02-02T00:00:00Z' - source_account_balance: 123.94 - account_type: BANK - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - null - create: - path: /accounting/v1/bank-feed-accounts - method: POST - auth: - - tokenAuth: [] - docs: Creates a `BankFeedAccount` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: BankFeedAccountEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.BankFeedAccountRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.BankFeedAccountResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_account_id: '123566909' - target_account_id: 49cd5a42-b311-4750-9361-52e2ed1d4653 - source_account_name: Travel Bank Account - source_account_number: '12567' - target_account_name: Netsuite Travel Bank Account - currency: XUA - feed_status: ACTIVE - feed_start_date: '2024-02-02T00:00:00Z' - source_account_balance: 123.94 - account_type: BANK - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - key: value - 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 - retrieve: - path: /accounting/v1/bank-feed-accounts/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `BankFeedAccount` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: BankFeedAccountsRetrieveRequest - 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: accountingRoot.BankFeedAccount - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_account_id: '123566909' - target_account_id: 49cd5a42-b311-4750-9361-52e2ed1d4653 - source_account_name: Travel Bank Account - source_account_number: '12567' - target_account_name: Netsuite Travel Bank Account - currency: XUA - feed_status: ACTIVE - feed_start_date: '2024-02-02T00:00:00Z' - source_account_balance: 123.94 - account_type: BANK - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - key: value - metaPostRetrieve: - path: /accounting/v1/bank-feed-accounts/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `BankFeedAccount` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/bankFeedTransactions.yml b/.mock/definition/Accounting/bankFeedTransactions.yml deleted file mode 100644 index 8a23cacb8..000000000 --- a/.mock/definition/Accounting/bankFeedTransactions.yml +++ /dev/null @@ -1,435 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/bank-feed-transactions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `BankFeedTransaction` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: BankFeedTransactionsListRequest - 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> - allow-multiple: true - 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). - is_processed: - type: optional - docs: >- - If provided, will only return bank feed transactions with this - is_processed value - 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: accountingRoot.PaginatedBankFeedTransactionList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_processed: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - bank_feed_account: bank_feed_account - transaction_date: '2024-02-02T00:00:00Z' - posted_date: '2024-02-03T00:00:00Z' - amount: 100.1 - description: Lunch expense - transaction_type: payment - payee: Elmo's diner - credit_or_debit: CREDIT - source_transaction_id: '124569' - remote_was_deleted: true - is_processed: true - create: - path: /accounting/v1/bank-feed-transactions - method: POST - auth: - - tokenAuth: [] - docs: Creates a `BankFeedTransaction` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: BankFeedTransactionEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.BankFeedTransactionRequestRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.BankFeedTransactionResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - bank_feed_account: bank_feed_account - transaction_date: '2024-02-02T00:00:00Z' - posted_date: '2024-02-03T00:00:00Z' - amount: 100.1 - description: Lunch expense - transaction_type: payment - payee: Elmo's diner - credit_or_debit: CREDIT - source_transaction_id: '124569' - remote_was_deleted: true - is_processed: true - 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 - retrieve: - path: /accounting/v1/bank-feed-transactions/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `BankFeedTransaction` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: BankFeedTransactionsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: accountingRoot.BankFeedTransaction - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - bank_feed_account: bank_feed_account - transaction_date: '2024-02-02T00:00:00Z' - posted_date: '2024-02-03T00:00:00Z' - amount: 100.1 - description: Lunch expense - transaction_type: payment - payee: Elmo's diner - credit_or_debit: CREDIT - source_transaction_id: '124569' - remote_was_deleted: true - is_processed: true - metaPostRetrieve: - path: /accounting/v1/bank-feed-transactions/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `BankFeedTransaction` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/cashFlowStatements.yml b/.mock/definition/Accounting/cashFlowStatements.yml deleted file mode 100644 index 52afdc7ac..000000000 --- a/.mock/definition/Accounting/cashFlowStatements.yml +++ /dev/null @@ -1,266 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/cash-flow-statements - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `CashFlowStatement` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: CashFlowStatementsListRequest - query-parameters: - company_id: - type: optional - docs: >- - If provided, will only return cash flow statements for this - company. - 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> - allow-multiple: true - 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: accountingRoot.PaginatedCashFlowStatementList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - remote_id: '8211088' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: CashFlow - currency: XUA - company: company - start_period: '2020-01-01T00:00:00Z' - end_period: '2020-03-31T00:00:00Z' - cash_at_beginning_of_period: 5000 - cash_at_end_of_period: 4063.52 - operating_activities: - - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Operating Activities - value: 1000 - sub_items: - - remote_id: '23042938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Net Income - value: 1097.13 - investing_activities: - - remote_id: '192406939' - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-11-18T00:00:00Z' - name: Equipment - value: 1000 - sub_items: - - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Equipment - value: 1000 - financing_activities: - - remote_id: '192406939' - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-11-15T00:00:00Z' - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - remote_generated_at: '2020-04-01T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/cash-flow-statements/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `CashFlowStatement` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: CashFlowStatementsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: accountingRoot.CashFlowStatement - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - remote_id: '8211088' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: CashFlow - currency: XUA - company: company - start_period: '2020-01-01T00:00:00Z' - end_period: '2020-03-31T00:00:00Z' - cash_at_beginning_of_period: 5000 - cash_at_end_of_period: 4063.52 - operating_activities: - - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Operating Activities - value: 1000 - sub_items: - - remote_id: '23042938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Net Income - value: 1097.13 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - investing_activities: - - remote_id: '192406939' - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-11-18T00:00:00Z' - name: Equipment - value: 1000 - sub_items: - - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-09-18T00:00:00Z' - name: Equipment - value: 1000 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - financing_activities: - - remote_id: '192406939' - created_at: '2021-11-15T00:00:00Z' - modified_at: '2021-11-15T00:00:00Z' - name: Revenue - value: 1000 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - remote_generated_at: '2020-04-01T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/companyInfo.yml b/.mock/definition/Accounting/companyInfo.yml deleted file mode 100644 index 76a4eaf10..000000000 --- a/.mock/definition/Accounting/companyInfo.yml +++ /dev/null @@ -1,229 +0,0 @@ -types: - CompanyInfoListRequestExpandItem: - enum: - - addresses - - phone_numbers - source: - openapi: accounting_v3.yml - CompanyInfoRetrieveRequestExpandItem: - enum: - - addresses - - phone_numbers - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/company-info - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `CompanyInfo` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: CompanyInfoListRequest - 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 - allow-multiple: true - 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: accountingRoot.PaginatedCompanyInfoList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 65d8ffd0-211b-4ba4-b85a-fbe2ce220982 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Merge Pickleball Company - legal_name: Merge Pickleball Company Inc. - tax_number: 11-0011000 - fiscal_year_end_month: 12 - fiscal_year_end_day: 31 - currency: - key: value - remote_created_at: '2020-03-31T00:00:00Z' - urls: - - null - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 2920 Broadway - street_2: 2nd Floor - city: New York - state: NY - country: US - zip_code: '10027' - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/company-info/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `CompanyInfo` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: CompanyInfoRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: accountingRoot.CompanyInfo - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 65d8ffd0-211b-4ba4-b85a-fbe2ce220982 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Merge Pickleball Company - legal_name: Merge Pickleball Company Inc. - tax_number: 11-0011000 - fiscal_year_end_month: 12 - fiscal_year_end_day: 31 - currency: - key: value - remote_created_at: '2020-03-31T00:00:00Z' - urls: - - urls - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - type: BILLING - street_1: 2920 Broadway - street_2: 2nd Floor - city: New York - state: NY - country_subdivision: NY - country: US - zip_code: '10027' - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '+3198675309' - type: Mobile - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/contacts.yml b/.mock/definition/Accounting/contacts.yml deleted file mode 100644 index dfa18135d..000000000 --- a/.mock/definition/Accounting/contacts.yml +++ /dev/null @@ -1,651 +0,0 @@ -types: - ContactsListRequestExpandItem: - enum: - - addresses - - company - - phone_numbers - source: - openapi: accounting_v3.yml - ContactsListRequestStatus: - enum: - - value: '' - name: EMPTY - - ACTIVE - - ARCHIVED - source: - openapi: accounting_v3.yml - ContactsRetrieveRequestExpandItem: - enum: - - addresses - - company - - phone_numbers - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/contacts - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Contact` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: ContactsListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return contacts for this company. - 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. - email_address: - type: optional - docs: If provided, will only return Contacts that match this email. - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_customer: - type: optional - docs: >- - If provided, will only return Contacts that are denoted as - customers. - is_supplier: - type: optional - docs: >- - If provided, will only return Contacts that are denoted as - suppliers. - 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. - name: - type: optional - docs: If provided, will only return Contacts that match this name. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - status: - type: optional - docs: If provided, will only return Contacts that match this status. - response: - docs: '' - type: accountingRoot.PaginatedContactList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email_address: email_address - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_customer: is_customer - is_supplier: is_supplier - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - status: '' - 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: Gil Feig's pickleball store - is_supplier: true - is_customer: true - email_address: pickleball@merge.dev - tax_number: 12-3456789 - status: ACTIVE - currency: USD - remote_updated_at: '2020-03-31T00:00:00Z' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - addresses: - - 2f2702aa-8948-492b-a412-2acdf6d2c499 - - d98c7428-8dda-48a8-a1da-c570f65e2375 - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '+3198675309' - type: Mobile - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /accounting/v1/contacts - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Contact` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: ContactEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.ContactRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.ContactResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: c640b80b-fac9-409f-aa19-1f9221aec445 - remote_id: '11167' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Gil Feig's pickleball store - is_supplier: true - is_customer: true - email_address: pickleball@merge.dev - tax_number: 12-3456789 - status: ACTIVE - currency: USD - remote_updated_at: '2020-03-31T00:00:00Z' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - addresses: - - 2f2702aa-8948-492b-a412-2acdf6d2c499 - - d98c7428-8dda-48a8-a1da-c570f65e2375 - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '+3198675309' - type: Mobile - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /accounting/v1/contacts/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Contact` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: ContactsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.Contact - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - 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: Gil Feig's pickleball store - is_supplier: true - is_customer: true - email_address: pickleball@merge.dev - tax_number: 12-3456789 - status: ACTIVE - currency: USD - remote_updated_at: '2020-03-31T00:00:00Z' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - addresses: - - 2f2702aa-8948-492b-a412-2acdf6d2c499 - - d98c7428-8dda-48a8-a1da-c570f65e2375 - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '+3198675309' - type: Mobile - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - metaPostRetrieve: - path: /accounting/v1/contacts/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Contact` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /accounting/v1/contacts/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: ContactsRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/creditNotes.yml b/.mock/definition/Accounting/creditNotes.yml deleted file mode 100644 index db88f86f6..000000000 --- a/.mock/definition/Accounting/creditNotes.yml +++ /dev/null @@ -1,668 +0,0 @@ -types: - CreditNotesListRequestExpandItem: - enum: - - accounting_period - - applied_payments - - company - - contact - - line_items - - payments - - tracking_categories - source: - openapi: accounting_v3.yml - CreditNotesListRequestRemoteFields: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: accounting_v3.yml - CreditNotesListRequestShowEnumOrigins: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: accounting_v3.yml - CreditNotesRetrieveRequestExpandItem: - enum: - - accounting_period - - applied_payments - - company - - contact - - line_items - - payments - - tracking_categories - source: - openapi: accounting_v3.yml - CreditNotesRetrieveRequestRemoteFields: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: accounting_v3.yml - CreditNotesRetrieveRequestShowEnumOrigins: - enum: - - status - - value: status,type - name: StatusType - - type - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/credit-notes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `CreditNote` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: CreditNotesListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return credit notes for this company. - 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 - allow-multiple: true - 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_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional - docs: >- - 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) - transaction_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - transaction_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - response: - docs: '' - type: accountingRoot.PaginatedCreditNoteList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - transaction_date_after: '2024-01-15T09:30:00Z' - transaction_date_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - remote_id: '123877' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - status: SUBMITTED - number: CN-29 - contact: contact - company: company - exchange_rate: '2.9' - total_amount: 50 - remaining_credit: 20 - inclusive_of_tax: true - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: 0e3fd929-436c-4fd4-a48b-0c61f68d6178 - name: Basic Monthly - description: prorated amount for items - quantity: quantity - memo: privNote - unit_price: '5.0' - tax_rate: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - total_line_amount: '5.0' - tracking_categories: - - 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - account: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - contact: 908934-49j9-093f-0989-908923908 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - remote_was_deleted: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - currency: XUA - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - a9a94a75-19c1-41fe-90d8-d9ba959c38e5 - accounting_period: accounting_period - applied_to_lines: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - create: - path: /accounting/v1/credit-notes - method: POST - auth: - - tokenAuth: [] - docs: Creates a `CreditNote` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: CreditNoteEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.CreditNoteRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.CreditNoteResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - remote_id: '123877' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - status: SUBMITTED - number: CN-29 - contact: contact - company: company - exchange_rate: '2.9' - total_amount: 50 - remaining_credit: 20 - inclusive_of_tax: true - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: 0e3fd929-436c-4fd4-a48b-0c61f68d6178 - name: Basic Monthly - description: prorated amount for items - quantity: quantity - memo: privNote - unit_price: '5.0' - tax_rate: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - total_line_amount: '5.0' - tracking_categories: - - 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - account: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - contact: 908934-49j9-093f-0989-908923908 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - remote_was_deleted: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - currency: XUA - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - a9a94a75-19c1-41fe-90d8-d9ba959c38e5 - accounting_period: accounting_period - applied_to_lines: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - 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 - retrieve: - path: /accounting/v1/credit-notes/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `CreditNote` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: CreditNotesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: accountingRoot.CreditNote - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - remote_id: '123877' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - status: SUBMITTED - number: CN-29 - contact: contact - company: company - exchange_rate: '2.9' - total_amount: 50 - remaining_credit: 20 - inclusive_of_tax: true - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: 0e3fd929-436c-4fd4-a48b-0c61f68d6178 - name: Basic Monthly - description: prorated amount for items - quantity: quantity - memo: privNote - unit_price: '5.0' - tax_rate: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - total_line_amount: '5.0' - tracking_categories: - - 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - account: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - contact: 908934-49j9-093f-0989-908923908 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - remote_was_deleted: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - currency: XUA - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - a9a94a75-19c1-41fe-90d8-d9ba959c38e5 - accounting_period: accounting_period - applied_to_lines: - - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - metaPostRetrieve: - path: /accounting/v1/credit-notes/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `CreditNote` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/deleteAccount.yml b/.mock/definition/Accounting/deleteAccount.yml deleted file mode 100644 index ac30455d0..000000000 --- a/.mock/definition/Accounting/deleteAccount.yml +++ /dev/null @@ -1,17 +0,0 @@ -service: - auth: false - base-path: '' - endpoints: - delete: - path: /accounting/v1/delete-account - method: POST - auth: - - tokenAuth: [] - docs: Delete a linked account. - source: - openapi: accounting_v3.yml - examples: - - headers: - X-Account-Token: X-Account-Token - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/employees.yml b/.mock/definition/Accounting/employees.yml deleted file mode 100644 index 15a0cdb68..000000000 --- a/.mock/definition/Accounting/employees.yml +++ /dev/null @@ -1,156 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/employees - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Employee` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: EmployeesListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional> - allow-multiple: true - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedEmployeeList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - 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' - first_name: John - last_name: Smith - is_contractor: true - employee_number: '325462' - email_address: johnsmith@merge.dev - company: company - status: ACTIVE - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/employees/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Employee` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: EmployeesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: accountingRoot.Employee - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - 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' - first_name: John - last_name: Smith - is_contractor: true - employee_number: '325462' - email_address: johnsmith@merge.dev - company: company - status: ACTIVE - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/expenses.yml b/.mock/definition/Accounting/expenses.yml deleted file mode 100644 index c039baab8..000000000 --- a/.mock/definition/Accounting/expenses.yml +++ /dev/null @@ -1,798 +0,0 @@ -types: - ExpensesListRequestExpandItem: - enum: - - account - - accounting_period - - company - - contact - - employee - - tracking_categories - source: - openapi: accounting_v3.yml - ExpensesRetrieveRequestExpandItem: - enum: - - account - - accounting_period - - company - - contact - - employee - - tracking_categories - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/expenses - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Expense` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: ExpensesListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return expenses for this company. - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - transaction_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - transaction_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - response: - docs: '' - type: accountingRoot.PaginatedExpenseList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - transaction_date_after: '2024-01-15T09:30:00Z' - transaction_date_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2024-01-15T09:30:00Z' - remote_created_at: '2020-03-31T00:00:00Z' - account: account - contact: contact - total_amount: 10000 - sub_total: 1.1 - total_tax_amount: 1.1 - currency: XUA - exchange_rate: '2.9' - inclusive_of_tax: true - company: company - employee: employee - memo: New employee supplies - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - account: 2a56344a-a491-11ec-b909-0242ac120002 - contact: c640b80b-fac9-409f-aa19-1f9221aec445 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - description: MacBook Pro - exchange_rate: '2.9' - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - account: 2a56344a-a491-11ec-b909-0242ac120002 - description: Desk Lamp - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /accounting/v1/expenses - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Expense` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: ExpenseEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.ExpenseRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.ExpenseResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2024-01-15T09:30:00Z' - remote_created_at: '2020-03-31T00:00:00Z' - account: account - contact: contact - total_amount: 10000 - sub_total: 1.1 - total_tax_amount: 1.1 - currency: XUA - exchange_rate: '2.9' - inclusive_of_tax: true - company: company - employee: employee - memo: New employee supplies - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - account: 2a56344a-a491-11ec-b909-0242ac120002 - contact: c640b80b-fac9-409f-aa19-1f9221aec445 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - description: MacBook Pro - exchange_rate: '2.9' - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - account: 2a56344a-a491-11ec-b909-0242ac120002 - description: Desk Lamp - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /accounting/v1/expenses/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Expense` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: ExpensesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: accountingRoot.Expense - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2024-01-15T09:30:00Z' - remote_created_at: '2020-03-31T00:00:00Z' - account: account - contact: contact - total_amount: 10000 - sub_total: 1.1 - total_tax_amount: 1.1 - currency: XUA - exchange_rate: '2.9' - inclusive_of_tax: true - company: company - employee: employee - memo: New employee supplies - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - currency: XUA - account: 2a56344a-a491-11ec-b909-0242ac120002 - contact: c640b80b-fac9-409f-aa19-1f9221aec445 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - description: MacBook Pro - exchange_rate: '2.9' - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - item: b38c59b0-a9d7-4740-b1ee-5436c6751e3d - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: employee - currency: XUA - account: 2a56344a-a491-11ec-b909-0242ac120002 - contact: contact - project: project - description: Desk Lamp - exchange_rate: '2.9' - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - remote_was_deleted: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - linesRemoteFieldClassesList: - path: /accounting/v1/expenses/lines/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: ExpensesLinesRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - metaPostRetrieve: - path: /accounting/v1/expenses/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Expense` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /accounting/v1/expenses/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: ExpensesRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/fieldMapping.yml b/.mock/definition/Accounting/fieldMapping.yml deleted file mode 100644 index e8c557cdb..000000000 --- a/.mock/definition/Accounting/fieldMapping.yml +++ /dev/null @@ -1,1217 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - field_mappings_retrieve: - path: /accounting/v1/field-mappings - method: GET - auth: - - tokenAuth: [] - 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: accounting_v3.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: accountingRoot.FieldMappingApiInstanceResponse - status-code: 200 - examples: - - query-parameters: - exclude_remote_field_metadata: true - headers: - X-Account-Token: X-Account-Token - response: - body: - Account: - - 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 - AccountingAttachment: - - 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 - BalanceSheet: - - 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 - CashFlowStatement: - - 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 - CompanyInfo: - - 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 - Contact: - - 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 - IncomeStatement: - - 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 - CreditNote: - - 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 - Item: - - 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 - PurchaseOrder: - - 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 - TrackingCategory: - - 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 - JournalEntry: - - 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 - TaxRate: - - 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 - Invoice: - - 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 - Payment: - - 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 - Expense: - - 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 - VendorCredit: - - 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 - Transaction: - - 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 - AccountingPeriod: - - 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 - GeneralLedgerTransaction: - - 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 - BankFeedAccount: - - 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 - Employee: - - 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 - PaymentMethod: - - 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 - Project: - - 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 - PaymentTerm: - - 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 - field_mappings_create: - path: /accounting/v1/field-mappings - method: POST - auth: - - tokenAuth: [] - 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: accounting_v3.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 - content-type: application/json - response: - docs: '' - type: accountingRoot.FieldMappingInstanceResponse - status-code: 201 - examples: - - query-parameters: - exclude_remote_field_metadata: true - 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 - 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: /accounting/v1/field-mappings/{field_mapping_id} - method: DELETE - auth: - - tokenAuth: [] - 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: accounting_v3.yml - path-parameters: - field_mapping_id: string - response: - docs: '' - type: accountingRoot.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 - 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: /accounting/v1/field-mappings/{field_mapping_id} - method: PATCH - auth: - - tokenAuth: [] - 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: accounting_v3.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 - content-type: application/json - response: - docs: '' - type: accountingRoot.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 - 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: /accounting/v1/remote-fields - method: GET - auth: - - tokenAuth: [] - 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: accounting_v3.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: accountingRoot.RemoteFieldApiResponse - status-code: 200 - examples: - - query-parameters: - common_models: common_models - include_example_values: include_example_values - headers: - X-Account-Token: X-Account-Token - response: - body: - Account: - - 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 - AccountingAttachment: - - 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 - BalanceSheet: - - 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 - CashFlowStatement: - - 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 - CompanyInfo: - - 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 - Contact: - - 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 - IncomeStatement: - - 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 - CreditNote: - - 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 - Item: - - 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 - PurchaseOrder: - - 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 - TrackingCategory: - - 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 - JournalEntry: - - 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 - TaxRate: - - 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 - Invoice: - - 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 - Payment: - - 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 - Expense: - - 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 - VendorCredit: - - 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 - Transaction: - - 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 - AccountingPeriod: - - 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 - GeneralLedgerTransaction: - - 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 - BankFeedAccount: - - 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 - Employee: - - 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 - PaymentMethod: - - 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 - Project: - - 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 - PaymentTerm: - - 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: /accounting/v1/target-fields - method: GET - auth: - - tokenAuth: [] - 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: accounting_v3.yml - response: - docs: '' - type: accountingRoot.ExternalTargetFieldApiResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - Account: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - AccountingAttachment: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - BalanceSheet: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - CashFlowStatement: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - CompanyInfo: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Contact: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - IncomeStatement: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - CreditNote: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Item: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - PurchaseOrder: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - TrackingCategory: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - JournalEntry: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - TaxRate: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Invoice: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Payment: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Expense: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - VendorCredit: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Transaction: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - AccountingPeriod: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - GeneralLedgerTransaction: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - BankFeedAccount: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Employee: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - PaymentMethod: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Project: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - PaymentTerm: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/forceResync.yml b/.mock/definition/Accounting/forceResync.yml deleted file mode 100644 index b9631fd75..000000000 --- a/.mock/definition/Accounting/forceResync.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - sync_status_resync_create: - path: /accounting/v1/sync-status/resync - method: POST - auth: - - tokenAuth: [] - 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: accounting_v3.yml - response: - docs: '' - type: list - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - - model_name: Invoice - model_id: accounting.Invoices - 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: accounting_v3.yml diff --git a/.mock/definition/Accounting/generalLedgerTransactions.yml b/.mock/definition/Accounting/generalLedgerTransactions.yml deleted file mode 100644 index 12923c804..000000000 --- a/.mock/definition/Accounting/generalLedgerTransactions.yml +++ /dev/null @@ -1,270 +0,0 @@ -types: - GeneralLedgerTransactionsListRequestExpandItem: - enum: - - accounting_period - - company - - general_ledger_transaction_lines - - tracking_categories - source: - openapi: accounting_v3.yml - GeneralLedgerTransactionsRetrieveRequestExpandItem: - enum: - - accounting_period - - company - - general_ledger_transaction_lines - - tracking_categories - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/general-ledger-transactions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `GeneralLedgerTransaction` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: GeneralLedgerTransactionsListRequest - query-parameters: - company_id: - type: optional - docs: >- - If provided, will only return general ledger transactions for this - company. - 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 - allow-multiple: true - 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. - posted_date_after: - type: optional - docs: If provided, will only return objects posted after this datetime. - posted_date_before: - type: optional - docs: If provided, will only return objects posted before this datetime. - remote_id: - type: optional - docs: The API provider's ID for the given object. - response: - docs: '' - type: accountingRoot.PaginatedGeneralLedgerTransactionList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - posted_date_after: '2024-01-15T09:30:00Z' - posted_date_before: '2024-01-15T09:30:00Z' - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - underlying_transaction_remote_id: '1234' - underlying_transaction_type: INVOICE - accounting_period: accounting_period - company: company - remote_updated_at: '2020-03-31T00:00:00Z' - remote_created_at: '2020-03-31T00:00:00Z' - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - posting_date: '2020-03-31T00:00:00Z' - general_ledger_transaction_lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '123' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - contact: d6e687d6-0c36-48a1-8114-35324b5cb38f - base_currency: USD - transaction_currency: USD - exchange_rate: exchange_rate - description: Invoice created - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - debit_amount: debit_amount - credit_amount: credit_amount - item: a47e11b6-c73b-4a0c-be31-130fc48177fa - foreign_debit_amount: foreign_debit_amount - foreign_credit_amount: foreign_credit_amount - remote_was_deleted: false - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /accounting/v1/general-ledger-transactions/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `GeneralLedgerTransaction` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: GeneralLedgerTransactionsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: accountingRoot.GeneralLedgerTransaction - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - underlying_transaction_remote_id: '1234' - underlying_transaction_type: INVOICE - accounting_period: accounting_period - company: company - remote_updated_at: '2020-03-31T00:00:00Z' - remote_created_at: '2020-03-31T00:00:00Z' - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - posting_date: '2020-03-31T00:00:00Z' - general_ledger_transaction_lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '123' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: employee - contact: d6e687d6-0c36-48a1-8114-35324b5cb38f - project: project - base_currency: USD - transaction_currency: USD - exchange_rate: exchange_rate - description: Invoice created - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - debit_amount: debit_amount - credit_amount: credit_amount - item: a47e11b6-c73b-4a0c-be31-130fc48177fa - foreign_debit_amount: foreign_debit_amount - foreign_credit_amount: foreign_credit_amount - remote_was_deleted: false - 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: /platform-endpoint - data: - key: value - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/generateKey.yml b/.mock/definition/Accounting/generateKey.yml deleted file mode 100644 index ba16ddeac..000000000 --- a/.mock/definition/Accounting/generateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /accounting/v1/generate-key - method: POST - auth: - - tokenAuth: [] - docs: Create a remote key. - source: - openapi: accounting_v3.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: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/incomeStatements.yml b/.mock/definition/Accounting/incomeStatements.yml deleted file mode 100644 index 0c2e79b01..000000000 --- a/.mock/definition/Accounting/incomeStatements.yml +++ /dev/null @@ -1,294 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/income-statements - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `IncomeStatement` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: IncomeStatementsListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return income statements for this company. - 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> - allow-multiple: true - 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: accountingRoot.PaginatedIncomeStatementList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '1342348' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: IncomeStatement - currency: XUA - company: company - start_period: '2024-01-15T09:30:00Z' - end_period: '2024-01-15T09:30:00Z' - income: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total Income - value: 325 - sub_items: - - remote_id: '10200' - name: Landscaping Services - value: 425 - - remote_id: '10201' - name: Pest Control Services - value: -100 - cost_of_sales: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total COGS - value: 25 - sub_items: - - remote_id: '10200' - name: Supplies - value: 10 - gross_profit: 300 - operating_expenses: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total Operating Expenses - value: 100 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - net_operating_income: 200 - non_operating_expenses: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total Non-Operating Expenses - value: 100 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - net_income: 100 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/income-statements/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `IncomeStatement` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: IncomeStatementsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: accountingRoot.IncomeStatement - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '1342348' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: IncomeStatement - currency: XUA - company: company - start_period: '2024-01-15T09:30:00Z' - end_period: '2024-01-15T09:30:00Z' - income: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total Income - value: 325 - sub_items: - - remote_id: '10200' - name: Landscaping Services - value: 425 - - remote_id: '10201' - name: Pest Control Services - value: -100 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - cost_of_sales: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total COGS - value: 25 - sub_items: - - remote_id: '10200' - name: Supplies - value: 10 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - gross_profit: 300 - operating_expenses: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total Operating Expenses - value: 100 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - net_operating_income: 200 - non_operating_expenses: - - remote_id: '10299' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Total Non-Operating Expenses - value: 100 - sub_items: - - remote_id: '10300' - name: Revenue - San Francisco - value: 500 - - remote_id: '10301' - name: Revenue - New York - value: 500 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - net_income: 100 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/invoices.yml b/.mock/definition/Accounting/invoices.yml deleted file mode 100644 index 304889f61..000000000 --- a/.mock/definition/Accounting/invoices.yml +++ /dev/null @@ -1,1270 +0,0 @@ -types: - InvoicesListRequestExpandItem: - enum: - - accounting_period - - applied_credit_notes - - applied_payments - - applied_vendor_credits - - company - - contact - - employee - - line_items - - payment_term - - payments - - purchase_orders - - tracking_categories - source: - openapi: accounting_v3.yml - InvoicesListRequestStatus: - enum: - - DRAFT - - OPEN - - PAID - - PARTIALLY_PAID - - SUBMITTED - - VOID - source: - openapi: accounting_v3.yml - InvoicesListRequestType: - enum: - - ACCOUNTS_PAYABLE - - ACCOUNTS_RECEIVABLE - source: - openapi: accounting_v3.yml - InvoicesRetrieveRequestExpandItem: - enum: - - accounting_period - - applied_credit_notes - - applied_payments - - applied_vendor_credits - - company - - contact - - employee - - line_items - - payment_term - - payments - - purchase_orders - - tracking_categories - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/invoices - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Invoice` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: InvoicesListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return invoices for this company. - contact_id: - type: optional - docs: If provided, will only return invoices for this contact. - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - issue_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - issue_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - 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. - number: - type: optional - docs: If provided, will only return Invoices with this number. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - status: - type: optional - docs: |- - If provided, will only return Invoices with this status. - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `SUBMITTED` - SUBMITTED - * `PARTIALLY_PAID` - PARTIALLY_PAID - * `OPEN` - OPEN - * `VOID` - VOID - type: - type: optional - docs: |- - If provided, will only return Invoices with this type. - - * `ACCOUNTS_RECEIVABLE` - ACCOUNTS_RECEIVABLE - * `ACCOUNTS_PAYABLE` - ACCOUNTS_PAYABLE - response: - docs: '' - type: accountingRoot.PaginatedInvoiceList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - contact_id: contact_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - issue_date_after: '2024-01-15T09:30:00Z' - issue_date_before: '2024-01-15T09:30:00Z' - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - number: number - page_size: 1 - remote_fields: type - remote_id: remote_id - show_enum_origins: type - status: DRAFT - type: ACCOUNTS_PAYABLE - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '990110' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - type: ACCOUNTS_RECEIVABLE - contact: contact - number: AIQ12546 - issue_date: '2020-03-31T00:00:00Z' - due_date: '2020-04-15T00:00:00Z' - paid_on_date: '2020-04-01T00:00:00Z' - memo: Weekly Payment - company: company - employee: employee - currency: XUA - exchange_rate: '2.9' - payment_term: payment_term - total_discount: 1.1 - sub_total: 100 - status: PAID - total_tax_amount: 5 - total_amount: 105 - balance: 105 - remote_updated_at: '2020-04-01T00:00:00Z' - tracking_categories: - - 7dc5ca17-d311-44cd-9ce0-333080367a18 - - 6aa0700c-48e1-4c4a-8162-02e6a582df05 - - 8c933d61-8f5b-4360-ac0c-c9dc87bee763 - accounting_period: accounting_period - purchase_orders: - - e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7 - - dd70ca2f-b120-46fa-889a-9604037f45fd - - 889b281d-739c-4759-95b8-0aedb3947131 - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 9017594e-dc33-4113-a5d2-b0f928e34fdd - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '8765432' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball lessons - unit_price: 50 - quantity: 1 - total_amount: 50 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - currency: USD - exchange_rate: '2.9' - item: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - account: cd0f32d4-a493-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - applied_credit_notes: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - credit_note: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - applied_vendor_credits: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - vendor_credit: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - inclusive_of_tax: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /accounting/v1/invoices - method: POST - auth: - - tokenAuth: [] - docs: |- - Creates an `Invoice` object with the given values. - Including a `PurchaseOrder` id in the `purchase_orders` property will generate an Accounts Payable Invoice from the specified Purchase Order(s). - - source: - openapi: accounting_v3.yml - request: - name: InvoiceEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.InvoiceRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.InvoiceResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '990110' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - type: ACCOUNTS_RECEIVABLE - contact: contact - number: AIQ12546 - issue_date: '2020-03-31T00:00:00Z' - due_date: '2020-04-15T00:00:00Z' - paid_on_date: '2020-04-01T00:00:00Z' - memo: Weekly Payment - company: company - employee: employee - currency: XUA - exchange_rate: '2.9' - payment_term: payment_term - total_discount: 1.1 - sub_total: 100 - status: PAID - total_tax_amount: 5 - total_amount: 105 - balance: 105 - remote_updated_at: '2020-04-01T00:00:00Z' - tracking_categories: - - 7dc5ca17-d311-44cd-9ce0-333080367a18 - - 6aa0700c-48e1-4c4a-8162-02e6a582df05 - - 8c933d61-8f5b-4360-ac0c-c9dc87bee763 - accounting_period: accounting_period - purchase_orders: - - e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7 - - dd70ca2f-b120-46fa-889a-9604037f45fd - - 889b281d-739c-4759-95b8-0aedb3947131 - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 9017594e-dc33-4113-a5d2-b0f928e34fdd - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '8765432' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball lessons - unit_price: 50 - quantity: 1 - total_amount: 50 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - currency: USD - exchange_rate: '2.9' - item: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - account: cd0f32d4-a493-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - applied_credit_notes: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - credit_note: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - applied_vendor_credits: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - vendor_credit: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - inclusive_of_tax: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /accounting/v1/invoices/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Invoice` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: InvoicesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.Invoice - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - remote_fields: type - show_enum_origins: type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '990110' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - type: ACCOUNTS_RECEIVABLE - contact: contact - number: AIQ12546 - issue_date: '2020-03-31T00:00:00Z' - due_date: '2020-04-15T00:00:00Z' - paid_on_date: '2020-04-01T00:00:00Z' - memo: Weekly Payment - company: company - employee: employee - currency: XUA - exchange_rate: '2.9' - payment_term: payment_term - total_discount: 1.1 - sub_total: 100 - status: PAID - total_tax_amount: 5 - total_amount: 105 - balance: 105 - remote_updated_at: '2020-04-01T00:00:00Z' - tracking_categories: - - 7dc5ca17-d311-44cd-9ce0-333080367a18 - - 6aa0700c-48e1-4c4a-8162-02e6a582df05 - - 8c933d61-8f5b-4360-ac0c-c9dc87bee763 - accounting_period: accounting_period - purchase_orders: - - e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7 - - dd70ca2f-b120-46fa-889a-9604037f45fd - - 889b281d-739c-4759-95b8-0aedb3947131 - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 9017594e-dc33-4113-a5d2-b0f928e34fdd - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '8765432' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball lessons - unit_price: 50 - quantity: 1 - total_amount: 50 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - currency: USD - exchange_rate: '2.9' - item: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - account: cd0f32d4-a493-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_fields: - - remote_field_class: remote_field_class - applied_credit_notes: - - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - credit_note: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - applied_vendor_credits: - - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - vendor_credit: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - inclusive_of_tax: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /accounting/v1/invoices/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates an `Invoice` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PatchedInvoiceEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.InvoiceRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.InvoiceResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 9871b4a9-f5d2-4f3b-a66b-dfedbed42c46 - remote_id: '990110' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - type: ACCOUNTS_RECEIVABLE - contact: contact - number: AIQ12546 - issue_date: '2020-03-31T00:00:00Z' - due_date: '2020-04-15T00:00:00Z' - paid_on_date: '2020-04-01T00:00:00Z' - memo: Weekly Payment - company: company - employee: employee - currency: XUA - exchange_rate: '2.9' - payment_term: payment_term - total_discount: 1.1 - sub_total: 100 - status: PAID - total_tax_amount: 5 - total_amount: 105 - balance: 105 - remote_updated_at: '2020-04-01T00:00:00Z' - tracking_categories: - - 7dc5ca17-d311-44cd-9ce0-333080367a18 - - 6aa0700c-48e1-4c4a-8162-02e6a582df05 - - 8c933d61-8f5b-4360-ac0c-c9dc87bee763 - accounting_period: accounting_period - purchase_orders: - - e7378d8f-3992-4c2a-8417-ebdc4f2bfeb7 - - dd70ca2f-b120-46fa-889a-9604037f45fd - - 889b281d-739c-4759-95b8-0aedb3947131 - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 9017594e-dc33-4113-a5d2-b0f928e34fdd - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '8765432' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball lessons - unit_price: 50 - quantity: 1 - total_amount: 50 - employee: 7442f0d5-722d-45bd-b807-6e38489d37fe - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - currency: USD - exchange_rate: '2.9' - item: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - account: cd0f32d4-a493-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - applied_credit_notes: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - credit_note: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - applied_vendor_credits: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - vendor_credit: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - inclusive_of_tax: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - lineItemsRemoteFieldClassesList: - path: /accounting/v1/invoices/line-items/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: InvoicesLineItemsRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - metaPatchRetrieve: - path: /accounting/v1/invoices/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Invoice` PATCHs. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /accounting/v1/invoices/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Invoice` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /accounting/v1/invoices/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: InvoicesRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/issues.yml b/.mock/definition/Accounting/issues.yml deleted file mode 100644 index 01dadddb0..000000000 --- a/.mock/definition/Accounting/issues.yml +++ /dev/null @@ -1,154 +0,0 @@ -types: - IssuesListRequestStatus: - enum: - - ONGOING - - RESOLVED - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/issues - method: GET - auth: - - tokenAuth: [] - docs: Gets all issues for Organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.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: accountingRoot.PaginatedIssueList - status-code: 200 - examples: - - query-parameters: - account_token: account_token - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - end_user_organization_name: end_user_organization_name - first_incident_time_after: '2024-01-15T09:30:00Z' - first_incident_time_before: '2024-01-15T09:30:00Z' - include_muted: include_muted - integration_name: integration_name - last_incident_time_after: '2024-01-15T09:30:00Z' - last_incident_time_before: '2024-01-15T09:30:00Z' - linked_account_id: linked_account_id - page_size: 1 - start_date: start_date - status: ONGOING - 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: /accounting/v1/issues/{id} - method: GET - auth: - - tokenAuth: [] - docs: Get a specific issue. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - response: - docs: '' - type: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/items.yml b/.mock/definition/Accounting/items.yml deleted file mode 100644 index 81d180fe8..000000000 --- a/.mock/definition/Accounting/items.yml +++ /dev/null @@ -1,783 +0,0 @@ -types: - ItemsListRequestExpandItem: - enum: - - company - - purchase_account - - purchase_tax_rate - - sales_account - - sales_tax_rate - source: - openapi: accounting_v3.yml - ItemsRetrieveRequestExpandItem: - enum: - - company - - purchase_account - - purchase_tax_rate - - sales_account - - sales_tax_rate - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/items - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Item` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: ItemsListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return items for this company. - 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 - allow-multiple: true - 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_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.PaginatedItemList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: d2f972d0-2526-434b-9409-4c3b468e08f0 - remote_id: '12374' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Pickleball Paddle - status: ACTIVE - type: INVENTORY - unit_price: 10 - purchase_price: 25 - purchase_account: purchase_account - sales_account: sales_account - company: company - purchase_tax_rate: purchase_tax_rate - sales_tax_rate: sales_tax_rate - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - create: - path: /accounting/v1/items - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Item` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: ItemEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.ItemRequestRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.ItemResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: d2f972d0-2526-434b-9409-4c3b468e08f0 - remote_id: '12374' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Pickleball Paddle - status: ACTIVE - type: INVENTORY - unit_price: 10 - purchase_price: 25 - purchase_account: purchase_account - sales_account: sales_account - company: company - purchase_tax_rate: purchase_tax_rate - sales_tax_rate: sales_tax_rate - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - 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 - retrieve: - path: /accounting/v1/items/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Item` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: ItemsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.Item - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: d2f972d0-2526-434b-9409-4c3b468e08f0 - remote_id: '12374' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Pickleball Paddle - status: ACTIVE - type: INVENTORY - unit_price: 10 - purchase_price: 25 - purchase_account: purchase_account - sales_account: sales_account - company: company - purchase_tax_rate: purchase_tax_rate - sales_tax_rate: sales_tax_rate - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - partialUpdate: - path: /accounting/v1/items/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates an `Item` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PatchedItemEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.PatchedItemRequestRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.ItemResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: d2f972d0-2526-434b-9409-4c3b468e08f0 - remote_id: '12374' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Pickleball Paddle - status: ACTIVE - type: INVENTORY - unit_price: 10 - purchase_price: 25 - purchase_account: purchase_account - sales_account: sales_account - company: company - purchase_tax_rate: purchase_tax_rate - sales_tax_rate: sales_tax_rate - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - 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 - metaPatchRetrieve: - path: /accounting/v1/items/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Item` PATCHs. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /accounting/v1/items/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Item` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/journalEntries.yml b/.mock/definition/Accounting/journalEntries.yml deleted file mode 100644 index de400100f..000000000 --- a/.mock/definition/Accounting/journalEntries.yml +++ /dev/null @@ -1,789 +0,0 @@ -types: - JournalEntriesListRequestExpandItem: - enum: - - accounting_period - - applied_payments - - company - - lines - - payments - - tracking_categories - source: - openapi: accounting_v3.yml - JournalEntriesRetrieveRequestExpandItem: - enum: - - accounting_period - - applied_payments - - company - - lines - - payments - - tracking_categories - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/journal-entries - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `JournalEntry` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: JournalEntriesListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return journal entries for this company. - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - transaction_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - transaction_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - response: - docs: '' - type: accountingRoot.PaginatedJournalEntryList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - transaction_date_after: '2024-01-15T09:30:00Z' - transaction_date_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 4311155d-f236-4a5d-9e0f-1cb167e38f95 - memo: Weekly Payment - currency: XUA - exchange_rate: '2.9' - company: company - inclusive_of_tax: true - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - net_amount: 25.54 - tracking_categories: - - d25d609b-945f-4762-b55a-1c8fb220c43c - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 123c8r35-5kf5-12x5-r833-99bwf35210b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: d2d5ea3c-b032-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: Cash payment for lunch - exchange_rate: '2.9' - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: f963f34d-3d2f-4f77-b557-cf36bc7e6498 - net_amount: 10 - journal_number: '42' - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - remote_was_deleted: true - posting_status: UNPOSTED - accounting_period: accounting_period - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /accounting/v1/journal-entries - method: POST - auth: - - tokenAuth: [] - docs: Creates a `JournalEntry` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: JournalEntryEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.JournalEntryRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.JournalEntryResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 4311155d-f236-4a5d-9e0f-1cb167e38f95 - memo: Weekly Payment - currency: XUA - exchange_rate: '2.9' - company: company - inclusive_of_tax: true - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - net_amount: 25.54 - tracking_categories: - - d25d609b-945f-4762-b55a-1c8fb220c43c - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 123c8r35-5kf5-12x5-r833-99bwf35210b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: d2d5ea3c-b032-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: Cash payment for lunch - exchange_rate: '2.9' - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: f963f34d-3d2f-4f77-b557-cf36bc7e6498 - net_amount: 10 - journal_number: '42' - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - remote_was_deleted: true - posting_status: UNPOSTED - accounting_period: accounting_period - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /accounting/v1/journal-entries/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `JournalEntry` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: JournalEntriesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: accountingRoot.JournalEntry - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - payments: - - b26fd49a-cbae-470a-a8f8-bcbc119e0390 - applied_payments: - - 4311155d-f236-4a5d-9e0f-1cb167e38f95 - memo: Weekly Payment - currency: XUA - exchange_rate: '2.9' - company: company - inclusive_of_tax: true - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - net_amount: 25.54 - tracking_categories: - - d25d609b-945f-4762-b55a-1c8fb220c43c - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - currency: XUA - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 123c8r35-5kf5-12x5-r833-99bwf35210b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: d2d5ea3c-b032-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: Cash payment for lunch - exchange_rate: '2.9' - remote_was_deleted: false - remote_fields: - - remote_field_class: remote_field_class - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - account: f963f34d-3d2f-4f77-b557-cf36bc7e6498 - net_amount: 10 - tracking_categories: - - d25d609b-945f-4762-b55a-1c8fb220c43c - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - currency: XUA - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - employee: 123c8r35-5kf5-12x5-r833-99bwf35210b5 - project: project - contact: d2d5ea3c-b032-11ec-b909-0242ac120002 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - description: Cash payment for lunch - exchange_rate: '2.9' - remote_was_deleted: true - remote_fields: - - remote_field_class: remote_field_class - journal_number: '42' - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - remote_was_deleted: true - posting_status: UNPOSTED - accounting_period: accounting_period - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - linesRemoteFieldClassesList: - path: /accounting/v1/journal-entries/lines/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: JournalEntriesLinesRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - metaPostRetrieve: - path: /accounting/v1/journal-entries/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `JournalEntry` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /accounting/v1/journal-entries/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: JournalEntriesRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/linkToken.yml b/.mock/definition/Accounting/linkToken.yml deleted file mode 100644 index 4d3d29cdf..000000000 --- a/.mock/definition/Accounting/linkToken.yml +++ /dev/null @@ -1,155 +0,0 @@ -imports: - accountingRoot: __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: - - accountingRoot.LanguageEnum - - string - source: - openapi: accounting_v3.yml - inline: true -service: - auth: false - base-path: '' - endpoints: - create: - path: /accounting/v1/link-token - method: POST - auth: - - tokenAuth: [] - docs: Creates a link token to be used when linking a new end user. - source: - openapi: accounting_v3.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: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/linkedAccounts.yml b/.mock/definition/Accounting/linkedAccounts.yml deleted file mode 100644 index b3382911a..000000000 --- a/.mock/definition/Accounting/linkedAccounts.yml +++ /dev/null @@ -1,169 +0,0 @@ -types: - LinkedAccountsListRequestCategory: - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/linked-accounts - method: GET - auth: - - tokenAuth: [] - docs: List linked accounts for your organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: LinkedAccountsListRequest - query-parameters: - category: - type: optional - docs: >- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, - `mktg`, `ticketing` - - - * `hris` - hris - - * `ats` - ats - - * `accounting` - accounting - - * `ticketing` - ticketing - - * `crm` - crm - - * `mktg` - mktg - - * `filestorage` - filestorage - 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: accountingRoot.PaginatedAccountDetailsAndActionsList - status-code: 200 - examples: - - query-parameters: - category: accounting - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - 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: true - integration_name: integration_name - is_test_account: is_test_account - page_size: 1 - status: status - 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' - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/passthrough.yml b/.mock/definition/Accounting/passthrough.yml deleted file mode 100644 index 5815ec9d1..000000000 --- a/.mock/definition/Accounting/passthrough.yml +++ /dev/null @@ -1,42 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /accounting/v1/passthrough - method: POST - auth: - - tokenAuth: [] - docs: Pull data from an endpoint not currently supported by Merge. - source: - openapi: accounting_v3.yml - request: - body: accountingRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/paymentMethods.yml b/.mock/definition/Accounting/paymentMethods.yml deleted file mode 100644 index 8d1a36848..000000000 --- a/.mock/definition/Accounting/paymentMethods.yml +++ /dev/null @@ -1,136 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/payment-methods - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `PaymentMethod` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PaymentMethodsListRequest - query-parameters: - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedPaymentMethodList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - method_type: CREDIT_CARD - name: John Smith's Credit Card - is_active: true - remote_updated_at: '2021-09-15T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/payment-methods/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `PaymentMethod` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PaymentMethodsRetrieveRequest - 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: accountingRoot.PaymentMethod - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - method_type: CREDIT_CARD - name: John Smith's Credit Card - is_active: true - remote_updated_at: '2021-09-15T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/paymentTerms.yml b/.mock/definition/Accounting/paymentTerms.yml deleted file mode 100644 index f1f342931..000000000 --- a/.mock/definition/Accounting/paymentTerms.yml +++ /dev/null @@ -1,152 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/payment-terms - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `PaymentTerm` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PaymentTermsListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional> - allow-multiple: true - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedPaymentTermList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Net 30 - is_active: true - company: company - days_until_due: 30 - discount_days: 15 - remote_last_modified_at: '2024-10-16T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/payment-terms/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `PaymentTerm` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PaymentTermsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: accountingRoot.PaymentTerm - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Net 30 - is_active: true - company: company - days_until_due: 30 - discount_days: 15 - remote_last_modified_at: '2024-10-16T00:00:00Z' - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/payments.yml b/.mock/definition/Accounting/payments.yml deleted file mode 100644 index 2bd53ed62..000000000 --- a/.mock/definition/Accounting/payments.yml +++ /dev/null @@ -1,1045 +0,0 @@ -types: - PaymentsListRequestExpandItem: - enum: - - account - - accounting_period - - applied_to_lines - - company - - contact - - payment_method - - tracking_categories - source: - openapi: accounting_v3.yml - PaymentsRetrieveRequestExpandItem: - enum: - - account - - accounting_period - - applied_to_lines - - company - - contact - - payment_method - - tracking_categories - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/payments - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Payment` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PaymentsListRequest - query-parameters: - account_id: - type: optional - docs: If provided, will only return payments for this account. - company_id: - type: optional - docs: If provided, will only return payments for this company. - contact_id: - type: optional - docs: If provided, will only return payments for this contact. - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - transaction_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - transaction_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - response: - docs: '' - type: accountingRoot.PaginatedPaymentList - status-code: 200 - examples: - - query-parameters: - account_id: account_id - company_id: company_id - contact_id: contact_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - transaction_date_after: '2024-01-15T09:30:00Z' - transaction_date_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - contact: contact - account: account - payment_method: payment_method - currency: XUA - exchange_rate: '2.9' - company: company - total_amount: 50 - type: ACCOUNTS_PAYABLE - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: accounting_period - applied_to_lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa - related_object_type: INVOICE - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '235' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 - related_object_type: CREDIT_NOTE - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /accounting/v1/payments - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Payment` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: PaymentEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.PaymentRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.PaymentResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - contact: contact - account: account - payment_method: payment_method - currency: XUA - exchange_rate: '2.9' - company: company - total_amount: 50 - type: ACCOUNTS_PAYABLE - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: accounting_period - applied_to_lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa - related_object_type: INVOICE - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '235' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 - related_object_type: CREDIT_NOTE - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /accounting/v1/payments/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Payment` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PaymentsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: accountingRoot.Payment - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - contact: contact - account: account - payment_method: payment_method - currency: XUA - exchange_rate: '2.9' - company: company - total_amount: 50 - type: ACCOUNTS_PAYABLE - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: accounting_period - applied_to_lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa - related_object_type: INVOICE - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '235' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 - related_object_type: CREDIT_NOTE - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /accounting/v1/payments/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates a `Payment` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PatchedPaymentEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.PatchedPaymentRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.PaymentResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: b26fd49a-cbae-470a-a8f8-bcbc119e0390 - remote_id: '987300' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_date: '2020-03-31T00:00:00Z' - contact: contact - account: account - payment_method: payment_method - currency: XUA - exchange_rate: '2.9' - company: company - total_amount: 50 - type: ACCOUNTS_PAYABLE - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: accounting_period - applied_to_lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: a47e11b6-c73b-4a0c-be31-130fc48177fa - related_object_type: INVOICE - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '235' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - applied_amount: '25' - applied_date: '2020-03-31T00:00:00Z' - related_object_id: 9b96a886-29a5-452b-8733-2a1e03497cf4 - related_object_type: CREDIT_NOTE - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - lineItemsRemoteFieldClassesList: - path: /accounting/v1/payments/line-items/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PaymentsLineItemsRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - metaPatchRetrieve: - path: /accounting/v1/payments/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Payment` PATCHs. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /accounting/v1/payments/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Payment` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /accounting/v1/payments/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PaymentsRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/phoneNumbers.yml b/.mock/definition/Accounting/phoneNumbers.yml deleted file mode 100644 index d5d8e3d13..000000000 --- a/.mock/definition/Accounting/phoneNumbers.yml +++ /dev/null @@ -1,49 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /accounting/v1/phone-numbers/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `AccountingPhoneNumber` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PhoneNumbersRetrieveRequest - 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: accountingRoot.AccountingPhoneNumber - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '+3198675309' - type: Mobile - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/projects.yml b/.mock/definition/Accounting/projects.yml deleted file mode 100644 index b4c587c2a..000000000 --- a/.mock/definition/Accounting/projects.yml +++ /dev/null @@ -1,157 +0,0 @@ -types: - ProjectsListRequestExpandItem: - enum: - - company - - contact - source: - openapi: accounting_v3.yml - ProjectsRetrieveRequestExpandItem: - enum: - - company - - contact - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/projects - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Project` objects. - source: - openapi: accounting_v3.yml - request: - name: ProjectsListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - allow-multiple: true - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedProjectList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Permissions Mapping - is_active: true - company: company - contact: contact - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/projects/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Project` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: ProjectsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: accountingRoot.Project - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Permissions Mapping - is_active: true - company: company - contact: contact - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/purchaseOrders.yml b/.mock/definition/Accounting/purchaseOrders.yml deleted file mode 100644 index 54247abdb..000000000 --- a/.mock/definition/Accounting/purchaseOrders.yml +++ /dev/null @@ -1,839 +0,0 @@ -types: - PurchaseOrdersListRequestExpandItem: - enum: - - accounting_period - - company - - delivery_address - - line_items - - payment_term - - tracking_categories - - vendor - source: - openapi: accounting_v3.yml - PurchaseOrdersRetrieveRequestExpandItem: - enum: - - accounting_period - - company - - delivery_address - - line_items - - payment_term - - tracking_categories - - vendor - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/purchase-orders - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `PurchaseOrder` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PurchaseOrdersListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return purchase orders for this company. - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - issue_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - issue_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - 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_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.PaginatedPurchaseOrderList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - issue_date_after: '2024-01-15T09:30:00Z' - issue_date_before: '2024-01-15T09:30:00Z' - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0048ea5b-911e-4dff-9364-92070dea62ff - remote_id: '239741' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - status: DRAFT - issue_date: '2020-03-31T00:00:00Z' - purchase_order_number: PO1234 - delivery_date: '2020-04-15T00:00:00Z' - delivery_address: delivery_address - customer: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - vendor: vendor - memo: private note - company: company - total_amount: 260 - currency: XUA - exchange_rate: '2.9' - payment_term: payment_term - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball paddles - unit_price: 25 - quantity: 10 - item: 0958cbc6-6040-430a-848e-aafacbadf4ae - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: tax_amount - total_line_amount: total_line_amount - currency: USD - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball Balls - unit_price: 1 - quantity: 10 - item: 249c9faa-3045-4a31-953b-8f22d3613301 - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: tax_amount - total_line_amount: total_line_amount - inclusive_of_tax: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: accounting_period - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /accounting/v1/purchase-orders - method: POST - auth: - - tokenAuth: [] - docs: Creates a `PurchaseOrder` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: PurchaseOrderEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.PurchaseOrderRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.PurchaseOrderResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 0048ea5b-911e-4dff-9364-92070dea62ff - remote_id: '239741' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - status: DRAFT - issue_date: '2020-03-31T00:00:00Z' - purchase_order_number: PO1234 - delivery_date: '2020-04-15T00:00:00Z' - delivery_address: delivery_address - customer: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - vendor: vendor - memo: private note - company: company - total_amount: 260 - currency: XUA - exchange_rate: '2.9' - payment_term: payment_term - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball paddles - unit_price: 25 - quantity: 10 - item: 0958cbc6-6040-430a-848e-aafacbadf4ae - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: tax_amount - total_line_amount: total_line_amount - currency: USD - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball Balls - unit_price: 1 - quantity: 10 - item: 249c9faa-3045-4a31-953b-8f22d3613301 - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: tax_amount - total_line_amount: total_line_amount - inclusive_of_tax: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: accounting_period - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /accounting/v1/purchase-orders/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `PurchaseOrder` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: PurchaseOrdersRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.PurchaseOrder - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0048ea5b-911e-4dff-9364-92070dea62ff - remote_id: '239741' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - status: DRAFT - issue_date: '2020-03-31T00:00:00Z' - purchase_order_number: PO1234 - delivery_date: '2020-04-15T00:00:00Z' - delivery_address: delivery_address - customer: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - vendor: vendor - memo: private note - company: company - total_amount: 260 - currency: XUA - exchange_rate: '2.9' - payment_term: payment_term - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball paddles - unit_price: 25 - quantity: 10 - item: 0958cbc6-6040-430a-848e-aafacbadf4ae - account: account - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: tax_amount - total_line_amount: total_line_amount - currency: USD - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - remote_fields: - - remote_field_class: remote_field_class - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - description: Pickleball Balls - unit_price: 1 - quantity: 10 - item: 249c9faa-3045-4a31-953b-8f22d3613301 - account: account - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - tax_amount: tax_amount - total_line_amount: total_line_amount - currency: XUA - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - remote_fields: - - remote_field_class: remote_field_class - inclusive_of_tax: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - accounting_period: accounting_period - remote_created_at: '2020-03-31T00:00:00Z' - remote_updated_at: '2020-03-31T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - lineItemsRemoteFieldClassesList: - path: /accounting/v1/purchase-orders/line-items/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PurchaseOrdersLineItemsRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - metaPostRetrieve: - path: /accounting/v1/purchase-orders/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `PurchaseOrder` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /accounting/v1/purchase-orders/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: PurchaseOrdersRemoteFieldClassesListRequest - query-parameters: - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: accountingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - field_choices - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/regenerateKey.yml b/.mock/definition/Accounting/regenerateKey.yml deleted file mode 100644 index 3fabcb13a..000000000 --- a/.mock/definition/Accounting/regenerateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /accounting/v1/regenerate-key - method: POST - auth: - - tokenAuth: [] - docs: Exchange remote keys. - source: - openapi: accounting_v3.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: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/scopes.yml b/.mock/definition/Accounting/scopes.yml deleted file mode 100644 index c0e2e7558..000000000 --- a/.mock/definition/Accounting/scopes.yml +++ /dev/null @@ -1,168 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - default_scopes_retrieve: - path: /accounting/v1/default-scopes - method: GET - auth: - - tokenAuth: [] - 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: accounting_v3.yml - response: - docs: '' - type: accountingRoot.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: /accounting/v1/linked-account-scopes - method: GET - auth: - - tokenAuth: [] - 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: accounting_v3.yml - response: - docs: '' - type: accountingRoot.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: /accounting/v1/linked-account-scopes - method: POST - auth: - - tokenAuth: [] - 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: accounting_v3.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: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/Accounting/syncStatus.yml b/.mock/definition/Accounting/syncStatus.yml deleted file mode 100644 index bb6eaf28e..000000000 --- a/.mock/definition/Accounting/syncStatus.yml +++ /dev/null @@ -1,64 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/sync-status - method: GET - auth: - - tokenAuth: [] - 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). - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.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: accountingRoot.PaginatedSyncStatusList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - model_name: Invoice - model_id: accounting.Invoices - 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: accounting_v3.yml diff --git a/.mock/definition/Accounting/taxRates.yml b/.mock/definition/Accounting/taxRates.yml deleted file mode 100644 index e2fedf7a5..000000000 --- a/.mock/definition/Accounting/taxRates.yml +++ /dev/null @@ -1,211 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/tax-rates - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `TaxRate` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: TaxRatesListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return tax rates for this company. - 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> - allow-multiple: true - 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. - name: - type: optional - docs: If provided, will only return TaxRates with this name. - 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: accountingRoot.PaginatedTaxRateList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: b82302de-852e-4e60-b050-edf9da3b7c02 - remote_id: '039111' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - company: company - code: '890' - name: State tax rate - description: Sales Tax - status: ACTIVE - country: US - total_tax_rate: 15 - effective_tax_rate: 15 - tax_components: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '039111' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Drink Tax Component - rate: rate - is_compound: true - component_type: SALES - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/tax-rates/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `TaxRate` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: TaxRatesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: accountingRoot.TaxRate - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: b82302de-852e-4e60-b050-edf9da3b7c02 - remote_id: '039111' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - company: company - code: '890' - name: State tax rate - description: Sales Tax - status: ACTIVE - country: US - total_tax_rate: 15 - effective_tax_rate: 15 - tax_components: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '039111' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Drink Tax Component - rate: rate - is_compound: true - component_type: SALES - remote_was_deleted: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/trackingCategories.yml b/.mock/definition/Accounting/trackingCategories.yml deleted file mode 100644 index 92b731f2a..000000000 --- a/.mock/definition/Accounting/trackingCategories.yml +++ /dev/null @@ -1,231 +0,0 @@ -types: - TrackingCategoriesListRequestCategoryType: - enum: - - value: '' - name: EMPTY - - CLASS - - DEPARTMENT - source: - openapi: accounting_v3.yml - TrackingCategoriesListRequestStatus: - enum: - - value: '' - name: EMPTY - - ACTIVE - - ARCHIVED - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/tracking-categories - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `TrackingCategory` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: TrackingCategoriesListRequest - query-parameters: - category_type: - type: optional - docs: If provided, will only return tracking categories with this type. - company_id: - type: optional - docs: >- - If provided, will only return tracking categories for this - company. - 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> - allow-multiple: true - 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. - name: - type: optional - docs: If provided, will only return tracking categories with this name. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - status: - type: optional - docs: >- - If provided, will only return tracking categories with this - status. - response: - docs: '' - type: accountingRoot.PaginatedTrackingCategoryList - status-code: 200 - examples: - - query-parameters: - category_type: '' - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - remote_fields: status - remote_id: remote_id - show_enum_origins: status - status: '' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '948201' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Marketing Department - status: ACTIVE - category_type: CLASS - parent_category: d25d609b-945f-4762-b55a-1c8fb220c43c - company: company - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - retrieve: - path: /accounting/v1/tracking-categories/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `TrackingCategory` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: TrackingCategoriesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: accountingRoot.TrackingCategory - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '948201' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Marketing Department - status: ACTIVE - category_type: CLASS - parent_category: d25d609b-945f-4762-b55a-1c8fb220c43c - company: company - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/transactions.yml b/.mock/definition/Accounting/transactions.yml deleted file mode 100644 index 480f38603..000000000 --- a/.mock/definition/Accounting/transactions.yml +++ /dev/null @@ -1,306 +0,0 @@ -types: - TransactionsListRequestExpandItem: - enum: - - account - - accounting_period - - contact - - line_items - - tracking_categories - source: - openapi: accounting_v3.yml - TransactionsRetrieveRequestExpandItem: - enum: - - account - - accounting_period - - contact - - line_items - - tracking_categories - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/transactions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Transaction` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: TransactionsListRequest - query-parameters: - company_id: - type: optional - docs: >- - If provided, will only return accounting transactions for this - company. - 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 - allow-multiple: true - 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. - transaction_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - transaction_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - response: - docs: '' - type: accountingRoot.PaginatedTransactionList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - transaction_date_after: '2024-01-15T09:30:00Z' - transaction_date_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0048ea5b-911e-4dff-9364-92070dea62ff - remote_id: '239741' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_type: estimate - number: '122' - transaction_date: '2020-03-31T00:00:00Z' - account: account - contact: contact - inclusive_of_tax: true - total_amount: total_amount - currency: XUA - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - memo: Pickleball paddles - unit_price: '25.0' - quantity: '10.0' - item: 0958cbc6-6040-430a-848e-aafacbadf4ae - account: 2b38c085-2620-4269-b5ec-75dd9095ed2c - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - total_line_amount: total_line_amount - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - currency: USD - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - memo: Pickleball balls - unit_price: '25.0' - quantity: '10.0' - item: 249c9faa-3045-4a31-953b-8f22d3613301 - account: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - total_line_amount: total_line_amount - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /accounting/v1/transactions/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Transaction` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: TransactionsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: accountingRoot.Transaction - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0048ea5b-911e-4dff-9364-92070dea62ff - remote_id: '239741' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - transaction_type: estimate - number: '122' - transaction_date: '2020-03-31T00:00:00Z' - account: account - contact: contact - inclusive_of_tax: true - total_amount: total_amount - currency: XUA - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - line_items: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - memo: Pickleball paddles - unit_price: '25.0' - quantity: '10.0' - item: 0958cbc6-6040-430a-848e-aafacbadf4ae - account: 2b38c085-2620-4269-b5ec-75dd9095ed2c - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - total_line_amount: total_line_amount - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - currency: USD - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - memo: Pickleball balls - unit_price: '25.0' - quantity: '10.0' - item: 249c9faa-3045-4a31-953b-8f22d3613301 - account: 3e442c5d-8f51-4103-b5c9-dcee39c30a08 - tracking_categories: - - f1214c24-2702-4617-b74b-3ddecfc0d384 - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - total_line_amount: total_line_amount - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - currency: XUA - exchange_rate: '2.9' - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - remote_was_deleted: true - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/vendorCredits.yml b/.mock/definition/Accounting/vendorCredits.yml deleted file mode 100644 index 1df382777..000000000 --- a/.mock/definition/Accounting/vendorCredits.yml +++ /dev/null @@ -1,611 +0,0 @@ -types: - VendorCreditsListRequestExpandItem: - enum: - - accounting_period - - company - - lines - - tracking_categories - - vendor - source: - openapi: accounting_v3.yml - VendorCreditsRetrieveRequestExpandItem: - enum: - - accounting_period - - company - - lines - - tracking_categories - - vendor - source: - openapi: accounting_v3.yml -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/vendor-credits - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `VendorCredit` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: accounting_v3.yml - request: - name: VendorCreditsListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return vendor credits for this company. - 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 - allow-multiple: true - 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. - transaction_date_after: - type: optional - docs: If provided, will only return objects created after this datetime. - transaction_date_before: - type: optional - docs: >- - If provided, will only return objects created before this - datetime. - response: - docs: '' - type: accountingRoot.PaginatedVendorCreditList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - transaction_date_after: '2024-01-15T09:30:00Z' - transaction_date_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '6' - transaction_date: '2020-03-31T00:00:00Z' - vendor: vendor - total_amount: 10000 - currency: XUA - exchange_rate: '2.9' - inclusive_of_tax: true - company: company - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: Gifted Merge Credit - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: Refund for overpayment - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - applied_to_lines: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - create: - path: /accounting/v1/vendor-credits - method: POST - auth: - - tokenAuth: [] - docs: Creates a `VendorCredit` object with the given values. - source: - openapi: accounting_v3.yml - request: - name: VendorCreditEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: accountingRoot.VendorCreditRequest - content-type: application/json - response: - docs: '' - type: accountingRoot.VendorCreditResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '6' - transaction_date: '2020-03-31T00:00:00Z' - vendor: vendor - total_amount: 10000 - currency: XUA - exchange_rate: '2.9' - inclusive_of_tax: true - company: company - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: Gifted Merge Credit - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: Refund for overpayment - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - applied_to_lines: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - 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 - retrieve: - path: /accounting/v1/vendor-credits/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `VendorCredit` object with the given `id`. - source: - openapi: accounting_v3.yml - path-parameters: - id: string - request: - name: VendorCreditsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: accountingRoot.VendorCredit - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - number: '6' - transaction_date: '2020-03-31T00:00:00Z' - vendor: vendor - total_amount: 10000 - currency: XUA - exchange_rate: '2.9' - inclusive_of_tax: true - company: company - lines: - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121222' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - net_amount: 25.54 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: Gifted Merge Credit - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: 22e65a5d-2df5-4e6e-884a-e538d0339000 - contact: 908934-49j9-093f-0989-908923908 - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - remote_was_deleted: false - - id: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: '121223' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - net_amount: 10 - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - description: Refund for overpayment - account: 9d892439-5fab-4dbb-8bd8-34f7f96c7912 - company: 595c8f97-2ac4-45b7-b000-41bdf43240b5 - project: project - contact: contact - tax_rate: a12e7c20-1922-9df7-s75n-edfeewnn7384 - exchange_rate: '2.9' - remote_was_deleted: true - tracking_categories: - - b38c59b0-a9d7-4740-b1ee-5436c6751e3d - - 9b840d2-686a-465a-8a8e-7b028498f8e4 - - a47e11b6-c73b-4a0c-be31-130fc48177fa - applied_to_lines: - - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - invoice: 5b3c1341-a20f-4e51-b72c-f3830a16c97b - applied_date: '2020-03-31T00:00:00Z' - applied_amount: '2.9' - remote_was_deleted: true - remote_was_deleted: true - accounting_period: accounting_period - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - metaPostRetrieve: - path: /accounting/v1/vendor-credits/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `VendorCredit` POSTs. - source: - openapi: accounting_v3.yml - response: - docs: '' - type: accountingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: accounting_v3.yml diff --git a/.mock/definition/Accounting/webhookReceivers.yml b/.mock/definition/Accounting/webhookReceivers.yml deleted file mode 100644 index eb04b349d..000000000 --- a/.mock/definition/Accounting/webhookReceivers.yml +++ /dev/null @@ -1,65 +0,0 @@ -imports: - accountingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /accounting/v1/webhook-receivers - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `WebhookReceiver` objects. - source: - openapi: accounting_v3.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: /accounting/v1/webhook-receivers - method: POST - auth: - - tokenAuth: [] - docs: Creates a `WebhookReceiver` object with the given values. - source: - openapi: accounting_v3.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: accountingRoot.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: accounting_v3.yml diff --git a/.mock/definition/CRM/__package__.yml b/.mock/definition/CRM/__package__.yml deleted file mode 100644 index d5382cc71..000000000 --- a/.mock/definition/CRM/__package__.yml +++ /dev/null @@ -1,5733 +0,0 @@ -types: - AccountOwner: - discriminated: false - docs: The account's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - Account: - docs: |- - # The Account Object - ### Description - The `Account` object is used to represent a company in a CRM system. - ### Usage Example - TODO - 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 - owner: - type: optional - docs: The account's owner. - name: - type: optional - docs: The account's name. - description: - type: optional - docs: The account's description. - industry: - type: optional - docs: The account's industry. - website: - type: optional - docs: The account's website. - validation: - format: uri - maxLength: 2000 - number_of_employees: - type: optional - docs: The account's number of employees. - validation: - min: -2147483648 - max: 2147483647 - addresses: optional> - phone_numbers: - type: optional> - access: read-only - last_activity_at: - type: optional - docs: >- - The last date (either most recent or furthest in the future) of when - an activity occurs in an account. - remote_updated_at: - type: optional - docs: >- - When the CRM system account data was last modified by a user with a - login. - remote_created_at: - type: optional - docs: When the third party's account was created. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - AccountDetailsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: crm_v3.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: crm_v3.yml - AccountDetailsAndActionsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: crm_v3.yml - inline: true - AccountDetailsAndActionsStatus: - discriminated: false - union: - - AccountDetailsAndActionsStatusEnum - - string - source: - openapi: crm_v3.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 - source: - openapi: crm_v3.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: crm_v3.yml - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - docs: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - source: - openapi: crm_v3.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: crm_v3.yml - AccountRequestOwner: - discriminated: false - docs: The account's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - AccountRequest: - docs: |- - # The Account Object - ### Description - The `Account` object is used to represent a company in a CRM system. - ### Usage Example - TODO - properties: - owner: - type: optional - docs: The account's owner. - name: - type: optional - docs: The account's name. - description: - type: optional - docs: The account's description. - industry: - type: optional - docs: The account's industry. - website: - type: optional - docs: The account's website. - validation: - format: uri - maxLength: 2000 - number_of_employees: - type: optional - docs: The account's number of employees. - validation: - min: -2147483648 - max: 2147483647 - addresses: optional> - last_activity_at: - type: optional - docs: >- - The last date (either most recent or furthest in the future) of when - an activity occurs in an account. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - AccountToken: - properties: - account_token: string - integration: AccountIntegration - id: string - source: - openapi: crm_v3.yml - ActivityTypeEnum: - enum: - - CALL - - MEETING - - EMAIL - docs: |- - * `CALL` - CALL - * `MEETING` - MEETING - * `EMAIL` - EMAIL - source: - openapi: crm_v3.yml - AddressCountry: - discriminated: false - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - union: - - CountryEnum - - string - source: - openapi: crm_v3.yml - inline: true - AddressAddressType: - discriminated: false - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - union: - - AddressTypeEnum - - string - source: - openapi: crm_v3.yml - inline: true - Address: - docs: |- - # The Address Object - ### Description - The `Address` object is used to represent an entity's address. - ### Usage Example - TODO - properties: - 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 - street_1: - type: optional - docs: Line 1 of the address's street. - street_2: - type: optional - docs: Line 2 of the address's street. - city: - type: optional - docs: The address's city. - state: - type: optional - docs: The address's state. - postal_code: - type: optional - docs: The address's postal code. - country: - type: optional - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - address_type: - type: optional - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - source: - openapi: crm_v3.yml - AddressRequestCountry: - discriminated: false - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - union: - - CountryEnum - - string - source: - openapi: crm_v3.yml - inline: true - AddressRequestAddressType: - discriminated: false - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - union: - - AddressTypeEnum - - string - source: - openapi: crm_v3.yml - inline: true - AddressRequest: - docs: |- - # The Address Object - ### Description - The `Address` object is used to represent an entity's address. - ### Usage Example - TODO - properties: - street_1: - type: optional - docs: Line 1 of the address's street. - street_2: - type: optional - docs: Line 2 of the address's street. - city: - type: optional - docs: The address's city. - state: - type: optional - docs: The address's state. - postal_code: - type: optional - docs: The address's postal code. - country: - type: optional - docs: |- - The address's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - address_type: - type: optional - docs: |- - The address type. - - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - AddressTypeEnum: - enum: - - BILLING - - SHIPPING - docs: |- - * `BILLING` - BILLING - * `SHIPPING` - SHIPPING - source: - openapi: crm_v3.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: crm_v3.yml - AssociationAssociationType: - discriminated: false - docs: The association type the association belongs to. - union: - - type: string - validation: - format: uuid - - AssociationType - source: - openapi: crm_v3.yml - inline: true - Association: - docs: |- - # The Association Object - ### Description - The `Association` record refers to an instance of an Association Type. - ### Usage Example - TODO - properties: - 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 - source_object: - type: optional - validation: - format: uuid - access: read-only - target_object: - type: optional - validation: - format: uuid - access: read-only - association_type: - type: optional - docs: The association type the association belongs to. - source: - openapi: crm_v3.yml - AssociationSubType: - properties: - id: - type: optional - access: read-only - 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 - origin_type: - type: optional - access: read-only - source: - openapi: crm_v3.yml - AssociationTypeCardinality: - discriminated: false - union: - - CardinalityEnum - - string - source: - openapi: crm_v3.yml - inline: true - AssociationType: - docs: >- - # The AssociationType Object - - ### Description - - The `Association Type` object represents the relationship between two - objects. - - ### Usage Example - - TODO - 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 - source_object_class: - type: optional> - docs: >- - The class of the source object (Custom Object or Common Model) for the - association type. - access: read-only - target_object_classes: - type: optional> - access: read-only - remote_key_name: optional - display_name: optional - cardinality: optional - is_required: optional - source: - openapi: crm_v3.yml - AssociationTypeRequestRequest: - properties: - source_object_class: ObjectClassDescriptionRequest - target_object_classes: list - remote_key_name: - type: string - validation: - minLength: 1 - display_name: - type: optional - validation: - minLength: 1 - cardinality: optional - is_required: - type: optional - default: false - source: - openapi: crm_v3.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid - source: - openapi: crm_v3.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: crm_v3.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: crm_v3.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: crm_v3.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: crm_v3.yml - CrmAccountResponse: - properties: - model: Account - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - CrmAssociationTypeResponse: - properties: - model: AssociationType - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - CrmContactResponse: - properties: - model: Contact - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - CrmCustomObjectResponse: - properties: - model: CustomObject - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - CardinalityEnum: - enum: - - ONE_TO_ONE - - MANY_TO_ONE - - MANY_TO_MANY - - ONE_TO_MANY - docs: |- - * `ONE_TO_ONE` - ONE_TO_ONE - * `MANY_TO_ONE` - MANY_TO_ONE - * `MANY_TO_MANY` - MANY_TO_MANY - * `ONE_TO_MANY` - ONE_TO_MANY - source: - openapi: crm_v3.yml - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: crm_v3.yml - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: crm_v3.yml - CommonModelScopeApi: - properties: - common_models: - docs: The common models you want to update the scopes for - type: list - source: - openapi: crm_v3.yml - CommonModelScopesBodyRequest: - properties: - model_id: - type: string - validation: - minLength: 1 - enabled_actions: list - disabled_fields: list - source: - openapi: crm_v3.yml - ContactAccount: - discriminated: false - docs: The contact's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - ContactOwner: - discriminated: false - docs: The contact's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - Contact: - docs: >- - # The Contact Object - - ### Description - - The `Contact` object is used to represent an existing point of contact at - a company in a CRM system. - - ### Usage Example - - TODO - 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 - first_name: - type: optional - docs: The contact's first name. - last_name: - type: optional - docs: The contact's last name. - account: - type: optional - docs: The contact's account. - owner: - type: optional - docs: The contact's owner. - addresses: optional> - email_addresses: optional> - phone_numbers: optional> - last_activity_at: - type: optional - docs: When the contact's last activity occurred. - remote_created_at: - type: optional - docs: When the third party's contact was created. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - ContactRequestAccount: - discriminated: false - docs: The contact's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - ContactRequestOwner: - discriminated: false - docs: The contact's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - ContactRequest: - docs: >- - # The Contact Object - - ### Description - - The `Contact` object is used to represent an existing point of contact at - a company in a CRM system. - - ### Usage Example - - TODO - properties: - first_name: - type: optional - docs: The contact's first name. - last_name: - type: optional - docs: The contact's last name. - account: - type: optional - docs: The contact's account. - owner: - type: optional - docs: The contact's owner. - addresses: optional> - email_addresses: optional> - phone_numbers: optional> - last_activity_at: - type: optional - docs: When the contact's last activity occurred. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - CountryEnum: - enum: - - AF - - AX - - AL - - DZ - - AS - - AD - - AO - - AI - - AQ - - AG - - AR - - AM - - AW - - AU - - AT - - AZ - - BS - - BH - - BD - - BB - - BY - - BE - - BZ - - BJ - - BM - - BT - - BO - - BQ - - BA - - BW - - BV - - BR - - IO - - BN - - BG - - BF - - BI - - CV - - KH - - CM - - CA - - KY - - CF - - TD - - CL - - CN - - CX - - CC - - CO - - KM - - CG - - CD - - CK - - CR - - CI - - HR - - CU - - CW - - CY - - CZ - - DK - - DJ - - DM - - DO - - EC - - EG - - SV - - GQ - - ER - - EE - - SZ - - ET - - FK - - FO - - FJ - - FI - - FR - - GF - - PF - - TF - - GA - - GM - - GE - - DE - - GH - - GI - - GR - - GL - - GD - - GP - - GU - - GT - - GG - - GN - - GW - - GY - - HT - - HM - - VA - - HN - - HK - - HU - - IS - - IN - - ID - - IR - - IQ - - IE - - IM - - IL - - IT - - JM - - JP - - JE - - JO - - KZ - - KE - - KI - - KW - - KG - - LA - - LV - - LB - - LS - - LR - - LY - - LI - - LT - - LU - - MO - - MG - - MW - - MY - - MV - - ML - - MT - - MH - - MQ - - MR - - MU - - YT - - MX - - FM - - MD - - MC - - MN - - ME - - MS - - MA - - MZ - - MM - - NA - - NR - - NP - - NL - - NC - - NZ - - NI - - NE - - NG - - NU - - NF - - KP - - MK - - MP - - 'NO' - - OM - - PK - - PW - - PS - - PA - - PG - - PY - - PE - - PH - - PN - - PL - - PT - - PR - - QA - - RE - - RO - - RU - - RW - - BL - - SH - - KN - - LC - - MF - - PM - - VC - - WS - - SM - - ST - - SA - - SN - - RS - - SC - - SL - - SG - - SX - - SK - - SI - - SB - - SO - - ZA - - GS - - KR - - SS - - ES - - LK - - SD - - SR - - SJ - - SE - - CH - - SY - - TW - - TJ - - TZ - - TH - - TL - - TG - - TK - - TO - - TT - - TN - - TR - - TM - - TC - - TV - - UG - - UA - - AE - - GB - - UM - - US - - UY - - UZ - - VU - - VE - - VN - - VG - - VI - - WF - - EH - - YE - - ZM - - ZW - docs: |- - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - source: - openapi: crm_v3.yml - CustomObject: - docs: |- - # The CustomObject Object - ### Description - The `Custom Object` record refers to an instance of a Custom Object Class. - ### Usage Example - TODO - 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 - object_class: - type: optional - docs: The custom object class the custom object record belongs to. - validation: - format: uuid - fields: - type: optional> - docs: The fields and values contained within the custom object record. - access: read-only - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - CustomObjectClass: - docs: >- - # The Custom Object Class Object - - ### Description - - The `Custom Object Class` object is used to represent a Custom Object - Schema in the remote system. - - ### Usage Example - - TODO - 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 - access: read-only - modified_at: - type: optional - access: read-only - name: - type: optional - docs: The custom object class's name. - description: - type: optional - docs: The custom object class's description. - labels: - type: optional>> - docs: The custom object class's singular and plural labels. - access: read-only - fields: - type: optional> - access: read-only - association_types: - type: optional>> - docs: >- - The types of associations with other models that the custom object - class can have. - access: read-only - source: - openapi: crm_v3.yml - CustomObjectRequest: - properties: - fields: map - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - 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: MethodEnum - 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: crm_v3.yml - DebugModeLog: - properties: - log_id: string - dashboard_view: string - log_summary: DebugModelLogSummary - source: - openapi: crm_v3.yml - DebugModelLogSummary: - properties: - url: string - method: string - status_code: integer - source: - openapi: crm_v3.yml - DirectionEnum: - enum: - - INBOUND - - OUTBOUND - docs: |- - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - source: - openapi: crm_v3.yml - EmailAddress: - docs: |- - # The EmailAddress Object - ### Description - The `EmailAddress` object is used to represent an entity's email address. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their email addresses. - properties: - 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 - email_address: - type: optional - docs: The email address. - email_address_type: - type: optional - docs: The email address's type. - source: - openapi: crm_v3.yml - EmailAddressRequest: - docs: |- - # The EmailAddress Object - ### Description - The `EmailAddress` object is used to represent an entity's email address. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their email addresses. - properties: - email_address: - type: optional - docs: The email address. - email_address_type: - type: optional - docs: The email address's type. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: crm_v3.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: crm_v3.yml - EngagementOwner: - discriminated: false - docs: The engagement's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - EngagementDirection: - discriminated: false - docs: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - union: - - DirectionEnum - - string - source: - openapi: crm_v3.yml - inline: true - EngagementEngagementType: - discriminated: false - docs: The engagement type of the engagement. - union: - - type: string - validation: - format: uuid - - EngagementType - source: - openapi: crm_v3.yml - inline: true - EngagementAccount: - discriminated: false - docs: The account of the engagement. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - EngagementContactsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: crm_v3.yml - inline: true - Engagement: - docs: >- - # The Engagement Object - - ### Description - - The `Engagement` object is used to represent an interaction noted in a CRM - system. - - ### Usage Example - - TODO - 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 - owner: - type: optional - docs: The engagement's owner. - content: - type: optional - docs: The engagement's content. - subject: - type: optional - docs: The engagement's subject. - direction: - type: optional - docs: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - engagement_type: - type: optional - docs: The engagement type of the engagement. - start_time: - type: optional - docs: The time at which the engagement started. - end_time: - type: optional - docs: The time at which the engagement ended. - account: - type: optional - docs: The account of the engagement. - contacts: 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - EngagementRequestOwner: - discriminated: false - docs: The engagement's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - EngagementRequestDirection: - discriminated: false - docs: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - union: - - DirectionEnum - - string - source: - openapi: crm_v3.yml - inline: true - EngagementRequestEngagementType: - discriminated: false - docs: The engagement type of the engagement. - union: - - type: string - validation: - format: uuid - - EngagementType - source: - openapi: crm_v3.yml - inline: true - EngagementRequestAccount: - discriminated: false - docs: The account of the engagement. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - EngagementRequestContactsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: crm_v3.yml - inline: true - EngagementRequest: - docs: >- - # The Engagement Object - - ### Description - - The `Engagement` object is used to represent an interaction noted in a CRM - system. - - ### Usage Example - - TODO - properties: - owner: - type: optional - docs: The engagement's owner. - content: - type: optional - docs: The engagement's content. - subject: - type: optional - docs: The engagement's subject. - direction: - type: optional - docs: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - engagement_type: - type: optional - docs: The engagement type of the engagement. - start_time: - type: optional - docs: The time at which the engagement started. - end_time: - type: optional - docs: The time at which the engagement ended. - account: - type: optional - docs: The account of the engagement. - contacts: optional>> - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - EngagementResponse: - properties: - model: Engagement - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - EngagementTypeActivityType: - discriminated: false - docs: |- - The engagement type's activity type. - - * `CALL` - CALL - * `MEETING` - MEETING - * `EMAIL` - EMAIL - union: - - ActivityTypeEnum - - string - source: - openapi: crm_v3.yml - inline: true - EngagementType: - docs: >- - # The Engagement Type Object - - ### Description - - The `Engagement Type` object is used to represent an interaction activity. - A given `Engagement` typically has an `Engagement Type` object represented - in the engagement_type field. - - ### Usage Example - - TODO - 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 - activity_type: - type: optional - docs: |- - The engagement type's activity type. - - * `CALL` - CALL - * `MEETING` - MEETING - * `EMAIL` - EMAIL - name: - type: optional - docs: The engagement type's name. - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: crm_v3.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: crm_v3.yml - ExternalTargetFieldApi: - properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only - source: - openapi: crm_v3.yml - ExternalTargetFieldApiResponse: - properties: - Account: optional> - Contact: optional> - Lead: optional> - Note: optional> - Opportunity: optional> - Stage: optional> - User: optional> - Task: optional> - Engagement: optional> - source: - openapi: crm_v3.yml - FieldFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: crm_v3.yml - FieldMappingApiInstanceTargetField: - properties: - name: string - description: string - is_organization_wide: boolean - source: - openapi: crm_v3.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: - properties: - method: optional - url_path: optional - field_traversal_path: optional> - source: - openapi: crm_v3.yml - inline: true - FieldMappingApiInstanceRemoteField: - properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - source: - openapi: crm_v3.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 - source: - openapi: crm_v3.yml - FieldMappingApiInstanceResponse: - properties: - Account: optional> - Contact: optional> - Lead: optional> - Note: optional> - Opportunity: optional> - Stage: optional> - User: optional> - Task: optional> - Engagement: optional> - source: - openapi: crm_v3.yml - FieldMappingInstanceResponse: - properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - FieldPermissionDeserializer: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: crm_v3.yml - FieldPermissionDeserializerRequest: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: crm_v3.yml - FieldTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: crm_v3.yml - IgnoreCommonModelRequestReason: - discriminated: false - union: - - ReasonEnum - - string - source: - openapi: crm_v3.yml - inline: true - IgnoreCommonModelRequest: - properties: - reason: IgnoreCommonModelRequestReason - message: - type: optional - validation: - minLength: 1 - maxLength: 256 - source: - openapi: crm_v3.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: crm_v3.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: crm_v3.yml - IssueStatus: - discriminated: false - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - union: - - IssueStatusEnum - - string - source: - openapi: crm_v3.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: crm_v3.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: crm_v3.yml - ItemFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - uuid - * `number` - url - * `date` - email - * `datetime` - phone - * `bool` - currency - * `list` - decimal - source: - openapi: crm_v3.yml - ItemSchema: - properties: - item_type: optional - item_format: optional - item_choices: optional> - source: - openapi: crm_v3.yml - ItemTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: crm_v3.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: crm_v3.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: crm_v3.yml - LeadOwner: - discriminated: false - docs: The lead's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - LeadConvertedContact: - discriminated: false - docs: The contact of the converted lead. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: crm_v3.yml - inline: true - LeadConvertedAccount: - discriminated: false - docs: The account of the converted lead. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - Lead: - docs: >- - # The Lead Object - - ### Description - - The `Lead` object is used to represent an individual who is a potential - customer. - - ### Usage Example - - TODO - 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 - owner: - type: optional - docs: The lead's owner. - lead_source: - type: optional - docs: The lead's source. - title: - type: optional - docs: The lead's title. - company: - type: optional - docs: The lead's company. - first_name: - type: optional - docs: The lead's first name. - last_name: - type: optional - docs: The lead's last name. - addresses: - type: optional> - access: read-only - email_addresses: - type: optional> - access: read-only - phone_numbers: - type: optional> - access: read-only - remote_updated_at: - type: optional - docs: When the third party's lead was updated. - remote_created_at: - type: optional - docs: When the third party's lead was created. - converted_date: - type: optional - docs: When the lead was converted. - converted_contact: - type: optional - docs: The contact of the converted lead. - converted_account: - type: optional - docs: The account of the converted lead. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - LeadRequestOwner: - discriminated: false - docs: The lead's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - LeadRequestConvertedContact: - discriminated: false - docs: The contact of the converted lead. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: crm_v3.yml - inline: true - LeadRequestConvertedAccount: - discriminated: false - docs: The account of the converted lead. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - LeadRequest: - docs: >- - # The Lead Object - - ### Description - - The `Lead` object is used to represent an individual who is a potential - customer. - - ### Usage Example - - TODO - properties: - owner: - type: optional - docs: The lead's owner. - lead_source: - type: optional - docs: The lead's source. - title: - type: optional - docs: The lead's title. - company: - type: optional - docs: The lead's company. - first_name: - type: optional - docs: The lead's first name. - last_name: - type: optional - docs: The lead's last name. - addresses: optional> - email_addresses: optional> - phone_numbers: optional> - converted_date: - type: optional - docs: When the lead was converted. - converted_contact: - type: optional - docs: The contact of the converted lead. - converted_account: - type: optional - docs: The account of the converted lead. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - LeadResponse: - properties: - model: Lead - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: crm_v3.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean - source: - openapi: crm_v3.yml - MetaResponse: - properties: - request_schema: map - remote_field_classes: optional> - status: optional - has_conditional_params: boolean - has_required_linked_account_params: boolean - source: - openapi: crm_v3.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: crm_v3.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: crm_v3.yml - ModelPermissionDeserializer: - properties: - is_enabled: optional - source: - openapi: crm_v3.yml - ModelPermissionDeserializerRequest: - properties: - is_enabled: optional - source: - openapi: crm_v3.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: crm_v3.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: crm_v3.yml - NoteOwner: - discriminated: false - docs: The note's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - NoteContact: - discriminated: false - docs: The note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: crm_v3.yml - inline: true - NoteAccount: - discriminated: false - docs: The note's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - NoteOpportunity: - discriminated: false - docs: The note's opportunity. - union: - - type: string - validation: - format: uuid - - Opportunity - source: - openapi: crm_v3.yml - inline: true - Note: - docs: |- - # The Note Object - ### Description - The `Note` object is used to represent a note on another object. - ### Usage Example - TODO - 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 - owner: - type: optional - docs: The note's owner. - content: - type: optional - docs: The note's content. - contact: - type: optional - docs: The note's contact. - account: - type: optional - docs: The note's account. - opportunity: - type: optional - docs: The note's opportunity. - remote_updated_at: - type: optional - docs: When the third party's lead was updated. - remote_created_at: - type: optional - docs: When the third party's lead was created. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - NoteRequestOwner: - discriminated: false - docs: The note's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - NoteRequestContact: - discriminated: false - docs: The note's contact. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: crm_v3.yml - inline: true - NoteRequestAccount: - discriminated: false - docs: The note's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - NoteRequestOpportunity: - discriminated: false - docs: The note's opportunity. - union: - - type: string - validation: - format: uuid - - Opportunity - source: - openapi: crm_v3.yml - inline: true - NoteRequest: - docs: |- - # The Note Object - ### Description - The `Note` object is used to represent a note on another object. - ### Usage Example - TODO - properties: - owner: - type: optional - docs: The note's owner. - content: - type: optional - docs: The note's content. - contact: - type: optional - docs: The note's contact. - account: - type: optional - docs: The note's account. - opportunity: - type: optional - docs: The note's opportunity. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - NoteResponse: - properties: - model: Note - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - ObjectClassDescriptionRequest: - properties: - id: - type: string - validation: - minLength: 1 - origin_type: OriginTypeEnum - source: - openapi: crm_v3.yml - OpportunityOwner: - discriminated: false - docs: The opportunity's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - OpportunityAccount: - discriminated: false - docs: The account of the opportunity. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - OpportunityStage: - discriminated: false - docs: The stage of the opportunity. - union: - - type: string - validation: - format: uuid - - Stage - source: - openapi: crm_v3.yml - inline: true - OpportunityStatus: - discriminated: false - docs: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - union: - - OpportunityStatusEnum - - string - source: - openapi: crm_v3.yml - inline: true - Opportunity: - docs: >- - # The Opportunity Object - - ### Description - - The `Opportunity` object is used to represent a deal opportunity in a CRM - system. - - ### Usage Example - - TODO - 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 opportunity's name. - description: - type: optional - docs: The opportunity's description. - amount: - type: optional - docs: The opportunity's amount. - validation: - min: -2147483648 - max: 2147483647 - owner: - type: optional - docs: The opportunity's owner. - account: - type: optional - docs: The account of the opportunity. - stage: - type: optional - docs: The stage of the opportunity. - status: - type: optional - docs: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - last_activity_at: - type: optional - docs: When the opportunity's last activity occurred. - close_date: - type: optional - docs: When the opportunity was closed. - remote_created_at: - type: optional - docs: When the third party's opportunity was created. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - OpportunityRequestOwner: - discriminated: false - docs: The opportunity's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - OpportunityRequestAccount: - discriminated: false - docs: The account of the opportunity. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - OpportunityRequestStage: - discriminated: false - docs: The stage of the opportunity. - union: - - type: string - validation: - format: uuid - - Stage - source: - openapi: crm_v3.yml - inline: true - OpportunityRequestStatus: - discriminated: false - docs: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - union: - - OpportunityStatusEnum - - string - source: - openapi: crm_v3.yml - inline: true - OpportunityRequest: - docs: >- - # The Opportunity Object - - ### Description - - The `Opportunity` object is used to represent a deal opportunity in a CRM - system. - - ### Usage Example - - TODO - properties: - name: - type: optional - docs: The opportunity's name. - description: - type: optional - docs: The opportunity's description. - amount: - type: optional - docs: The opportunity's amount. - validation: - min: -2147483648 - max: 2147483647 - owner: - type: optional - docs: The opportunity's owner. - account: - type: optional - docs: The account of the opportunity. - stage: - type: optional - docs: The stage of the opportunity. - status: - type: optional - docs: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - last_activity_at: - type: optional - docs: When the opportunity's last activity occurred. - close_date: - type: optional - docs: When the opportunity was closed. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - OpportunityResponse: - properties: - model: Opportunity - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - OpportunityStatusEnum: - enum: - - OPEN - - WON - - LOST - docs: |- - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - source: - openapi: crm_v3.yml - OriginTypeEnum: - enum: - - CUSTOM_OBJECT - - COMMON_MODEL - - REMOTE_ONLY_MODEL - docs: |- - * `CUSTOM_OBJECT` - CUSTOM_OBJECT - * `COMMON_MODEL` - COMMON_MODEL - * `REMOTE_ONLY_MODEL` - REMOTE_ONLY_MODEL - source: - openapi: crm_v3.yml - PaginatedAccountDetailsAndActionsList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedAccountList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedAssociationList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedAssociationTypeList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedAuditLogEventList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedContactList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedCustomObjectClassList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedCustomObjectList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedEngagementList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedEngagementTypeList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedIssueList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedLeadList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedNoteList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedOpportunityList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedRemoteFieldClassList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedStageList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedSyncStatusList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedTaskList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PaginatedUserList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: crm_v3.yml - PatchedAccountRequest: - docs: |- - # The Account Object - ### Description - The `Account` object is used to represent a company in a CRM system. - ### Usage Example - TODO - properties: - owner: - type: optional - docs: The account's owner. - validation: - format: uuid - name: - type: optional - docs: The account's name. - description: - type: optional - docs: The account's description. - industry: - type: optional - docs: The account's industry. - website: - type: optional - docs: The account's website. - validation: - format: uri - maxLength: 2000 - number_of_employees: - type: optional - docs: The account's number of employees. - validation: - min: -2147483648 - max: 2147483647 - addresses: optional> - last_activity_at: - type: optional - docs: >- - The last date (either most recent or furthest in the future) of when - an activity occurs in an account. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - PatchedContactRequestOwner: - discriminated: false - docs: The contact's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - PatchedContactRequest: - docs: >- - # The Contact Object - - ### Description - - The `Contact` object is used to represent an existing point of contact at - a company in a CRM system. - - ### Usage Example - - TODO - properties: - first_name: - type: optional - docs: The contact's first name. - last_name: - type: optional - docs: The contact's last name. - account: - type: optional - docs: The contact's account. - validation: - format: uuid - owner: - type: optional - docs: The contact's owner. - addresses: optional> - email_addresses: optional> - phone_numbers: optional> - last_activity_at: - type: optional - docs: When the contact's last activity occurred. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - PatchedEngagementRequestDirection: - discriminated: false - docs: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - union: - - DirectionEnum - - string - source: - openapi: crm_v3.yml - inline: true - PatchedEngagementRequest: - docs: >- - # The Engagement Object - - ### Description - - The `Engagement` object is used to represent an interaction noted in a CRM - system. - - ### Usage Example - - TODO - properties: - owner: - type: optional - docs: The engagement's owner. - validation: - format: uuid - content: - type: optional - docs: The engagement's content. - subject: - type: optional - docs: The engagement's subject. - direction: - type: optional - docs: |- - The engagement's direction. - - * `INBOUND` - INBOUND - * `OUTBOUND` - OUTBOUND - engagement_type: - type: optional - docs: The engagement type of the engagement. - validation: - format: uuid - start_time: - type: optional - docs: The time at which the engagement started. - end_time: - type: optional - docs: The time at which the engagement ended. - account: - type: optional - docs: The account of the engagement. - validation: - format: uuid - contacts: optional>> - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - PatchedOpportunityRequestStatus: - discriminated: false - docs: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - union: - - OpportunityStatusEnum - - string - source: - openapi: crm_v3.yml - inline: true - PatchedOpportunityRequest: - docs: >- - # The Opportunity Object - - ### Description - - The `Opportunity` object is used to represent a deal opportunity in a CRM - system. - - ### Usage Example - - TODO - properties: - name: - type: optional - docs: The opportunity's name. - description: - type: optional - docs: The opportunity's description. - amount: - type: optional - docs: The opportunity's amount. - validation: - min: -2147483648 - max: 2147483647 - owner: - type: optional - docs: The opportunity's owner. - validation: - format: uuid - account: - type: optional - docs: The account of the opportunity. - validation: - format: uuid - stage: - type: optional - docs: The stage of the opportunity. - validation: - format: uuid - status: - type: optional - docs: |- - The opportunity's status. - - * `OPEN` - OPEN - * `WON` - WON - * `LOST` - LOST - last_activity_at: - type: optional - docs: When the opportunity's last activity occurred. - close_date: - type: optional - docs: When the opportunity was closed. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - PatchedTaskRequestStatus: - discriminated: false - docs: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - union: - - TaskStatusEnum - - string - source: - openapi: crm_v3.yml - inline: true - PatchedTaskRequest: - docs: |- - # The Task Object - ### Description - The `Task` object is used to represent a task, such as a to-do item. - ### Usage Example - TODO - properties: - subject: - type: optional - docs: The task's subject. - content: - type: optional - docs: The task's content. - owner: - type: optional - docs: The task's owner. - validation: - format: uuid - account: - type: optional - docs: The task's account. - validation: - format: uuid - opportunity: - type: optional - docs: The task's opportunity. - validation: - format: uuid - completed_date: - type: optional - docs: When the task is completed. - due_date: - type: optional - docs: When the task is due. - status: - type: optional - docs: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - PhoneNumber: - docs: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent an entity's phone number. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their phone numbers. - properties: - 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 - phone_number: - type: optional - docs: The phone number. - phone_number_type: - type: optional - docs: The phone number's type. - source: - openapi: crm_v3.yml - PhoneNumberRequest: - docs: |- - # The PhoneNumber Object - ### Description - The `PhoneNumber` object is used to represent an entity's phone number. - ### Usage Example - Fetch from the `GET Contact` endpoint and view their phone numbers. - properties: - phone_number: - type: optional - docs: The phone number. - phone_number_type: - type: optional - docs: The phone number's type. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - ReasonEnum: - enum: - - GENERAL_CUSTOMER_REQUEST - - GDPR - - OTHER - docs: |- - * `GENERAL_CUSTOMER_REQUEST` - GENERAL_CUSTOMER_REQUEST - * `GDPR` - GDPR - * `OTHER` - OTHER - source: - openapi: crm_v3.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: crm_v3.yml - RemoteEndpointInfo: - properties: - method: string - url_path: string - field_traversal_path: list - source: - openapi: crm_v3.yml - RemoteFieldRemoteFieldClass: - discriminated: false - union: - - string - - RemoteFieldClass - source: - openapi: crm_v3.yml - inline: true - RemoteField: - properties: - remote_field_class: RemoteFieldRemoteFieldClass - value: optional - source: - openapi: crm_v3.yml - RemoteFieldApiCoverage: - discriminated: false - union: - - integer - - double - source: - openapi: crm_v3.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: crm_v3.yml - RemoteFieldApiResponse: - properties: - Account: optional> - Contact: optional> - Lead: optional> - Note: optional> - Opportunity: optional> - Stage: optional> - User: optional> - Task: optional> - Engagement: optional> - source: - openapi: crm_v3.yml - RemoteFieldClassFieldChoicesItem: - properties: - value: optional - display_name: optional - source: - openapi: crm_v3.yml - inline: true - RemoteFieldClass: - properties: - id: optional - display_name: optional - remote_key_name: optional - description: optional - is_custom: optional - is_required: optional - field_type: optional - field_format: optional - field_choices: optional> - item_schema: optional - source: - openapi: crm_v3.yml - RemoteFieldClassForCustomObjectClassFieldType: - discriminated: false - union: - - FieldTypeEnum - - string - source: - openapi: crm_v3.yml - inline: true - RemoteFieldClassForCustomObjectClassFieldFormat: - discriminated: false - union: - - FieldFormatEnum - - string - source: - openapi: crm_v3.yml - inline: true - RemoteFieldClassForCustomObjectClassFieldChoicesItem: - properties: - value: optional - display_name: optional - source: - openapi: crm_v3.yml - inline: true - RemoteFieldClassForCustomObjectClassItemSchema: - properties: - item_type: optional - item_format: optional - item_choices: optional>> - source: - openapi: crm_v3.yml - inline: true - RemoteFieldClassForCustomObjectClass: - properties: - 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 - display_name: optional - remote_key_name: optional - description: optional - is_required: optional - field_type: - type: optional - access: read-only - field_format: - type: optional - access: read-only - field_choices: - type: optional> - access: read-only - item_schema: - type: optional - access: read-only - source: - openapi: crm_v3.yml - RemoteFieldRequestRemoteFieldClass: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteFieldClass - source: - openapi: crm_v3.yml - inline: true - RemoteFieldRequest: - properties: - remote_field_class: RemoteFieldRequestRemoteFieldClass - value: optional - source: - openapi: crm_v3.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: crm_v3.yml - RemoteResponseResponseType: - discriminated: false - union: - - ResponseTypeEnum - - string - source: - openapi: crm_v3.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: crm_v3.yml - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - docs: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - source: - openapi: crm_v3.yml - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - docs: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - source: - openapi: crm_v3.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: crm_v3.yml - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - docs: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - source: - openapi: crm_v3.yml - Stage: - docs: |- - # The Stage Object - ### Description - The `Stage` object is used to represent the stage of an opportunity. - ### Usage Example - TODO - 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 stage's name. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.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: crm_v3.yml - SyncStatusLastSyncResult: - discriminated: false - union: - - LastSyncResultEnum - - string - source: - openapi: crm_v3.yml - inline: true - SyncStatusStatus: - discriminated: false - union: - - StatusFd5Enum - - string - source: - openapi: crm_v3.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: crm_v3.yml - TaskOwner: - discriminated: false - docs: The task's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - TaskAccount: - discriminated: false - docs: The task's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - TaskOpportunity: - discriminated: false - docs: The task's opportunity. - union: - - type: string - validation: - format: uuid - - Opportunity - source: - openapi: crm_v3.yml - inline: true - TaskStatus: - discriminated: false - docs: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - union: - - TaskStatusEnum - - string - source: - openapi: crm_v3.yml - inline: true - Task: - docs: |- - # The Task Object - ### Description - The `Task` object is used to represent a task, such as a to-do item. - ### Usage Example - TODO - 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 - subject: - type: optional - docs: The task's subject. - content: - type: optional - docs: The task's content. - owner: - type: optional - docs: The task's owner. - account: - type: optional - docs: The task's account. - opportunity: - type: optional - docs: The task's opportunity. - completed_date: - type: optional - docs: When the task is completed. - due_date: - type: optional - docs: When the task is due. - status: - type: optional - docs: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - TaskRequestOwner: - discriminated: false - docs: The task's owner. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: crm_v3.yml - inline: true - TaskRequestAccount: - discriminated: false - docs: The task's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: crm_v3.yml - inline: true - TaskRequestOpportunity: - discriminated: false - docs: The task's opportunity. - union: - - type: string - validation: - format: uuid - - Opportunity - source: - openapi: crm_v3.yml - inline: true - TaskRequestStatus: - discriminated: false - docs: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - union: - - TaskStatusEnum - - string - source: - openapi: crm_v3.yml - inline: true - TaskRequest: - docs: |- - # The Task Object - ### Description - The `Task` object is used to represent a task, such as a to-do item. - ### Usage Example - TODO - properties: - subject: - type: optional - docs: The task's subject. - content: - type: optional - docs: The task's content. - owner: - type: optional - docs: The task's owner. - account: - type: optional - docs: The task's account. - opportunity: - type: optional - docs: The task's opportunity. - completed_date: - type: optional - docs: When the task is completed. - due_date: - type: optional - docs: When the task is due. - status: - type: optional - docs: |- - The task's status. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: crm_v3.yml - TaskResponse: - properties: - model: Task - warnings: list - errors: list - logs: optional> - source: - openapi: crm_v3.yml - TaskStatusEnum: - enum: - - OPEN - - CLOSED - docs: |- - * `OPEN` - OPEN - * `CLOSED` - CLOSED - source: - openapi: crm_v3.yml - User: - docs: >- - # The User Object - - ### Description - - The `User` object is used to represent a user with a login to the CRM - system. - - ### Usage Example - - TODO - 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. - email: - type: optional - docs: The user's email address. - is_active: - type: optional - docs: Whether or not the user is active. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: crm_v3.yml - ValidationProblemSource: - properties: - pointer: string - source: - openapi: crm_v3.yml - WarningValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: crm_v3.yml - WebhookReceiver: - properties: - event: string - is_active: boolean - key: optional - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/accountDetails.yml b/.mock/definition/CRM/accountDetails.yml deleted file mode 100644 index a624217a6..000000000 --- a/.mock/definition/CRM/accountDetails.yml +++ /dev/null @@ -1,38 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /crm/v1/account-details - method: GET - auth: - - tokenAuth: [] - docs: Get details for a linked account. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/accountToken.yml b/.mock/definition/CRM/accountToken.yml deleted file mode 100644 index a58e52063..000000000 --- a/.mock/definition/CRM/accountToken.yml +++ /dev/null @@ -1,47 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /crm/v1/account-token/{public_token} - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns the account token for the end user with the provided public - token. - source: - openapi: crm_v3.yml - path-parameters: - public_token: string - response: - docs: '' - type: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/accounts.yml b/.mock/definition/CRM/accounts.yml deleted file mode 100644 index e92b3aef2..000000000 --- a/.mock/definition/CRM/accounts.yml +++ /dev/null @@ -1,903 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/accounts - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Account` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: AccountsListRequest - 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> - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - name: - type: optional - docs: If provided, will only return accounts with this name. - owner_id: - type: optional - docs: If provided, will only return accounts with this owner. - 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: crmRoot.PaginatedAccountList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - owner_id: owner_id - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - name: Merge API - description: One API for all integrations - industry: API's - website: https://merge.dev/ - number_of_employees: 276000 - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+16788879833' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_updated_at: '2022-01-09T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /accounts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /crm/v1/accounts - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Account` object with the given values. - source: - openapi: crm_v3.yml - request: - name: CrmAccountEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.AccountRequest - content-type: application/json - response: - docs: '' - type: crmRoot.CrmAccountResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - name: Merge API - description: One API for all integrations - industry: API's - website: https://merge.dev/ - number_of_employees: 276000 - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+16788879833' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_updated_at: '2022-01-09T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /accounts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /crm/v1/accounts/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Account` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: AccountsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.Account - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - name: Merge API - description: One API for all integrations - industry: API's - website: https://merge.dev/ - number_of_employees: 276000 - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+16788879833' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_updated_at: '2022-01-09T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /accounts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /crm/v1/accounts/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates an `Account` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: PatchedCrmAccountEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.PatchedAccountRequest - content-type: application/json - response: - docs: '' - type: crmRoot.CrmAccountResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - name: Merge API - description: One API for all integrations - industry: API's - website: https://merge.dev/ - number_of_employees: 276000 - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+16788879833' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_updated_at: '2022-01-09T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /accounts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - metaPatchRetrieve: - path: /crm/v1/accounts/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `CRMAccount` PATCHs. - source: - openapi: crm_v3.yml - path-parameters: - id: string - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /crm/v1/accounts/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `CRMAccount` POSTs. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /crm/v1/accounts/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: AccountsRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/associationTypes.yml b/.mock/definition/CRM/associationTypes.yml deleted file mode 100644 index 309496c42..000000000 --- a/.mock/definition/CRM/associationTypes.yml +++ /dev/null @@ -1,451 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - custom_object_classes_association_types_list: - path: /crm/v1/custom-object-classes/{custom_object_class_id}/association-types - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `AssociationType` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - request: - name: CustomObjectClassesAssociationTypesListRequest - 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> - allow-multiple: true - 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: crmRoot.PaginatedAssociationTypeList - status-code: 200 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 5bb73c32-3c6c-4757-ab7d-7d3540a1be31 - remote_id: '93' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_object_class: - id: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - origin_type: CUSTOM_OBJECT - target_object_classes: - - id: Opportunity - origin_type: COMMON_MODEL - remote_key_name: order_to_opportunity - display_name: Order to Opportunity - cardinality: ONE_TO_ONE - is_required: true - custom_object_classes_association_types_create: - path: /crm/v1/custom-object-classes/{custom_object_class_id}/association-types - method: POST - auth: - - tokenAuth: [] - docs: Creates an `AssociationType` object with the given values. - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - request: - name: CrmAssociationTypeEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.AssociationTypeRequestRequest - content-type: application/json - response: - docs: '' - type: crmRoot.CrmAssociationTypeResponse - status-code: 201 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: - source_object_class: - id: id - origin_type: CUSTOM_OBJECT - target_object_classes: - - id: id - origin_type: CUSTOM_OBJECT - remote_key_name: remote_key_name - response: - body: - model: - id: 5bb73c32-3c6c-4757-ab7d-7d3540a1be31 - remote_id: '93' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_object_class: - id: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - origin_type: CUSTOM_OBJECT - target_object_classes: - - id: Opportunity - origin_type: COMMON_MODEL - remote_key_name: order_to_opportunity - display_name: Order to Opportunity - cardinality: ONE_TO_ONE - is_required: true - 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 - custom_object_classes_association_types_retrieve: - path: >- - /crm/v1/custom-object-classes/{custom_object_class_id}/association-types/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `AssociationType` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - id: string - request: - name: CustomObjectClassesAssociationTypesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: crmRoot.AssociationType - status-code: 200 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 5bb73c32-3c6c-4757-ab7d-7d3540a1be31 - remote_id: '93' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_object_class: - id: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - origin_type: CUSTOM_OBJECT - target_object_classes: - - id: Opportunity - created_at: '2024-01-15T09:30:00Z' - modified_at: '2024-01-15T09:30:00Z' - origin_type: COMMON_MODEL - remote_key_name: order_to_opportunity - display_name: Order to Opportunity - cardinality: ONE_TO_ONE - is_required: true - custom_object_classes_association_types_meta_post_retrieve: - path: >- - /crm/v1/custom-object-classes/{custom_object_class_id}/association-types/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `CRMAssociationType` POSTs. - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/associations.yml b/.mock/definition/CRM/associations.yml deleted file mode 100644 index 435eb2445..000000000 --- a/.mock/definition/CRM/associations.yml +++ /dev/null @@ -1,166 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - custom_object_classes_custom_objects_associations_list: - path: >- - /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{object_id}/associations - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Association` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - object_id: string - request: - name: CustomObjectClassesCustomObjectsAssociationsListRequest - query-parameters: - association_type_id: - type: optional - docs: >- - If provided, will only return opportunities with this - association_type. - 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> - allow-multiple: true - 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: crmRoot.PaginatedAssociationList - status-code: 200 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - object_id: object_id - query-parameters: - association_type_id: association_type_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_object: a8f5d29f-4e50-473f-8f12-27128ffcd37a - target_object: da0b1963-be70-469c-9f8c-06a81d0fe759 - association_type: association_type - custom_object_classes_custom_objects_associations_update: - path: >- - /crm/v1/custom-object-classes/{source_class_id}/custom-objects/{source_object_id}/associations/{target_class_id}/{target_object_id}/{association_type_id} - method: PUT - auth: - - tokenAuth: [] - docs: >- - Creates an Association between `source_object_id` and `target_object_id` - of type `association_type_id`. - source: - openapi: crm_v3.yml - path-parameters: - source_class_id: string - source_object_id: string - target_class_id: string - target_object_id: string - association_type_id: string - request: - name: CustomObjectClassesCustomObjectsAssociationsUpdateRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - response: - docs: '' - type: crmRoot.Association - status-code: 200 - examples: - - path-parameters: - source_class_id: source_class_id - source_object_id: source_object_id - target_class_id: target_class_id - target_object_id: target_object_id - association_type_id: association_type_id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - response: - body: - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - source_object: a8f5d29f-4e50-473f-8f12-27128ffcd37a - target_object: da0b1963-be70-469c-9f8c-06a81d0fe759 - association_type: association_type - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/asyncPassthrough.yml b/.mock/definition/CRM/asyncPassthrough.yml deleted file mode 100644 index ee3155643..000000000 --- a/.mock/definition/CRM/asyncPassthrough.yml +++ /dev/null @@ -1,74 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /crm/v1/async-passthrough - method: POST - auth: - - tokenAuth: [] - docs: >- - Asynchronously pull data from an endpoint not currently supported by - Merge. - source: - openapi: crm_v3.yml - request: - body: crmRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: crmRoot.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: /crm/v1/async-passthrough/{async_passthrough_receipt_id} - method: GET - auth: - - tokenAuth: [] - docs: Retrieves data from earlier async-passthrough POST request - source: - openapi: crm_v3.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: crm_v3.yml -types: - AsyncPassthroughRetrieveResponse: - discriminated: false - union: - - crmRoot.RemoteResponse - - string - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/auditTrail.yml b/.mock/definition/CRM/auditTrail.yml deleted file mode 100644 index e12fd4751..000000000 --- a/.mock/definition/CRM/auditTrail.yml +++ /dev/null @@ -1,108 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/audit-trail - method: GET - auth: - - tokenAuth: [] - docs: Gets a list of audit trail events. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.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: crmRoot.PaginatedAuditLogEventList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - event_type: event_type - page_size: 1 - start_date: start_date - user_email: user_email - 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: crm_v3.yml diff --git a/.mock/definition/CRM/availableActions.yml b/.mock/definition/CRM/availableActions.yml deleted file mode 100644 index 44a78dad2..000000000 --- a/.mock/definition/CRM/availableActions.yml +++ /dev/null @@ -1,52 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /crm/v1/available-actions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of models and actions available for an account. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/contacts.yml b/.mock/definition/CRM/contacts.yml deleted file mode 100644 index c9b501e3f..000000000 --- a/.mock/definition/CRM/contacts.yml +++ /dev/null @@ -1,956 +0,0 @@ -types: - ContactsListRequestExpandItem: - enum: - - account - - owner - source: - openapi: crm_v3.yml - ContactsRetrieveRequestExpandItem: - enum: - - account - - owner - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/contacts - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Contact` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: ContactsListRequest - query-parameters: - account_id: - type: optional - docs: If provided, will only return contacts with this account. - 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. - email_addresses: - type: optional - docs: >- - If provided, will only return contacts matching the email - addresses; multiple email_addresses can be separated by commas. - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - phone_numbers: - type: optional - docs: >- - If provided, will only return contacts matching the phone numbers; - multiple phone numbers can be separated by commas. - remote_id: - type: optional - docs: The API provider's ID for the given object. - response: - docs: '' - type: crmRoot.PaginatedContactList - status-code: 200 - examples: - - query-parameters: - account_id: account_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email_addresses: email_addresses - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - phone_numbers: phone_numbers - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - account: account - owner: owner - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+13785579223' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /contacts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /crm/v1/contacts - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Contact` object with the given values. - source: - openapi: crm_v3.yml - request: - name: CrmContactEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.ContactRequest - content-type: application/json - response: - docs: '' - type: crmRoot.CrmContactResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - account: account - owner: owner - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+13785579223' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /contacts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /crm/v1/contacts/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Contact` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: ContactsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.Contact - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - account: account - owner: owner - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+13785579223' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /contacts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /crm/v1/contacts/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates a `Contact` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: PatchedCrmContactEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.PatchedContactRequest - content-type: application/json - response: - docs: '' - type: crmRoot.CrmContactResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Gil - last_name: Feig - account: account - owner: owner - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+13785579223' - phone_number_type: Mobile - last_activity_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /contacts - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - ignoreCreate: - path: /crm/v1/contacts/ignore/{model_id} - method: POST - auth: - - tokenAuth: [] - docs: >- - 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. - source: - openapi: crm_v3.yml - path-parameters: - model_id: string - request: - body: crmRoot.IgnoreCommonModelRequest - content-type: application/json - examples: - - path-parameters: - model_id: model_id - headers: - X-Account-Token: X-Account-Token - request: - reason: GENERAL_CUSTOMER_REQUEST - metaPatchRetrieve: - path: /crm/v1/contacts/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `CRMContact` PATCHs. - source: - openapi: crm_v3.yml - path-parameters: - id: string - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /crm/v1/contacts/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `CRMContact` POSTs. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /crm/v1/contacts/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: ContactsRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/customObjectClasses.yml b/.mock/definition/CRM/customObjectClasses.yml deleted file mode 100644 index abba319aa..000000000 --- a/.mock/definition/CRM/customObjectClasses.yml +++ /dev/null @@ -1,236 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/custom-object-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `CustomObjectClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: CustomObjectClassesListRequest - 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> - allow-multiple: true - 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: crmRoot.PaginatedCustomObjectClassList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - remote_id: '9579977' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: order - description: Order object - labels: - singular: Order - plural: Orders - fields: - - display_name: Order ID - remote_key_name: order_id - description: The unique ID for the order. - is_required: true - field_type: string - field_format: string - field_choices: - - {} - item_schema: - item_type: null - item_format: null - item_choices: null - - display_name: Order Quantity - remote_key_name: order_quantity - description: The number of items ordered. - is_required: true - field_type: number - field_format: number - field_choices: - - {} - item_schema: - item_type: null - item_format: null - item_choices: null - - display_name: Customer Type - remote_key_name: customer_type - description: The type of customer. - is_required: true - field_type: string - field_format: enumeration - field_choices: - - {} - - {} - association_types: - - key: value - retrieve: - path: /crm/v1/custom-object-classes/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `CustomObjectClass` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: CustomObjectClassesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: crmRoot.CustomObjectClass - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - remote_id: '9579977' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: order - description: Order object - labels: - singular: Order - plural: Orders - fields: - - created_at: '2024-01-15T09:30:00Z' - modified_at: '2024-01-15T09:30:00Z' - display_name: Order ID - remote_key_name: order_id - description: The unique ID for the order. - is_required: true - field_type: string - field_format: string - field_choices: - - {} - item_schema: - item_type: null - item_format: null - item_choices: null - - created_at: '2024-01-15T09:30:00Z' - modified_at: '2024-01-15T09:30:00Z' - display_name: Order Quantity - remote_key_name: order_quantity - description: The number of items ordered. - is_required: true - field_type: number - field_format: number - field_choices: - - {} - item_schema: - item_type: null - item_format: null - item_choices: null - - created_at: '2024-01-15T09:30:00Z' - modified_at: '2024-01-15T09:30:00Z' - display_name: Customer Type - remote_key_name: customer_type - description: The type of customer. - is_required: true - field_type: string - field_format: enumeration - field_choices: - - {} - - {} - association_types: - - key: value - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/customObjects.yml b/.mock/definition/CRM/customObjects.yml deleted file mode 100644 index ac8b5453c..000000000 --- a/.mock/definition/CRM/customObjects.yml +++ /dev/null @@ -1,522 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - custom_object_classes_custom_objects_list: - path: /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `CustomObject` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - request: - name: CustomObjectClassesCustomObjectsListRequest - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.PaginatedCustomObjectList - status-code: 200 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: da0b1963-be70-469c-9f8c-06a81d0fe759 - remote_id: '4183634295' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - object_class: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - fields: - order_id: '4183634295' - order_quantity: 50 - customer_type: Returning - remote_fields: - - remote_field_class: remote_field_class - custom_object_classes_custom_objects_create: - path: /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects - method: POST - auth: - - tokenAuth: [] - docs: Creates a `CustomObject` object with the given values. - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - request: - name: CrmCustomObjectEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.CustomObjectRequest - content-type: application/json - response: - docs: '' - type: crmRoot.CrmCustomObjectResponse - status-code: 201 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: - fields: - test_field: hello - response: - body: - model: - id: da0b1963-be70-469c-9f8c-06a81d0fe759 - remote_id: '4183634295' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - object_class: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - fields: - order_id: '4183634295' - order_quantity: 50 - customer_type: Returning - remote_fields: - - remote_field_class: remote_field_class - 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 - custom_object_classes_custom_objects_retrieve: - path: >- - /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `CustomObject` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - id: string - request: - name: CustomObjectClassesCustomObjectsRetrieveRequest - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.CustomObject - status-code: 200 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: da0b1963-be70-469c-9f8c-06a81d0fe759 - remote_id: '4183634295' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - object_class: ff1ff4cb-a66b-47dc-8e2a-50388049e602 - fields: - order_id: '4183634295' - order_quantity: 50 - customer_type: Returning - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - custom_object_classes_custom_objects_meta_post_retrieve: - path: >- - /crm/v1/custom-object-classes/{custom_object_class_id}/custom-objects/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `CRMCustomObject` POSTs. - source: - openapi: crm_v3.yml - path-parameters: - custom_object_class_id: string - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - custom_object_class_id: custom_object_class_id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - custom_object_classes_custom_objects_remote_field_classes_list: - path: /crm/v1/custom-object-classes/custom-objects/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/deleteAccount.yml b/.mock/definition/CRM/deleteAccount.yml deleted file mode 100644 index 38084283f..000000000 --- a/.mock/definition/CRM/deleteAccount.yml +++ /dev/null @@ -1,17 +0,0 @@ -service: - auth: false - base-path: '' - endpoints: - delete: - path: /crm/v1/delete-account - method: POST - auth: - - tokenAuth: [] - docs: Delete a linked account. - source: - openapi: crm_v3.yml - examples: - - headers: - X-Account-Token: X-Account-Token - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/engagementTypes.yml b/.mock/definition/CRM/engagementTypes.yml deleted file mode 100644 index f4d2dbfd5..000000000 --- a/.mock/definition/CRM/engagementTypes.yml +++ /dev/null @@ -1,243 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/engagement-types - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `EngagementType` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: EngagementTypesListRequest - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.PaginatedEngagementTypeList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - activity_type: CALL - name: First Call - remote_fields: - - remote_field_class: remote_field_class - retrieve: - path: /crm/v1/engagement-types/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `EngagementType` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: EngagementTypesRetrieveRequest - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.EngagementType - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - activity_type: CALL - name: First Call - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - remoteFieldClassesList: - path: /crm/v1/engagement-types/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: EngagementTypesRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/engagements.yml b/.mock/definition/CRM/engagements.yml deleted file mode 100644 index 194abfdc0..000000000 --- a/.mock/definition/CRM/engagements.yml +++ /dev/null @@ -1,868 +0,0 @@ -types: - EngagementsListRequestExpandItem: - enum: - - account - - contacts - - engagement_type - - owner - source: - openapi: crm_v3.yml - EngagementsRetrieveRequestExpandItem: - enum: - - account - - contacts - - engagement_type - - owner - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/engagements - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Engagement` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: EngagementsListRequest - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - started_after: - type: optional - docs: >- - If provided, will only return engagements started after this - datetime. - started_before: - type: optional - docs: >- - If provided, will only return engagements started before this - datetime. - response: - docs: '' - type: crmRoot.PaginatedEngagementList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - started_after: '2024-01-15T09:30:00Z' - started_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - content: Call for negotiation - subject: Call from customer - direction: INBOUND - engagement_type: engagement_type - start_time: '2022-02-10T00:00:00Z' - end_time: '2022-02-10T00:05:00Z' - account: account - contacts: - - a7c55bc6-2940-c80a-848e-bbfacbfdf4fg - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /engagements - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /crm/v1/engagements - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Engagement` object with the given values. - source: - openapi: crm_v3.yml - request: - name: EngagementEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.EngagementRequest - content-type: application/json - response: - docs: '' - type: crmRoot.EngagementResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - content: Call for negotiation - subject: Call from customer - direction: INBOUND - engagement_type: engagement_type - start_time: '2022-02-10T00:00:00Z' - end_time: '2022-02-10T00:05:00Z' - account: account - contacts: - - a7c55bc6-2940-c80a-848e-bbfacbfdf4fg - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /engagements - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /crm/v1/engagements/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Engagement` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: EngagementsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.Engagement - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - content: Call for negotiation - subject: Call from customer - direction: INBOUND - engagement_type: engagement_type - start_time: '2022-02-10T00:00:00Z' - end_time: '2022-02-10T00:05:00Z' - account: account - contacts: - - a7c55bc6-2940-c80a-848e-bbfacbfdf4fg - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /engagements - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /crm/v1/engagements/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates an `Engagement` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: PatchedEngagementEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.PatchedEngagementRequest - content-type: application/json - response: - docs: '' - type: crmRoot.EngagementResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - content: Call for negotiation - subject: Call from customer - direction: INBOUND - engagement_type: engagement_type - start_time: '2022-02-10T00:00:00Z' - end_time: '2022-02-10T00:05:00Z' - account: account - contacts: - - a7c55bc6-2940-c80a-848e-bbfacbfdf4fg - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /engagements - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - metaPatchRetrieve: - path: /crm/v1/engagements/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Engagement` PATCHs. - source: - openapi: crm_v3.yml - path-parameters: - id: string - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /crm/v1/engagements/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Engagement` POSTs. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /crm/v1/engagements/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: EngagementsRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/fieldMapping.yml b/.mock/definition/CRM/fieldMapping.yml deleted file mode 100644 index efd75ffee..000000000 --- a/.mock/definition/CRM/fieldMapping.yml +++ /dev/null @@ -1,673 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - field_mappings_retrieve: - path: /crm/v1/field-mappings - method: GET - auth: - - tokenAuth: [] - 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: crm_v3.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: crmRoot.FieldMappingApiInstanceResponse - status-code: 200 - examples: - - query-parameters: - exclude_remote_field_metadata: true - headers: - X-Account-Token: X-Account-Token - response: - body: - Account: - - 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 - Contact: - - 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 - Lead: - - 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 - Note: - - 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 - Opportunity: - - 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 - Stage: - - 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 - 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 - Task: - - 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 - Engagement: - - 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 - field_mappings_create: - path: /crm/v1/field-mappings - method: POST - auth: - - tokenAuth: [] - 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: crm_v3.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 - content-type: application/json - response: - docs: '' - type: crmRoot.FieldMappingInstanceResponse - status-code: 201 - examples: - - query-parameters: - exclude_remote_field_metadata: true - 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 - 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: /crm/v1/field-mappings/{field_mapping_id} - method: DELETE - auth: - - tokenAuth: [] - 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: crm_v3.yml - path-parameters: - field_mapping_id: string - response: - docs: '' - type: crmRoot.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 - 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: /crm/v1/field-mappings/{field_mapping_id} - method: PATCH - auth: - - tokenAuth: [] - 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: crm_v3.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 - content-type: application/json - response: - docs: '' - type: crmRoot.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 - 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: /crm/v1/remote-fields - method: GET - auth: - - tokenAuth: [] - 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: crm_v3.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: crmRoot.RemoteFieldApiResponse - status-code: 200 - examples: - - query-parameters: - common_models: common_models - include_example_values: include_example_values - headers: - X-Account-Token: X-Account-Token - response: - body: - Account: - - 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 - Contact: - - 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 - Lead: - - 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 - Note: - - 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 - Opportunity: - - 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 - Stage: - - 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 - Task: - - 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 - Engagement: - - 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: /crm/v1/target-fields - method: GET - auth: - - tokenAuth: [] - 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: crm_v3.yml - response: - docs: '' - type: crmRoot.ExternalTargetFieldApiResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - Account: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Contact: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Lead: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Note: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Opportunity: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Stage: - - 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 - Task: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Engagement: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/forceResync.yml b/.mock/definition/CRM/forceResync.yml deleted file mode 100644 index 0e4c7b717..000000000 --- a/.mock/definition/CRM/forceResync.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - sync_status_resync_create: - path: /crm/v1/sync-status/resync - method: POST - auth: - - tokenAuth: [] - 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: crm_v3.yml - response: - docs: '' - type: list - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - - model_name: Account - model_id: crm.Account - 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: crm_v3.yml diff --git a/.mock/definition/CRM/generateKey.yml b/.mock/definition/CRM/generateKey.yml deleted file mode 100644 index 939253df9..000000000 --- a/.mock/definition/CRM/generateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /crm/v1/generate-key - method: POST - auth: - - tokenAuth: [] - docs: Create a remote key. - source: - openapi: crm_v3.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: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/issues.yml b/.mock/definition/CRM/issues.yml deleted file mode 100644 index 5f20722df..000000000 --- a/.mock/definition/CRM/issues.yml +++ /dev/null @@ -1,154 +0,0 @@ -types: - IssuesListRequestStatus: - enum: - - ONGOING - - RESOLVED - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/issues - method: GET - auth: - - tokenAuth: [] - docs: Gets all issues for Organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.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: crmRoot.PaginatedIssueList - status-code: 200 - examples: - - query-parameters: - account_token: account_token - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - end_user_organization_name: end_user_organization_name - first_incident_time_after: '2024-01-15T09:30:00Z' - first_incident_time_before: '2024-01-15T09:30:00Z' - include_muted: include_muted - integration_name: integration_name - last_incident_time_after: '2024-01-15T09:30:00Z' - last_incident_time_before: '2024-01-15T09:30:00Z' - linked_account_id: linked_account_id - page_size: 1 - start_date: start_date - status: ONGOING - 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: /crm/v1/issues/{id} - method: GET - auth: - - tokenAuth: [] - docs: Get a specific issue. - source: - openapi: crm_v3.yml - path-parameters: - id: string - response: - docs: '' - type: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/leads.yml b/.mock/definition/CRM/leads.yml deleted file mode 100644 index 8533bc14d..000000000 --- a/.mock/definition/CRM/leads.yml +++ /dev/null @@ -1,663 +0,0 @@ -types: - LeadsListRequestExpandItem: - enum: - - converted_account - - converted_contact - - owner - source: - openapi: crm_v3.yml - LeadsRetrieveRequestExpandItem: - enum: - - converted_account - - converted_contact - - owner - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/leads - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Lead` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: LeadsListRequest - query-parameters: - converted_account_id: - type: optional - docs: If provided, will only return leads with this account. - converted_contact_id: - type: optional - docs: If provided, will only return leads with this contact. - 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. - email_addresses: - type: optional - docs: >- - If provided, will only return contacts matching the email - addresses; multiple email_addresses can be separated by commas. - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - owner_id: - type: optional - docs: If provided, will only return leads with this owner. - page_size: - type: optional - docs: Number of results to return per page. - phone_numbers: - type: optional - docs: >- - If provided, will only return contacts matching the phone numbers; - multiple phone numbers can be separated by commas. - remote_id: - type: optional - docs: The API provider's ID for the given object. - response: - docs: '' - type: crmRoot.PaginatedLeadList - status-code: 200 - examples: - - query-parameters: - converted_account_id: converted_account_id - converted_contact_id: converted_contact_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email_addresses: email_addresses - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - owner_id: owner_id - page_size: 1 - phone_numbers: phone_numbers - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - lead_source: API Blogger - title: Co-Founder - company: Merge API - first_name: Gil - last_name: Feig - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+16789932455' - phone_number_type: Mobile - remote_updated_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - converted_date: '2022-03-10T00:00:00Z' - converted_contact: converted_contact - converted_account: converted_account - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leads - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /crm/v1/leads - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Lead` object with the given values. - source: - openapi: crm_v3.yml - request: - name: LeadEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.LeadRequest - content-type: application/json - response: - docs: '' - type: crmRoot.LeadResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - lead_source: API Blogger - title: Co-Founder - company: Merge API - first_name: Gil - last_name: Feig - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+16789932455' - phone_number_type: Mobile - remote_updated_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - converted_date: '2022-03-10T00:00:00Z' - converted_contact: converted_contact - converted_account: converted_account - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leads - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /crm/v1/leads/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Lead` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: LeadsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.Lead - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - lead_source: API Blogger - title: Co-Founder - company: Merge API - first_name: Gil - last_name: Feig - addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - street_1: 50 Bowling Green Dr - street_2: Golden Gate Park - city: San Francisco - state: CA - postal_code: '94122' - country: US - address_type: Shipping - email_addresses: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - email_address: hello@merge.dev - email_address_type: Work - phone_numbers: - - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - phone_number: '+16789932455' - phone_number_type: Mobile - remote_updated_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - converted_date: '2022-03-10T00:00:00Z' - converted_contact: converted_contact - converted_account: converted_account - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leads - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - metaPostRetrieve: - path: /crm/v1/leads/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Lead` POSTs. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /crm/v1/leads/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: LeadsRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/linkToken.yml b/.mock/definition/CRM/linkToken.yml deleted file mode 100644 index b1945f329..000000000 --- a/.mock/definition/CRM/linkToken.yml +++ /dev/null @@ -1,155 +0,0 @@ -imports: - crmRoot: __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: - - crmRoot.LanguageEnum - - string - source: - openapi: crm_v3.yml - inline: true -service: - auth: false - base-path: '' - endpoints: - create: - path: /crm/v1/link-token - method: POST - auth: - - tokenAuth: [] - docs: Creates a link token to be used when linking a new end user. - source: - openapi: crm_v3.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: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/linkedAccounts.yml b/.mock/definition/CRM/linkedAccounts.yml deleted file mode 100644 index f938ea57b..000000000 --- a/.mock/definition/CRM/linkedAccounts.yml +++ /dev/null @@ -1,169 +0,0 @@ -types: - LinkedAccountsListRequestCategory: - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/linked-accounts - method: GET - auth: - - tokenAuth: [] - docs: List linked accounts for your organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: LinkedAccountsListRequest - query-parameters: - category: - type: optional - docs: >- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, - `mktg`, `ticketing` - - - * `hris` - hris - - * `ats` - ats - - * `accounting` - accounting - - * `ticketing` - ticketing - - * `crm` - crm - - * `mktg` - mktg - - * `filestorage` - filestorage - 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: crmRoot.PaginatedAccountDetailsAndActionsList - status-code: 200 - examples: - - query-parameters: - category: accounting - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - 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: true - integration_name: integration_name - is_test_account: is_test_account - page_size: 1 - status: status - 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' - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/notes.yml b/.mock/definition/CRM/notes.yml deleted file mode 100644 index de0873c39..000000000 --- a/.mock/definition/CRM/notes.yml +++ /dev/null @@ -1,585 +0,0 @@ -types: - NotesListRequestExpandItem: - enum: - - account - - contact - - opportunity - - owner - source: - openapi: crm_v3.yml - NotesRetrieveRequestExpandItem: - enum: - - account - - contact - - opportunity - - owner - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/notes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Note` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: NotesListRequest - query-parameters: - account_id: - type: optional - docs: If provided, will only return notes with this account. - contact_id: - type: optional - docs: If provided, will only return notes with this contact. - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - opportunity_id: - type: optional - docs: If provided, will only return notes with this opportunity. - owner_id: - type: optional - docs: If provided, will only return notes with this owner. - 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: crmRoot.PaginatedNoteList - status-code: 200 - examples: - - query-parameters: - account_id: account_id - contact_id: contact_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - opportunity_id: opportunity_id - owner_id: owner_id - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - content: Merge is hiring! - contact: contact - account: account - opportunity: opportunity - remote_updated_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /notes - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /crm/v1/notes - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Note` object with the given values. - source: - openapi: crm_v3.yml - request: - name: NoteEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.NoteRequest - content-type: application/json - response: - docs: '' - type: crmRoot.NoteResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - content: Merge is hiring! - contact: contact - account: account - opportunity: opportunity - remote_updated_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /notes - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /crm/v1/notes/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Note` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: NotesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.Note - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - owner: owner - content: Merge is hiring! - contact: contact - account: account - opportunity: opportunity - remote_updated_at: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /notes - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - metaPostRetrieve: - path: /crm/v1/notes/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Note` POSTs. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /crm/v1/notes/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: NotesRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/opportunities.yml b/.mock/definition/CRM/opportunities.yml deleted file mode 100644 index 5b149aa5d..000000000 --- a/.mock/definition/CRM/opportunities.yml +++ /dev/null @@ -1,916 +0,0 @@ -types: - OpportunitiesListRequestExpandItem: - enum: - - account - - owner - - stage - source: - openapi: crm_v3.yml - OpportunitiesListRequestStatus: - enum: - - LOST - - OPEN - - WON - source: - openapi: crm_v3.yml - OpportunitiesRetrieveRequestExpandItem: - enum: - - account - - owner - - stage - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/opportunities - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Opportunity` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: OpportunitiesListRequest - query-parameters: - account_id: - type: optional - docs: If provided, will only return opportunities with this account. - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - owner_id: - type: optional - docs: If provided, will only return opportunities with this owner. - page_size: - type: optional - docs: Number of results to return per page. - remote_created_after: - type: optional - docs: >- - If provided, will only return opportunities created in the third - party platform after this datetime. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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: - type: optional - docs: If provided, will only return opportunities with this stage. - status: - type: optional - docs: >- - If provided, will only return opportunities with this status. - Options: ('OPEN', 'WON', 'LOST') - - - * `OPEN` - OPEN - - * `WON` - WON - - * `LOST` - LOST - response: - docs: '' - type: crmRoot.PaginatedOpportunityList - status-code: 200 - examples: - - query-parameters: - account_id: account_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - owner_id: owner_id - page_size: 1 - remote_created_after: '2024-01-15T09:30:00Z' - remote_fields: status - remote_id: remote_id - show_enum_origins: status - stage_id: stage_id - status: LOST - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Needs Integrations - description: Needs a Unified API for Integrations! - amount: 100000 - owner: owner - account: account - stage: stage - status: OPEN - last_activity_at: '2022-02-10T00:00:00Z' - close_date: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /opportunities - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /crm/v1/opportunities - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Opportunity` object with the given values. - source: - openapi: crm_v3.yml - request: - name: OpportunityEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.OpportunityRequest - content-type: application/json - response: - docs: '' - type: crmRoot.OpportunityResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Needs Integrations - description: Needs a Unified API for Integrations! - amount: 100000 - owner: owner - account: account - stage: stage - status: OPEN - last_activity_at: '2022-02-10T00:00:00Z' - close_date: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /opportunities - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /crm/v1/opportunities/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Opportunity` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: OpportunitiesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: crmRoot.Opportunity - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - remote_fields: status - show_enum_origins: status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Needs Integrations - description: Needs a Unified API for Integrations! - amount: 100000 - owner: owner - account: account - stage: stage - status: OPEN - last_activity_at: '2022-02-10T00:00:00Z' - close_date: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /opportunities - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /crm/v1/opportunities/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates an `Opportunity` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: PatchedOpportunityEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.PatchedOpportunityRequest - content-type: application/json - response: - docs: '' - type: crmRoot.OpportunityResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Needs Integrations - description: Needs a Unified API for Integrations! - amount: 100000 - owner: owner - account: account - stage: stage - status: OPEN - last_activity_at: '2022-02-10T00:00:00Z' - close_date: '2022-02-10T00:00:00Z' - remote_created_at: '2021-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /opportunities - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - metaPatchRetrieve: - path: /crm/v1/opportunities/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Opportunity` PATCHs. - source: - openapi: crm_v3.yml - path-parameters: - id: string - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /crm/v1/opportunities/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Opportunity` POSTs. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /crm/v1/opportunities/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: OpportunitiesRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/passthrough.yml b/.mock/definition/CRM/passthrough.yml deleted file mode 100644 index 98ff45f26..000000000 --- a/.mock/definition/CRM/passthrough.yml +++ /dev/null @@ -1,42 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /crm/v1/passthrough - method: POST - auth: - - tokenAuth: [] - docs: Pull data from an endpoint not currently supported by Merge. - source: - openapi: crm_v3.yml - request: - body: crmRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/regenerateKey.yml b/.mock/definition/CRM/regenerateKey.yml deleted file mode 100644 index a926ee2a5..000000000 --- a/.mock/definition/CRM/regenerateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /crm/v1/regenerate-key - method: POST - auth: - - tokenAuth: [] - docs: Exchange remote keys. - source: - openapi: crm_v3.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: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/scopes.yml b/.mock/definition/CRM/scopes.yml deleted file mode 100644 index 1c60baaea..000000000 --- a/.mock/definition/CRM/scopes.yml +++ /dev/null @@ -1,167 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - default_scopes_retrieve: - path: /crm/v1/default-scopes - method: GET - auth: - - tokenAuth: [] - 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: crm_v3.yml - response: - docs: '' - type: crmRoot.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: /crm/v1/linked-account-scopes - method: GET - auth: - - tokenAuth: [] - 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: crm_v3.yml - response: - docs: '' - type: crmRoot.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: /crm/v1/linked-account-scopes - method: POST - auth: - - tokenAuth: [] - 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: crm_v3.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: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/CRM/stages.yml b/.mock/definition/CRM/stages.yml deleted file mode 100644 index 74830b933..000000000 --- a/.mock/definition/CRM/stages.yml +++ /dev/null @@ -1,261 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/stages - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Stage` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: StagesListRequest - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.PaginatedStageList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0358cbc6-2040-430a-848e-aafacbadf3aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Closed Won - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /stages - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - retrieve: - path: /crm/v1/stages/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Stage` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: StagesRetrieveRequest - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.Stage - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0358cbc6-2040-430a-848e-aafacbadf3aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Closed Won - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /stages - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - remoteFieldClassesList: - path: /crm/v1/stages/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: StagesRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/syncStatus.yml b/.mock/definition/CRM/syncStatus.yml deleted file mode 100644 index ec796fcbf..000000000 --- a/.mock/definition/CRM/syncStatus.yml +++ /dev/null @@ -1,60 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/sync-status - method: GET - auth: - - tokenAuth: [] - 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: crm_v3.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: crmRoot.PaginatedSyncStatusList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - model_name: Account - model_id: crm.Account - 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: crm_v3.yml diff --git a/.mock/definition/CRM/tasks.yml b/.mock/definition/CRM/tasks.yml deleted file mode 100644 index b91eaeb7d..000000000 --- a/.mock/definition/CRM/tasks.yml +++ /dev/null @@ -1,846 +0,0 @@ -types: - TasksListRequestExpandItem: - enum: - - account - - opportunity - - owner - source: - openapi: crm_v3.yml - TasksRetrieveRequestExpandItem: - enum: - - account - - opportunity - - owner - source: - openapi: crm_v3.yml -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/tasks - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Task` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: TasksListRequest - 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 - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.PaginatedTaskList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - subject: Contact about Integration Strategy - content: Follow up to see whether they need integrations - owner: owner - account: account - opportunity: opportunity - completed_date: '2022-02-11T00:00:00Z' - due_date: '2022-02-10T00:00:00Z' - status: OPEN - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /tasks - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - create: - path: /crm/v1/tasks - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Task` object with the given values. - source: - openapi: crm_v3.yml - request: - name: TaskEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.TaskRequest - content-type: application/json - response: - docs: '' - type: crmRoot.TaskResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - subject: Contact about Integration Strategy - content: Follow up to see whether they need integrations - owner: owner - account: account - opportunity: opportunity - completed_date: '2022-02-11T00:00:00Z' - due_date: '2022-02-10T00:00:00Z' - status: OPEN - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /tasks - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /crm/v1/tasks/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Task` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: TasksRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.Task - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - subject: Contact about Integration Strategy - content: Follow up to see whether they need integrations - owner: owner - account: account - opportunity: opportunity - completed_date: '2022-02-11T00:00:00Z' - due_date: '2022-02-10T00:00:00Z' - status: OPEN - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /tasks - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /crm/v1/tasks/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates a `Task` object with the given `id`. - source: - openapi: crm_v3.yml - path-parameters: - id: string - request: - name: PatchedTaskEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: crmRoot.PatchedTaskRequest - content-type: application/json - response: - docs: '' - type: crmRoot.TaskResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 550e8400-e29b-41d4-a716-446655440000 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - subject: Contact about Integration Strategy - content: Follow up to see whether they need integrations - owner: owner - account: account - opportunity: opportunity - completed_date: '2022-02-11T00:00:00Z' - due_date: '2022-02-10T00:00:00Z' - status: OPEN - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /tasks - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - 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 - metaPatchRetrieve: - path: /crm/v1/tasks/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Task` PATCHs. - source: - openapi: crm_v3.yml - path-parameters: - id: string - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /crm/v1/tasks/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Task` POSTs. - source: - openapi: crm_v3.yml - response: - docs: '' - type: crmRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /crm/v1/tasks/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: TasksRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/users.yml b/.mock/definition/CRM/users.yml deleted file mode 100644 index 350a5a29e..000000000 --- a/.mock/definition/CRM/users.yml +++ /dev/null @@ -1,293 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/users - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `User` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.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. - email: - type: optional - docs: If provided, will only return users with this email. - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.PaginatedUserList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email: email - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0358cbc6-2040-430a-848e-aafacbadf3aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Gil Feig - email: merge_is_hiring@merge.dev - is_active: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /users - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - retrieve: - path: /crm/v1/users/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `User` object with the given `id`. - source: - openapi: crm_v3.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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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: crmRoot.User - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0358cbc6-2040-430a-848e-aafacbadf3aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Gil Feig - email: merge_is_hiring@merge.dev - is_active: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /users - data: - - Varies by platform - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - ignoreCreate: - path: /crm/v1/users/ignore/{model_id} - method: POST - auth: - - tokenAuth: [] - docs: >- - 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. - source: - openapi: crm_v3.yml - path-parameters: - model_id: string - request: - body: crmRoot.IgnoreCommonModelRequest - content-type: application/json - examples: - - path-parameters: - model_id: model_id - headers: - X-Account-Token: X-Account-Token - request: - reason: GENERAL_CUSTOMER_REQUEST - remoteFieldClassesList: - path: /crm/v1/users/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: crm_v3.yml - request: - name: UsersRemoteFieldClassesListRequest - query-parameters: - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: crmRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: crm_v3.yml diff --git a/.mock/definition/CRM/webhookReceivers.yml b/.mock/definition/CRM/webhookReceivers.yml deleted file mode 100644 index 03ae2b0cd..000000000 --- a/.mock/definition/CRM/webhookReceivers.yml +++ /dev/null @@ -1,65 +0,0 @@ -imports: - crmRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /crm/v1/webhook-receivers - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `WebhookReceiver` objects. - source: - openapi: crm_v3.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: /crm/v1/webhook-receivers - method: POST - auth: - - tokenAuth: [] - docs: Creates a `WebhookReceiver` object with the given values. - source: - openapi: crm_v3.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: crmRoot.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: crm_v3.yml diff --git a/.mock/definition/FileStorage/__package__.yml b/.mock/definition/FileStorage/__package__.yml deleted file mode 100644 index f07c96e32..000000000 --- a/.mock/definition/FileStorage/__package__.yml +++ /dev/null @@ -1,2404 +0,0 @@ -types: - AccountDetailsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: filestorage_v3.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: filestorage_v3.yml - AccountDetailsAndActionsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: filestorage_v3.yml - inline: true - AccountDetailsAndActionsStatus: - discriminated: false - union: - - AccountDetailsAndActionsStatusEnum - - string - source: - openapi: filestorage_v3.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 - source: - openapi: filestorage_v3.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: filestorage_v3.yml - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - docs: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - source: - openapi: filestorage_v3.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: filestorage_v3.yml - AccountToken: - properties: - account_token: string - integration: AccountIntegration - id: string - source: - openapi: filestorage_v3.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: filestorage_v3.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid - source: - openapi: filestorage_v3.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: filestorage_v3.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: filestorage_v3.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: filestorage_v3.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: filestorage_v3.yml - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: filestorage_v3.yml - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: filestorage_v3.yml - CommonModelScopeApi: - properties: - common_models: - docs: The common models you want to update the scopes for - type: list - source: - openapi: filestorage_v3.yml - CommonModelScopesBodyRequest: - properties: - model_id: - type: string - validation: - minLength: 1 - enabled_actions: list - disabled_fields: list - source: - openapi: filestorage_v3.yml - 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: MethodEnum - 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: filestorage_v3.yml - DebugModeLog: - properties: - log_id: string - dashboard_view: string - log_summary: DebugModelLogSummary - source: - openapi: filestorage_v3.yml - DebugModelLogSummary: - properties: - url: string - method: string - status_code: integer - source: - openapi: filestorage_v3.yml - DownloadRequestMeta: - properties: - id: string - url: string - method: string - headers: map - source: - openapi: filestorage_v3.yml - Drive: - docs: >- - # The Drive Object - - ### Description - - The `Drive` object is used to represent a drive that contains the folders - and files in the user's workspace. - - ### Usage Example - - Fetch from the `GET /api/filestorage/v1/drives` endpoint and view their - drives. - 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 drive's name. - validation: - maxLength: 254 - remote_created_at: - type: optional - docs: When the third party's drive was created. - drive_url: - type: optional - docs: The drive'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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: filestorage_v3.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: filestorage_v3.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: filestorage_v3.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: filestorage_v3.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: filestorage_v3.yml - ExternalTargetFieldApi: - properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only - source: - openapi: filestorage_v3.yml - ExternalTargetFieldApiResponse: - properties: - File: optional> - Folder: optional> - Drive: optional> - Group: optional> - User: optional> - source: - openapi: filestorage_v3.yml - FieldMappingApiInstanceTargetField: - properties: - name: string - description: string - is_organization_wide: boolean - source: - openapi: filestorage_v3.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: - properties: - method: optional - url_path: optional - field_traversal_path: optional> - source: - openapi: filestorage_v3.yml - inline: true - FieldMappingApiInstanceRemoteField: - properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - source: - openapi: filestorage_v3.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 - source: - openapi: filestorage_v3.yml - FieldMappingApiInstanceResponse: - properties: - File: optional> - Folder: optional> - Drive: optional> - Group: optional> - User: optional> - source: - openapi: filestorage_v3.yml - FieldMappingInstanceResponse: - properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> - source: - openapi: filestorage_v3.yml - FieldPermissionDeserializer: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: filestorage_v3.yml - FieldPermissionDeserializerRequest: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: filestorage_v3.yml - FileFolder: - discriminated: false - docs: The folder that the file belongs to. - union: - - type: string - validation: - format: uuid - - Folder - source: - openapi: filestorage_v3.yml - inline: true - FilePermissionsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Permission - source: - openapi: filestorage_v3.yml - inline: true - FilePermissions: - discriminated: false - docs: >- - The Permission object is used to represent a user's or group's access to a - File or Folder. Permissions are unexpanded by default. Use the query param - `expand=permissions` to see more details under `GET /files`. - union: - - type: string - validation: - format: uuid - - Permission - - list - source: - openapi: filestorage_v3.yml - inline: true - FileDrive: - discriminated: false - docs: The drive that the file belongs to. - union: - - type: string - validation: - format: uuid - - Drive - source: - openapi: filestorage_v3.yml - inline: true - File: - docs: >- - # The File Object - - ### Description - - The `File` object is used to represent a file in the workspace. The Object - typically exists under a folder or drive, if it exists. - - ### Usage Example - - Fetch from the `GET /api/filestorage/v1/files` endpoint and view their - files. - 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 file's name. - validation: - maxLength: 254 - file_url: - type: optional - docs: The URL to access the file. - validation: - maxLength: 2000 - file_thumbnail_url: - type: optional - docs: >- - The URL that produces a thumbnail preview of the file. Typically an - image. - validation: - maxLength: 2000 - size: - type: optional - docs: The file's size, in bytes. - mime_type: - type: optional - docs: The file's mime type. - validation: - maxLength: 128 - description: - type: optional - docs: The file's description. - validation: - maxLength: 2000 - folder: - type: optional - docs: The folder that the file belongs to. - checksum: - type: optional> - docs: >- - This field stores file checksum data. 'type' indicates the algorithm - (e.g. crc_32, sha1, sha256, quickXor, or md5), and 'content_hash' is - the unique hash used to verify file integrity and detect alterations. - permissions: - type: optional - docs: >- - The Permission object is used to represent a user's or group's access - to a File or Folder. Permissions are unexpanded by default. Use the - query param `expand=permissions` to see more details under `GET - /files`. - drive: - type: optional - docs: The drive that the file belongs to. - remote_created_at: - type: optional - docs: When the third party's file was created. - remote_updated_at: - type: optional - docs: When the third party's file was updated. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: filestorage_v3.yml - FileRequestFolder: - discriminated: false - docs: The folder that the file belongs to. - union: - - type: string - validation: - format: uuid - - Folder - source: - openapi: filestorage_v3.yml - inline: true - FileRequestPermissionsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PermissionRequest - source: - openapi: filestorage_v3.yml - inline: true - FileRequestPermissions: - discriminated: false - docs: >- - The Permission object is used to represent a user's or group's access to a - File or Folder. Permissions are unexpanded by default. Use the query param - `expand=permissions` to see more details under `GET /files`. - union: - - type: string - validation: - format: uuid - - PermissionRequest - - list - source: - openapi: filestorage_v3.yml - inline: true - FileRequestDrive: - discriminated: false - docs: The drive that the file belongs to. - union: - - type: string - validation: - format: uuid - - Drive - source: - openapi: filestorage_v3.yml - inline: true - FileRequest: - docs: >- - # The File Object - - ### Description - - The `File` object is used to represent a file in the workspace. The Object - typically exists under a folder or drive, if it exists. - - ### Usage Example - - Fetch from the `GET /api/filestorage/v1/files` endpoint and view their - files. - properties: - name: - type: optional - docs: The file's name. - validation: - maxLength: 254 - file_url: - type: optional - docs: The URL to access the file. - validation: - maxLength: 2000 - file_thumbnail_url: - type: optional - docs: >- - The URL that produces a thumbnail preview of the file. Typically an - image. - validation: - maxLength: 2000 - size: - type: optional - docs: The file's size, in bytes. - mime_type: - type: optional - docs: The file's mime type. - validation: - maxLength: 128 - description: - type: optional - docs: The file's description. - validation: - maxLength: 2000 - folder: - type: optional - docs: The folder that the file belongs to. - checksum: - type: optional> - docs: >- - This field stores file checksum data. 'type' indicates the algorithm - (e.g. crc_32, sha1, sha256, quickXor, or md5), and 'content_hash' is - the unique hash used to verify file integrity and detect alterations. - permissions: - type: optional - docs: >- - The Permission object is used to represent a user's or group's access - to a File or Folder. Permissions are unexpanded by default. Use the - query param `expand=permissions` to see more details under `GET - /files`. - drive: - type: optional - docs: The drive that the file belongs to. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: filestorage_v3.yml - FileStorageFileResponse: - properties: - model: File - warnings: list - errors: list - logs: optional> - source: - openapi: filestorage_v3.yml - FileStorageFolderResponse: - properties: - model: Folder - warnings: list - errors: list - logs: optional> - source: - openapi: filestorage_v3.yml - FolderParentFolder: - discriminated: false - docs: The folder that the folder belongs to. - union: - - type: string - validation: - format: uuid - - Folder - source: - openapi: filestorage_v3.yml - inline: true - FolderDrive: - discriminated: false - docs: The drive that the folder belongs to. - union: - - type: string - validation: - format: uuid - - Drive - source: - openapi: filestorage_v3.yml - inline: true - FolderPermissionsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Permission - source: - openapi: filestorage_v3.yml - inline: true - FolderPermissions: - discriminated: false - docs: >- - The Permission object is used to represent a user's or group's access to a - File or Folder. Permissions are unexpanded by default. Use the query param - `expand=permissions` to see more details under `GET /folders`. - union: - - type: string - validation: - format: uuid - - Permission - - list - source: - openapi: filestorage_v3.yml - inline: true - Folder: - docs: >- - # The Folder Object - - ### Description - - The `Folder` object is used to represent a collection of files and/or - folders in the workspace. Could be within a drive, if it exists. - - ### Usage Example - - Fetch from the `GET /api/filestorage/v1/folders` endpoint and view their - folders. - 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 folder's name. - validation: - maxLength: 254 - folder_url: - type: optional - docs: The URL to access the folder. - validation: - maxLength: 2000 - size: - type: optional - docs: The folder's size, in bytes. - description: - type: optional - docs: The folder's description. - validation: - maxLength: 2000 - parent_folder: - type: optional - docs: The folder that the folder belongs to. - drive: - type: optional - docs: The drive that the folder belongs to. - permissions: - type: optional - docs: >- - The Permission object is used to represent a user's or group's access - to a File or Folder. Permissions are unexpanded by default. Use the - query param `expand=permissions` to see more details under `GET - /folders`. - remote_created_at: - type: optional - docs: When the third party's folder was created. - remote_updated_at: - type: optional - docs: When the third party's folder was updated. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: filestorage_v3.yml - FolderRequestParentFolder: - discriminated: false - docs: The folder that the folder belongs to. - union: - - type: string - validation: - format: uuid - - Folder - source: - openapi: filestorage_v3.yml - inline: true - FolderRequestDrive: - discriminated: false - docs: The drive that the folder belongs to. - union: - - type: string - validation: - format: uuid - - Drive - source: - openapi: filestorage_v3.yml - inline: true - FolderRequestPermissionsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - PermissionRequest - source: - openapi: filestorage_v3.yml - inline: true - FolderRequestPermissions: - discriminated: false - docs: >- - The Permission object is used to represent a user's or group's access to a - File or Folder. Permissions are unexpanded by default. Use the query param - `expand=permissions` to see more details under `GET /folders`. - union: - - type: string - validation: - format: uuid - - PermissionRequest - - list - source: - openapi: filestorage_v3.yml - inline: true - FolderRequest: - docs: >- - # The Folder Object - - ### Description - - The `Folder` object is used to represent a collection of files and/or - folders in the workspace. Could be within a drive, if it exists. - - ### Usage Example - - Fetch from the `GET /api/filestorage/v1/folders` endpoint and view their - folders. - properties: - name: - type: optional - docs: The folder's name. - validation: - maxLength: 254 - folder_url: - type: optional - docs: The URL to access the folder. - validation: - maxLength: 2000 - size: - type: optional - docs: The folder's size, in bytes. - description: - type: optional - docs: The folder's description. - validation: - maxLength: 2000 - parent_folder: - type: optional - docs: The folder that the folder belongs to. - drive: - type: optional - docs: The drive that the folder belongs to. - permissions: - type: optional - docs: >- - The Permission object is used to represent a user's or group's access - to a File or Folder. Permissions are unexpanded by default. Use the - query param `expand=permissions` to see more details under `GET - /folders`. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: filestorage_v3.yml - GroupChildGroupsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Group - source: - openapi: filestorage_v3.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/filestorage/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 - users: - docs: >- - The users that belong in the group. If null, this typically means it's - either a domain or the third-party platform does not surface this - information. - type: list - child_groups: - type: optional> - docs: Groups that inherit the permissions of the parent group. - access: read-only - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: filestorage_v3.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: filestorage_v3.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: filestorage_v3.yml - IssueStatus: - discriminated: false - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - union: - - IssueStatusEnum - - string - source: - openapi: filestorage_v3.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: filestorage_v3.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: filestorage_v3.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: filestorage_v3.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: filestorage_v3.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: filestorage_v3.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean - source: - openapi: filestorage_v3.yml - MetaResponse: - properties: - request_schema: map - remote_field_classes: optional> - status: optional - has_conditional_params: boolean - has_required_linked_account_params: boolean - source: - openapi: filestorage_v3.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: filestorage_v3.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: filestorage_v3.yml - ModelPermissionDeserializer: - properties: - is_enabled: optional - source: - openapi: filestorage_v3.yml - ModelPermissionDeserializerRequest: - properties: - is_enabled: optional - source: - openapi: filestorage_v3.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: filestorage_v3.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: filestorage_v3.yml - PaginatedAccountDetailsAndActionsList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedAuditLogEventList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedDownloadRequestMetaList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedDriveList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedFileList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedFolderList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedGroupList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedIssueList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedSyncStatusList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PaginatedUserList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: filestorage_v3.yml - PermissionUser: - discriminated: false - docs: >- - The user that is granted this permission. This will only be populated if - the type is `USER`. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: filestorage_v3.yml - inline: true - PermissionGroup: - discriminated: false - docs: >- - The group that is granted this permission. This will only be populated if - the type is `GROUP`. - union: - - type: string - validation: - format: uuid - - Group - source: - openapi: filestorage_v3.yml - inline: true - PermissionType: - discriminated: false - docs: |- - Denotes what type of people have access to the file. - - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - union: - - TypeEnum - - string - source: - openapi: filestorage_v3.yml - inline: true - PermissionRolesItem: - discriminated: false - docs: |- - The permissions that the user or group has for the File or Folder. - - * `READ` - READ - * `WRITE` - WRITE - * `OWNER` - OWNER - union: - - RolesEnum - - string - source: - openapi: filestorage_v3.yml - inline: true - Permission: - docs: >- - # The Permission Object - - ### Description - - The Permission object is used to represent a user's or group's access to a - File or Folder. Permissions are unexpanded by default. - - - ### Usage Example - - Fetch from the `GET Files` or `GET Folders` endpoint. Permissions are - unexpanded by default. Use the query param `expand=permissions` to see - more details. - 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: - type: optional - docs: >- - The user that is granted this permission. This will only be populated - if the type is `USER`. - group: - type: optional - docs: >- - The group that is granted this permission. This will only be populated - if the type is `GROUP`. - type: - type: optional - docs: |- - Denotes what type of people have access to the file. - - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - roles: - type: optional>> - docs: >- - The permissions that the user or group has for the File or Folder. It - is possible for a user or group to have multiple roles, such as - viewing & uploading. Possible values include: `READ`, `WRITE`, - `OWNER`. In cases where there is no clear mapping, the original value - passed through will be returned. - source: - openapi: filestorage_v3.yml - PermissionRequestUser: - discriminated: false - docs: >- - The user that is granted this permission. This will only be populated if - the type is `USER`. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: filestorage_v3.yml - inline: true - PermissionRequestGroup: - discriminated: false - docs: >- - The group that is granted this permission. This will only be populated if - the type is `GROUP`. - union: - - type: string - validation: - format: uuid - - Group - source: - openapi: filestorage_v3.yml - inline: true - PermissionRequestType: - discriminated: false - docs: |- - Denotes what type of people have access to the file. - - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - union: - - TypeEnum - - string - source: - openapi: filestorage_v3.yml - inline: true - PermissionRequestRolesItem: - discriminated: false - docs: |- - The permissions that the user or group has for the File or Folder. - - * `READ` - READ - * `WRITE` - WRITE - * `OWNER` - OWNER - union: - - RolesEnum - - string - source: - openapi: filestorage_v3.yml - inline: true - PermissionRequest: - docs: >- - # The Permission Object - - ### Description - - The Permission object is used to represent a user's or group's access to a - File or Folder. Permissions are unexpanded by default. - - - ### Usage Example - - Fetch from the `GET Files` or `GET Folders` endpoint. Permissions are - unexpanded by default. Use the query param `expand=permissions` to see - more details. - properties: - remote_id: - type: optional - docs: The third-party API ID of the matching object. - user: - type: optional - docs: >- - The user that is granted this permission. This will only be populated - if the type is `USER`. - group: - type: optional - docs: >- - The group that is granted this permission. This will only be populated - if the type is `GROUP`. - type: - type: optional - docs: |- - Denotes what type of people have access to the file. - - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - roles: - type: optional>> - docs: >- - The permissions that the user or group has for the File or Folder. It - is possible for a user or group to have multiple roles, such as - viewing & uploading. Possible values include: `READ`, `WRITE`, - `OWNER`. In cases where there is no clear mapping, the original value - passed through will be returned. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: filestorage_v3.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: filestorage_v3.yml - RemoteEndpointInfo: - properties: - method: string - url_path: string - field_traversal_path: list - source: - openapi: filestorage_v3.yml - RemoteFieldApiCoverage: - discriminated: false - union: - - integer - - double - source: - openapi: filestorage_v3.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: filestorage_v3.yml - RemoteFieldApiResponse: - properties: - File: optional> - Folder: optional> - Drive: optional> - Group: optional> - User: optional> - source: - openapi: filestorage_v3.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: filestorage_v3.yml - RemoteResponseResponseType: - discriminated: false - union: - - ResponseTypeEnum - - string - source: - openapi: filestorage_v3.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: filestorage_v3.yml - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - docs: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - source: - openapi: filestorage_v3.yml - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - docs: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - source: - openapi: filestorage_v3.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: filestorage_v3.yml - RolesEnum: - enum: - - READ - - WRITE - - OWNER - docs: |- - * `READ` - READ - * `WRITE` - WRITE - * `OWNER` - OWNER - source: - openapi: filestorage_v3.yml - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - docs: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - source: - openapi: filestorage_v3.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: filestorage_v3.yml - SyncStatusLastSyncResult: - discriminated: false - union: - - LastSyncResultEnum - - string - source: - openapi: filestorage_v3.yml - inline: true - SyncStatusStatus: - discriminated: false - union: - - StatusFd5Enum - - string - source: - openapi: filestorage_v3.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: filestorage_v3.yml - TypeEnum: - enum: - - USER - - GROUP - - COMPANY - - ANYONE - docs: |- - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - source: - openapi: filestorage_v3.yml - User: - docs: >- - # The User Object - - ### Description - - The `User` object is used to represent a user within the File Storage - account. - - ### Usage Example - - Fetch from the `GET /api/filestorage/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. This is typically used to identify a user - across linked accounts. - validation: - maxLength: 2000 - is_me: - type: optional - docs: Whether the user is the one who linked this account. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: filestorage_v3.yml - ValidationProblemSource: - properties: - pointer: string - source: - openapi: filestorage_v3.yml - WarningValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: filestorage_v3.yml - WebhookReceiver: - properties: - event: string - is_active: boolean - key: optional - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/accountDetails.yml b/.mock/definition/FileStorage/accountDetails.yml deleted file mode 100644 index e6b0a3877..000000000 --- a/.mock/definition/FileStorage/accountDetails.yml +++ /dev/null @@ -1,38 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /filestorage/v1/account-details - method: GET - auth: - - tokenAuth: [] - docs: Get details for a linked account. - source: - openapi: filestorage_v3.yml - response: - docs: '' - type: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/accountToken.yml b/.mock/definition/FileStorage/accountToken.yml deleted file mode 100644 index 5027e47ca..000000000 --- a/.mock/definition/FileStorage/accountToken.yml +++ /dev/null @@ -1,47 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /filestorage/v1/account-token/{public_token} - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns the account token for the end user with the provided public - token. - source: - openapi: filestorage_v3.yml - path-parameters: - public_token: string - response: - docs: '' - type: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/asyncPassthrough.yml b/.mock/definition/FileStorage/asyncPassthrough.yml deleted file mode 100644 index 917001aab..000000000 --- a/.mock/definition/FileStorage/asyncPassthrough.yml +++ /dev/null @@ -1,74 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /filestorage/v1/async-passthrough - method: POST - auth: - - tokenAuth: [] - docs: >- - Asynchronously pull data from an endpoint not currently supported by - Merge. - source: - openapi: filestorage_v3.yml - request: - body: fileStorageRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: fileStorageRoot.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: /filestorage/v1/async-passthrough/{async_passthrough_receipt_id} - method: GET - auth: - - tokenAuth: [] - docs: Retrieves data from earlier async-passthrough POST request - source: - openapi: filestorage_v3.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: filestorage_v3.yml -types: - AsyncPassthroughRetrieveResponse: - discriminated: false - union: - - fileStorageRoot.RemoteResponse - - string - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/auditTrail.yml b/.mock/definition/FileStorage/auditTrail.yml deleted file mode 100644 index 5147ae3f0..000000000 --- a/.mock/definition/FileStorage/auditTrail.yml +++ /dev/null @@ -1,108 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/audit-trail - method: GET - auth: - - tokenAuth: [] - docs: Gets a list of audit trail events. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.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: fileStorageRoot.PaginatedAuditLogEventList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - event_type: event_type - page_size: 1 - start_date: start_date - user_email: user_email - 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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/availableActions.yml b/.mock/definition/FileStorage/availableActions.yml deleted file mode 100644 index a9ab1fadd..000000000 --- a/.mock/definition/FileStorage/availableActions.yml +++ /dev/null @@ -1,52 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /filestorage/v1/available-actions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of models and actions available for an account. - source: - openapi: filestorage_v3.yml - response: - docs: '' - type: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/deleteAccount.yml b/.mock/definition/FileStorage/deleteAccount.yml deleted file mode 100644 index 767689fd2..000000000 --- a/.mock/definition/FileStorage/deleteAccount.yml +++ /dev/null @@ -1,17 +0,0 @@ -service: - auth: false - base-path: '' - endpoints: - delete: - path: /filestorage/v1/delete-account - method: POST - auth: - - tokenAuth: [] - docs: Delete a linked account. - source: - openapi: filestorage_v3.yml - examples: - - headers: - X-Account-Token: X-Account-Token - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/drives.yml b/.mock/definition/FileStorage/drives.yml deleted file mode 100644 index d02d4f3dd..000000000 --- a/.mock/definition/FileStorage/drives.yml +++ /dev/null @@ -1,168 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/drives - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Drive` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.yml - request: - name: DrivesListRequest - 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. - name: - type: optional - docs: >- - If provided, will only return drives with this name. This performs - an exact match. - 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: fileStorageRoot.PaginatedDriveList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: f9e3d315-d6c2-458e-85c4-fa773d6ff4a6 - remote_id: '2039348' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: My Drive - remote_created_at: '2024-01-15T09:30:00Z' - drive_url: https://drive.com/drives/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: /drives - data: - - Varies by platform - retrieve: - path: /filestorage/v1/drives/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Drive` object with the given `id`. - source: - openapi: filestorage_v3.yml - path-parameters: - id: string - request: - name: DrivesRetrieveRequest - 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: fileStorageRoot.Drive - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: f9e3d315-d6c2-458e-85c4-fa773d6ff4a6 - remote_id: '2039348' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: My Drive - remote_created_at: '2024-01-15T09:30:00Z' - drive_url: https://drive.com/drives/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: /drives - data: - - Varies by platform - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/fieldMapping.yml b/.mock/definition/FileStorage/fieldMapping.yml deleted file mode 100644 index 34013d3a4..000000000 --- a/.mock/definition/FileStorage/fieldMapping.yml +++ /dev/null @@ -1,537 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - field_mappings_retrieve: - path: /filestorage/v1/field-mappings - method: GET - auth: - - tokenAuth: [] - 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: filestorage_v3.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: fileStorageRoot.FieldMappingApiInstanceResponse - status-code: 200 - examples: - - query-parameters: - exclude_remote_field_metadata: true - headers: - X-Account-Token: X-Account-Token - response: - body: - File: - - 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 - Folder: - - 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 - Drive: - - 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 - 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 - 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 - field_mappings_create: - path: /filestorage/v1/field-mappings - method: POST - auth: - - tokenAuth: [] - 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: filestorage_v3.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 - content-type: application/json - response: - docs: '' - type: fileStorageRoot.FieldMappingInstanceResponse - status-code: 201 - examples: - - query-parameters: - exclude_remote_field_metadata: true - 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 - 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: /filestorage/v1/field-mappings/{field_mapping_id} - method: DELETE - auth: - - tokenAuth: [] - 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: filestorage_v3.yml - path-parameters: - field_mapping_id: string - response: - docs: '' - type: fileStorageRoot.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 - 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: /filestorage/v1/field-mappings/{field_mapping_id} - method: PATCH - auth: - - tokenAuth: [] - 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: filestorage_v3.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 - content-type: application/json - response: - docs: '' - type: fileStorageRoot.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 - 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: /filestorage/v1/remote-fields - method: GET - auth: - - tokenAuth: [] - 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: filestorage_v3.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: fileStorageRoot.RemoteFieldApiResponse - status-code: 200 - examples: - - query-parameters: - common_models: common_models - include_example_values: include_example_values - headers: - X-Account-Token: X-Account-Token - response: - body: - File: - - 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 - Folder: - - 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 - Drive: - - 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 - 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 - target_fields_retrieve: - path: /filestorage/v1/target-fields - method: GET - auth: - - tokenAuth: [] - 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: filestorage_v3.yml - response: - docs: '' - type: fileStorageRoot.ExternalTargetFieldApiResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - File: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Folder: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Drive: - - 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 - User: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/files.yml b/.mock/definition/FileStorage/files.yml deleted file mode 100644 index ea98b7d93..000000000 --- a/.mock/definition/FileStorage/files.yml +++ /dev/null @@ -1,713 +0,0 @@ -types: - FilesListRequestExpandItem: - enum: - - drive - - folder - - permissions - source: - openapi: filestorage_v3.yml - FilesListRequestOrderBy: - enum: - - value: '-created_at' - name: CreatedAtDescending - - value: '-modified_at' - name: ModifiedAtDescending - - value: created_at - name: CreatedAtAscending - - value: modified_at - name: ModifiedAtAscending - source: - openapi: filestorage_v3.yml - FilesRetrieveRequestExpandItem: - enum: - - drive - - folder - - permissions - source: - openapi: filestorage_v3.yml - FilesDownloadRequestMetaListRequestOrderBy: - enum: - - value: '-created_at' - name: CreatedAtDescending - - value: '-modified_at' - name: ModifiedAtDescending - - value: created_at - name: CreatedAtAscending - - value: modified_at - name: ModifiedAtAscending - source: - openapi: filestorage_v3.yml -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/files - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `File` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.yml - request: - name: FilesListRequest - 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. - drive_id: - type: optional - docs: >- - Specifying a drive id returns only the files in that drive. - Specifying null returns only the files outside the top-level - drive. - expand: - type: optional - allow-multiple: true - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - folder_id: - type: optional - docs: >- - Specifying a folder id returns only the files in that folder. - Specifying null returns only the files in root directory. - 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). - mime_type: - type: optional - docs: >- - If provided, will only return files with these mime_types. - Multiple values can be separated by commas. - 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. - name: - type: optional - docs: >- - If provided, will only return files with this name. This performs - an exact match. - order_by: - type: optional - docs: >- - Overrides the default ordering for this endpoint. Possible values - include: created_at, -created_at, modified_at, -modified_at. - 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: fileStorageRoot.PaginatedFileList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - drive_id: drive_id - folder_id: folder_id - include_deleted_data: true - include_remote_data: true - include_shell_data: true - mime_type: mime_type - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - order_by: '-created_at' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 45ce474c-dhcj-43a6-754r-629f799f7d68 - remote_id: '12' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: merge_file_storage_launch.docx - file_url: https://drive.com/1234 - file_thumbnail_url: https://drive.com/1234/thumbnail.png - size: 254 - mime_type: >- - application/vnd.openxmlformats-officedocument.wordprocessingml.document - description: >- - Use common model scopes to redact data returned in Merge's - Common Models! - folder: folder - checksum: - type: sha256 - content_hash: >- - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - permissions: permissions - drive: drive - remote_created_at: '2022-02-02T00:00:00Z' - remote_updated_at: '2022-02-03T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /files - data: - - Varies by platform - create: - path: /filestorage/v1/files - method: POST - auth: - - tokenAuth: [] - docs: Creates a `File` object with the given values. - source: - openapi: filestorage_v3.yml - request: - name: FileStorageFileEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: fileStorageRoot.FileRequest - content-type: application/json - response: - docs: '' - type: fileStorageRoot.FileStorageFileResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 45ce474c-dhcj-43a6-754r-629f799f7d68 - remote_id: '12' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: merge_file_storage_launch.docx - file_url: https://drive.com/1234 - file_thumbnail_url: https://drive.com/1234/thumbnail.png - size: 254 - mime_type: >- - application/vnd.openxmlformats-officedocument.wordprocessingml.document - description: >- - Use common model scopes to redact data returned in Merge's - Common Models! - folder: folder - checksum: - type: sha256 - content_hash: >- - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - permissions: permissions - drive: drive - remote_created_at: '2022-02-02T00:00:00Z' - remote_updated_at: '2022-02-03T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /files - data: - - Varies by platform - 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 - retrieve: - path: /filestorage/v1/files/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `File` object with the given `id`. - source: - openapi: filestorage_v3.yml - path-parameters: - id: string - request: - name: FilesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: fileStorageRoot.File - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 45ce474c-dhcj-43a6-754r-629f799f7d68 - remote_id: '12' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: merge_file_storage_launch.docx - file_url: https://drive.com/1234 - file_thumbnail_url: https://drive.com/1234/thumbnail.png - size: 254 - mime_type: >- - application/vnd.openxmlformats-officedocument.wordprocessingml.document - description: >- - Use common model scopes to redact data returned in Merge's - Common Models! - folder: folder - checksum: - type: sha256 - content_hash: >- - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - permissions: permissions - drive: drive - remote_created_at: '2022-02-02T00:00:00Z' - remote_updated_at: '2022-02-03T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /files - data: - - Varies by platform - downloadRetrieve: - path: /filestorage/v1/files/{id}/download - method: GET - auth: - - tokenAuth: [] - docs: Returns the `File` content with the given `id` as a stream of bytes. - source: - openapi: filestorage_v3.yml - path-parameters: - id: string - request: - name: FilesDownloadRetrieveRequest - query-parameters: - 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). - mime_type: - type: optional - docs: >- - 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. - response: - docs: '' - type: file - status-code: 200 - downloadRequestMetaRetrieve: - path: /filestorage/v1/files/{id}/download/request-meta - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns metadata to construct an authenticated file download request for - a singular file, allowing you to download file directly from the - third-party. - source: - openapi: filestorage_v3.yml - path-parameters: - id: string - request: - name: FilesDownloadRequestMetaRetrieveRequest - query-parameters: - mime_type: - type: optional - docs: >- - 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. - response: - docs: '' - type: fileStorageRoot.DownloadRequestMeta - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - mime_type: mime_type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - url: https://www.googleapis.com/drive/v3/files/234?alt=media - method: GET - headers: - Authorization: Bearer 1234 - downloadRequestMetaList: - path: /filestorage/v1/files/download/request-meta - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns metadata to construct authenticated file download requests, - allowing you to download files directly from the third-party. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.yml - request: - name: FilesDownloadRequestMetaListRequest - 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/). - mime_types: - type: optional - docs: >- - 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: - type: optional - docs: >- - If provided, will only return objects modified after this - datetime. - modified_before: - type: optional - docs: >- - If provided, will only return objects modified before this - datetime. - order_by: - type: optional - docs: >- - Overrides the default ordering for this endpoint. Possible values - include: created_at, -created_at, modified_at, -modified_at. - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: fileStorageRoot.PaginatedDownloadRequestMetaList - status-code: 200 - examples: - - query-parameters: - created_after: created_after - created_before: created_before - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - mime_types: mime_types - modified_after: modified_after - modified_before: modified_before - order_by: '-created_at' - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - url: https://www.googleapis.com/drive/v3/files/234?alt=media - method: GET - headers: - Authorization: Bearer 1234 - metaPostRetrieve: - path: /filestorage/v1/files/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `FileStorageFile` POSTs. - source: - openapi: filestorage_v3.yml - response: - docs: '' - type: fileStorageRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/folders.yml b/.mock/definition/FileStorage/folders.yml deleted file mode 100644 index c95cff0a6..000000000 --- a/.mock/definition/FileStorage/folders.yml +++ /dev/null @@ -1,484 +0,0 @@ -types: - FoldersListRequestExpandItem: - enum: - - drive - - parent_folder - - permissions - source: - openapi: filestorage_v3.yml - FoldersRetrieveRequestExpandItem: - enum: - - drive - - parent_folder - - permissions - source: - openapi: filestorage_v3.yml -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/folders - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Folder` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.yml - request: - name: FoldersListRequest - 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. - drive_id: - type: optional - docs: If provided, will only return folders in this drive. - expand: - type: optional - allow-multiple: true - 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. - name: - type: optional - docs: >- - If provided, will only return folders with this name. This - performs an exact match. - page_size: - type: optional - docs: Number of results to return per page. - parent_folder_id: - type: optional - docs: >- - If provided, will only return folders in this parent folder. If - null, will return folders in root directory. - remote_id: - type: optional - docs: The API provider's ID for the given object. - response: - docs: '' - type: fileStorageRoot.PaginatedFolderList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - drive_id: drive_id - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - parent_folder_id: parent_folder_id - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: e021f7a7-74fc-4487-8e12-14180c92d3b7 - remote_id: '14' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: R&D - folder_url: https://drive.com/1234 - size: 2738000 - description: All things R&D related at Merge! - parent_folder: parent_folder - drive: drive - permissions: permissions - remote_created_at: '2024-02-02T00:00:00Z' - remote_updated_at: '2024-06-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /folders - data: - - Varies by platform - create: - path: /filestorage/v1/folders - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Folder` object with the given values. - source: - openapi: filestorage_v3.yml - request: - name: FileStorageFolderEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: fileStorageRoot.FolderRequest - content-type: application/json - response: - docs: '' - type: fileStorageRoot.FileStorageFolderResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: e021f7a7-74fc-4487-8e12-14180c92d3b7 - remote_id: '14' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: R&D - folder_url: https://drive.com/1234 - size: 2738000 - description: All things R&D related at Merge! - parent_folder: parent_folder - drive: drive - permissions: permissions - remote_created_at: '2024-02-02T00:00:00Z' - remote_updated_at: '2024-06-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /folders - data: - - Varies by platform - 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 - retrieve: - path: /filestorage/v1/folders/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Folder` object with the given `id`. - source: - openapi: filestorage_v3.yml - path-parameters: - id: string - request: - name: FoldersRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: fileStorageRoot.Folder - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: e021f7a7-74fc-4487-8e12-14180c92d3b7 - remote_id: '14' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: R&D - folder_url: https://drive.com/1234 - size: 2738000 - description: All things R&D related at Merge! - parent_folder: parent_folder - drive: drive - permissions: permissions - remote_created_at: '2024-02-02T00:00:00Z' - remote_updated_at: '2024-06-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /folders - data: - - Varies by platform - metaPostRetrieve: - path: /filestorage/v1/folders/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `FileStorageFolder` POSTs. - source: - openapi: filestorage_v3.yml - response: - docs: '' - type: fileStorageRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/forceResync.yml b/.mock/definition/FileStorage/forceResync.yml deleted file mode 100644 index d280ccdf1..000000000 --- a/.mock/definition/FileStorage/forceResync.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - sync_status_resync_create: - path: /filestorage/v1/sync-status/resync - method: POST - auth: - - tokenAuth: [] - 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: filestorage_v3.yml - response: - docs: '' - type: list - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - - model_name: File - model_id: filestorage.FileStorageFile - 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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/generateKey.yml b/.mock/definition/FileStorage/generateKey.yml deleted file mode 100644 index 4cc23f5ac..000000000 --- a/.mock/definition/FileStorage/generateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /filestorage/v1/generate-key - method: POST - auth: - - tokenAuth: [] - docs: Create a remote key. - source: - openapi: filestorage_v3.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: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/groups.yml b/.mock/definition/FileStorage/groups.yml deleted file mode 100644 index c7b80bf92..000000000 --- a/.mock/definition/FileStorage/groups.yml +++ /dev/null @@ -1,191 +0,0 @@ -types: - GroupsListRequestExpandItem: - enum: - - child_groups - - users - source: - openapi: filestorage_v3.yml - GroupsRetrieveRequestExpandItem: - enum: - - child_groups - - users - source: - openapi: filestorage_v3.yml -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/groups - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Group` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.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 - allow-multiple: true - 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: fileStorageRoot.PaginatedGroupList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 5624aceb-0ea2-4864-ba08-354ac56b9884 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Administrators - users: - - 6e93361b-8ae7-444b-bfa2-71206cbbee24 - child_groups: - - 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: /filestorage/v1/groups/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Group` object with the given `id`. - source: - openapi: filestorage_v3.yml - path-parameters: - id: string - request: - name: GroupsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: fileStorageRoot.Group - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 5624aceb-0ea2-4864-ba08-354ac56b9884 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Administrators - users: - - 6e93361b-8ae7-444b-bfa2-71206cbbee24 - child_groups: - - 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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/issues.yml b/.mock/definition/FileStorage/issues.yml deleted file mode 100644 index 90fd8d722..000000000 --- a/.mock/definition/FileStorage/issues.yml +++ /dev/null @@ -1,154 +0,0 @@ -types: - IssuesListRequestStatus: - enum: - - ONGOING - - RESOLVED - source: - openapi: filestorage_v3.yml -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/issues - method: GET - auth: - - tokenAuth: [] - docs: Gets all issues for Organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.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: fileStorageRoot.PaginatedIssueList - status-code: 200 - examples: - - query-parameters: - account_token: account_token - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - end_user_organization_name: end_user_organization_name - first_incident_time_after: '2024-01-15T09:30:00Z' - first_incident_time_before: '2024-01-15T09:30:00Z' - include_muted: include_muted - integration_name: integration_name - last_incident_time_after: '2024-01-15T09:30:00Z' - last_incident_time_before: '2024-01-15T09:30:00Z' - linked_account_id: linked_account_id - page_size: 1 - start_date: start_date - status: ONGOING - 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: /filestorage/v1/issues/{id} - method: GET - auth: - - tokenAuth: [] - docs: Get a specific issue. - source: - openapi: filestorage_v3.yml - path-parameters: - id: string - response: - docs: '' - type: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/linkToken.yml b/.mock/definition/FileStorage/linkToken.yml deleted file mode 100644 index fedfc8940..000000000 --- a/.mock/definition/FileStorage/linkToken.yml +++ /dev/null @@ -1,155 +0,0 @@ -imports: - fileStorageRoot: __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: - - fileStorageRoot.LanguageEnum - - string - source: - openapi: filestorage_v3.yml - inline: true -service: - auth: false - base-path: '' - endpoints: - create: - path: /filestorage/v1/link-token - method: POST - auth: - - tokenAuth: [] - docs: Creates a link token to be used when linking a new end user. - source: - openapi: filestorage_v3.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: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/linkedAccounts.yml b/.mock/definition/FileStorage/linkedAccounts.yml deleted file mode 100644 index c74865ca0..000000000 --- a/.mock/definition/FileStorage/linkedAccounts.yml +++ /dev/null @@ -1,169 +0,0 @@ -types: - LinkedAccountsListRequestCategory: - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - source: - openapi: filestorage_v3.yml -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/linked-accounts - method: GET - auth: - - tokenAuth: [] - docs: List linked accounts for your organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.yml - request: - name: LinkedAccountsListRequest - query-parameters: - category: - type: optional - docs: >- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, - `mktg`, `ticketing` - - - * `hris` - hris - - * `ats` - ats - - * `accounting` - accounting - - * `ticketing` - ticketing - - * `crm` - crm - - * `mktg` - mktg - - * `filestorage` - filestorage - 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: fileStorageRoot.PaginatedAccountDetailsAndActionsList - status-code: 200 - examples: - - query-parameters: - category: accounting - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - 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: true - integration_name: integration_name - is_test_account: is_test_account - page_size: 1 - status: status - 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' - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/passthrough.yml b/.mock/definition/FileStorage/passthrough.yml deleted file mode 100644 index 9854d3a1d..000000000 --- a/.mock/definition/FileStorage/passthrough.yml +++ /dev/null @@ -1,42 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /filestorage/v1/passthrough - method: POST - auth: - - tokenAuth: [] - docs: Pull data from an endpoint not currently supported by Merge. - source: - openapi: filestorage_v3.yml - request: - body: fileStorageRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/regenerateKey.yml b/.mock/definition/FileStorage/regenerateKey.yml deleted file mode 100644 index e23e337c1..000000000 --- a/.mock/definition/FileStorage/regenerateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /filestorage/v1/regenerate-key - method: POST - auth: - - tokenAuth: [] - docs: Exchange remote keys. - source: - openapi: filestorage_v3.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: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/scopes.yml b/.mock/definition/FileStorage/scopes.yml deleted file mode 100644 index 49e604af9..000000000 --- a/.mock/definition/FileStorage/scopes.yml +++ /dev/null @@ -1,168 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - default_scopes_retrieve: - path: /filestorage/v1/default-scopes - method: GET - auth: - - tokenAuth: [] - 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: filestorage_v3.yml - response: - docs: '' - type: fileStorageRoot.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: /filestorage/v1/linked-account-scopes - method: GET - auth: - - tokenAuth: [] - 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: filestorage_v3.yml - response: - docs: '' - type: fileStorageRoot.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: /filestorage/v1/linked-account-scopes - method: POST - auth: - - tokenAuth: [] - 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: filestorage_v3.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: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/syncStatus.yml b/.mock/definition/FileStorage/syncStatus.yml deleted file mode 100644 index ffa8a978c..000000000 --- a/.mock/definition/FileStorage/syncStatus.yml +++ /dev/null @@ -1,64 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/sync-status - method: GET - auth: - - tokenAuth: [] - 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). - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.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: fileStorageRoot.PaginatedSyncStatusList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - model_name: File - model_id: filestorage.FileStorageFile - 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: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/users.yml b/.mock/definition/FileStorage/users.yml deleted file mode 100644 index 9a388d309..000000000 --- a/.mock/definition/FileStorage/users.yml +++ /dev/null @@ -1,166 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/users - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `User` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: filestorage_v3.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). - is_me: - type: optional - docs: If provided, will only return the user object for requestor. - 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: fileStorageRoot.PaginatedUserList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_me: is_me - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - 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 - is_me: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /users - data: - - Varies by platform - retrieve: - path: /filestorage/v1/users/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `User` object with the given `id`. - source: - openapi: filestorage_v3.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: fileStorageRoot.User - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - 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 - is_me: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /users - data: - - Varies by platform - source: - openapi: filestorage_v3.yml diff --git a/.mock/definition/FileStorage/webhookReceivers.yml b/.mock/definition/FileStorage/webhookReceivers.yml deleted file mode 100644 index fa7e6fd38..000000000 --- a/.mock/definition/FileStorage/webhookReceivers.yml +++ /dev/null @@ -1,65 +0,0 @@ -imports: - fileStorageRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /filestorage/v1/webhook-receivers - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `WebhookReceiver` objects. - source: - openapi: filestorage_v3.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: /filestorage/v1/webhook-receivers - method: POST - auth: - - tokenAuth: [] - docs: Creates a `WebhookReceiver` object with the given values. - source: - openapi: filestorage_v3.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: fileStorageRoot.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: filestorage_v3.yml diff --git a/.mock/definition/HRIS/__package__.yml b/.mock/definition/HRIS/__package__.yml deleted file mode 100644 index 61e76ec25..000000000 --- a/.mock/definition/HRIS/__package__.yml +++ /dev/null @@ -1,7710 +0,0 @@ -types: - AccountDetailsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: hris_v3.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: hris_v3.yml - AccountDetailsAndActionsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: hris_v3.yml - inline: true - AccountDetailsAndActionsStatus: - discriminated: false - union: - - AccountDetailsAndActionsStatusEnum - - string - source: - openapi: hris_v3.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 - source: - openapi: hris_v3.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: hris_v3.yml - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - docs: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - source: - openapi: hris_v3.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: hris_v3.yml - AccountToken: - properties: - account_token: string - integration: AccountIntegration - id: string - source: - openapi: hris_v3.yml - AccountTypeEnum: - enum: - - SAVINGS - - CHECKING - docs: |- - * `SAVINGS` - SAVINGS - * `CHECKING` - CHECKING - source: - openapi: hris_v3.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: hris_v3.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid - source: - openapi: hris_v3.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: hris_v3.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: hris_v3.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: hris_v3.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: hris_v3.yml - BankInfoEmployee: - discriminated: false - docs: The employee with this bank account. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - BankInfoAccountType: - discriminated: false - docs: |- - The bank account type - - * `SAVINGS` - SAVINGS - * `CHECKING` - CHECKING - union: - - AccountTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - BankInfo: - docs: >- - # The BankInfo Object - - ### Description - - The `BankInfo` object is used to represent the Bank Account information - for an Employee. - - - ### Usage Example - - Fetch from the `LIST BankInfo` endpoint and filter by `ID` to show all - bank information. - 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 - employee: - type: optional - docs: The employee with this bank account. - account_number: - type: optional - docs: The account number. - validation: - maxLength: 100 - routing_number: - type: optional - docs: The routing number. - bank_name: - type: optional - docs: The bank name. - account_type: - type: optional - docs: |- - The bank account type - - * `SAVINGS` - SAVINGS - * `CHECKING` - CHECKING - remote_created_at: - type: optional - docs: When the matching bank object was created in the third party system. - 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: hris_v3.yml - BenefitEmployee: - discriminated: false - docs: The employee on the plan. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - Benefit: - docs: >- - # The Benefit Object - - ### Description - - The `Benefit` object is used to represent a benefit that an employee has - enrolled in. - - - ### Usage Example - - Fetch from the `LIST Benefits` endpoint and filter by `ID` to show all - benefits. - 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 - employee: - type: optional - docs: The employee on the plan. - provider_name: - type: optional - docs: The name of the benefit provider. - benefit_plan_type: - type: optional - docs: The type of benefit plan - availability: deprecated - employee_contribution: - type: optional - docs: The employee's contribution. - company_contribution: - type: optional - docs: The company's contribution. - start_date: - type: optional - docs: The day and time the benefit started. - end_date: - type: optional - docs: The day and time the benefit ended. - 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 - employer_benefit: - type: optional - docs: The employer benefit plan the employee is enrolled in. - validation: - format: uuid - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: hris_v3.yml - BenefitPlanTypeEnum: - enum: - - MEDICAL - - HEALTH_SAVINGS - - INSURANCE - - RETIREMENT - - OTHER - docs: |- - * `MEDICAL` - MEDICAL - * `HEALTH_SAVINGS` - HEALTH_SAVINGS - * `INSURANCE` - INSURANCE - * `RETIREMENT` - RETIREMENT - * `OTHER` - OTHER - source: - openapi: hris_v3.yml - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: hris_v3.yml - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: hris_v3.yml - CommonModelScopeApi: - properties: - common_models: - docs: The common models you want to update the scopes for - type: list - source: - openapi: hris_v3.yml - CommonModelScopesBodyRequest: - properties: - model_id: - type: string - validation: - minLength: 1 - enabled_actions: list - disabled_fields: list - source: - openapi: hris_v3.yml - Company: - docs: >- - # The Company Object - - ### Description - - The `Company` object is used to represent a company within the HRIS / - Payroll system. - - - ### Usage Example - - Fetch from the `LIST Companies` endpoint and filter by `ID` to show all - companies. - 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 - legal_name: - type: optional - docs: The company's legal name. - display_name: - type: optional - docs: The company's display name. - eins: - type: optional>> - docs: The company's Employer Identification Numbers. - 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: hris_v3.yml - CountryEnum: - enum: - - AF - - AX - - AL - - DZ - - AS - - AD - - AO - - AI - - AQ - - AG - - AR - - AM - - AW - - AU - - AT - - AZ - - BS - - BH - - BD - - BB - - BY - - BE - - BZ - - BJ - - BM - - BT - - BO - - BQ - - BA - - BW - - BV - - BR - - IO - - BN - - BG - - BF - - BI - - CV - - KH - - CM - - CA - - KY - - CF - - TD - - CL - - CN - - CX - - CC - - CO - - KM - - CG - - CD - - CK - - CR - - CI - - HR - - CU - - CW - - CY - - CZ - - DK - - DJ - - DM - - DO - - EC - - EG - - SV - - GQ - - ER - - EE - - SZ - - ET - - FK - - FO - - FJ - - FI - - FR - - GF - - PF - - TF - - GA - - GM - - GE - - DE - - GH - - GI - - GR - - GL - - GD - - GP - - GU - - GT - - GG - - GN - - GW - - GY - - HT - - HM - - VA - - HN - - HK - - HU - - IS - - IN - - ID - - IR - - IQ - - IE - - IM - - IL - - IT - - JM - - JP - - JE - - JO - - KZ - - KE - - KI - - KW - - KG - - LA - - LV - - LB - - LS - - LR - - LY - - LI - - LT - - LU - - MO - - MG - - MW - - MY - - MV - - ML - - MT - - MH - - MQ - - MR - - MU - - YT - - MX - - FM - - MD - - MC - - MN - - ME - - MS - - MA - - MZ - - MM - - NA - - NR - - NP - - NL - - NC - - NZ - - NI - - NE - - NG - - NU - - NF - - KP - - MK - - MP - - 'NO' - - OM - - PK - - PW - - PS - - PA - - PG - - PY - - PE - - PH - - PN - - PL - - PT - - PR - - QA - - RE - - RO - - RU - - RW - - BL - - SH - - KN - - LC - - MF - - PM - - VC - - WS - - SM - - ST - - SA - - SN - - RS - - SC - - SL - - SG - - SX - - SK - - SI - - SB - - SO - - ZA - - GS - - KR - - SS - - ES - - LK - - SD - - SR - - SJ - - SE - - CH - - SY - - TW - - TJ - - TZ - - TH - - TL - - TG - - TK - - TO - - TT - - TN - - TR - - TM - - TC - - TV - - UG - - UA - - AE - - GB - - UM - - US - - UY - - UZ - - VU - - VE - - VN - - VG - - VI - - WF - - EH - - YE - - ZM - - ZW - docs: |- - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - source: - openapi: hris_v3.yml - 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: MethodEnum - 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: hris_v3.yml - DebugModeLog: - properties: - log_id: string - dashboard_view: string - log_summary: DebugModelLogSummary - source: - openapi: hris_v3.yml - DebugModelLogSummary: - properties: - url: string - method: string - status_code: integer - source: - openapi: hris_v3.yml - Deduction: - docs: >- - # The Deduction Object - - ### Description - - The `Deduction` object is used to represent an array of the wages withheld - from total earnings for the purpose of paying taxes. - - - ### Usage Example - - Fetch from the `LIST Deductions` endpoint and filter by `ID` to show all - deductions. - 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 - employee_payroll_run: - type: optional - validation: - format: uuid - name: - type: optional - docs: The deduction's name. - employee_deduction: - type: optional - docs: >- - The amount of money that is withheld from an employee's gross pay by - the employee. - company_deduction: - type: optional - docs: >- - The amount of money that is withheld on behalf of an employee by the - company. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: hris_v3.yml - DependentRelationship: - discriminated: false - docs: |- - The dependent's relationship to the employee. - - * `CHILD` - CHILD - * `SPOUSE` - SPOUSE - * `DOMESTIC_PARTNER` - DOMESTIC_PARTNER - union: - - RelationshipEnum - - string - source: - openapi: hris_v3.yml - inline: true - DependentGender: - discriminated: false - docs: |- - The dependent's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - union: - - GenderEnum - - string - source: - openapi: hris_v3.yml - inline: true - Dependent: - docs: >- - # The Dependent Object - - ### Description - - The `Dependent` object is used to represent a dependent (e.g. child, - spouse, domestic partner, etc) of an `Employee` - - - ### Usage Example - - Fetch from the `LIST Dependents` endpoint and filter by `ID` to show all - dependents. - 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 - first_name: - type: optional - docs: The dependents's first name. - validation: - maxLength: 60 - middle_name: - type: optional - docs: The dependents's middle name. - validation: - maxLength: 60 - last_name: - type: optional - docs: The dependents's last name. - validation: - maxLength: 60 - relationship: - type: optional - docs: |- - The dependent's relationship to the employee. - - * `CHILD` - CHILD - * `SPOUSE` - SPOUSE - * `DOMESTIC_PARTNER` - DOMESTIC_PARTNER - employee: - type: optional - docs: The employee this person is a dependent of. - validation: - format: uuid - date_of_birth: - type: optional - docs: The dependent's date of birth. - gender: - type: optional - docs: |- - The dependent's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - phone_number: - type: optional - docs: The dependent's phone number. - validation: - maxLength: 50 - home_location: - type: optional - docs: The dependents's home address. - validation: - format: uuid - is_student: - type: optional - docs: Whether or not the dependent is a student - ssn: - type: optional - docs: The dependents's social security number. - validation: - maxLength: 50 - 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: hris_v3.yml - EarningType: - discriminated: false - docs: |- - The type of earning. - - * `SALARY` - SALARY - * `REIMBURSEMENT` - REIMBURSEMENT - * `OVERTIME` - OVERTIME - * `BONUS` - BONUS - union: - - EarningTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - Earning: - docs: >- - # The Earning Object - - ### Description - - The `Earning` object is used to represent an array of different - compensations that an employee receives within specific wage categories. - - - ### Usage Example - - Fetch from the `LIST Earnings` endpoint and filter by `ID` to show all - earnings. - 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 - employee_payroll_run: - type: optional - validation: - format: uuid - amount: - type: optional - docs: The amount earned. - type: - type: optional - docs: |- - The type of earning. - - * `SALARY` - SALARY - * `REIMBURSEMENT` - REIMBURSEMENT - * `OVERTIME` - OVERTIME - * `BONUS` - BONUS - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: hris_v3.yml - EarningTypeEnum: - enum: - - SALARY - - REIMBURSEMENT - - OVERTIME - - BONUS - docs: |- - * `SALARY` - SALARY - * `REIMBURSEMENT` - REIMBURSEMENT - * `OVERTIME` - OVERTIME - * `BONUS` - BONUS - source: - openapi: hris_v3.yml - EmployeeCompany: - discriminated: false - docs: The ID of the employee's company. - union: - - type: string - validation: - format: uuid - - Company - source: - openapi: hris_v3.yml - inline: true - EmployeeGroupsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Group - source: - openapi: hris_v3.yml - inline: true - EmployeeEmploymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Employment - source: - openapi: hris_v3.yml - inline: true - EmployeeHomeLocation: - discriminated: false - docs: The employee's home address. - union: - - type: string - validation: - format: uuid - - Location - source: - openapi: hris_v3.yml - inline: true - EmployeeWorkLocation: - discriminated: false - docs: The employee's work address. - union: - - type: string - validation: - format: uuid - - Location - source: - openapi: hris_v3.yml - inline: true - EmployeeManager: - discriminated: false - docs: The employee ID of the employee's manager. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - EmployeeTeam: - discriminated: false - docs: The employee's team. - union: - - type: string - validation: - format: uuid - - Team - source: - openapi: hris_v3.yml - inline: true - EmployeePayGroup: - discriminated: false - docs: The employee's pay group - union: - - type: string - validation: - format: uuid - - PayGroup - source: - openapi: hris_v3.yml - inline: true - EmployeeGender: - discriminated: false - docs: |- - The employee's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - union: - - GenderEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployeeEthnicity: - discriminated: false - docs: >- - The employee's ethnicity. - - - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE - - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `WHITE` - WHITE - - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - union: - - EthnicityEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployeeMaritalStatus: - discriminated: false - docs: >- - The employee's filing status as related to marital status. - - - * `SINGLE` - SINGLE - - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - union: - - MaritalStatusEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployeeEmploymentStatus: - discriminated: false - docs: |- - The employment status of the employee. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - union: - - EmploymentStatusEnum - - string - source: - openapi: hris_v3.yml - inline: true - Employee: - docs: >- - # The Employee Object - - ### Description - - The `Employee` object is used to represent any person who has been - employed by a company. By default, it returns all employees. To filter for - only active employees, set the `employment_status` query parameter to - `ACTIVE`. - - - ### Usage Example - - Fetch from the `LIST Employee` endpoint and filter by `ID` to show all - employees. - 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 - employee_number: - type: optional - docs: >- - The employee's number that appears in the third-party integration's - UI. - company: - type: optional - docs: The ID of the employee's company. - first_name: - type: optional - docs: The employee's first name. - last_name: - type: optional - docs: The employee's last name. - preferred_name: - type: optional - docs: The employee's preferred first name. - display_full_name: - type: optional - docs: >- - The employee's full name, to use for display purposes. If a preferred - first name is available, the full name will include the preferred - first name. - username: - type: optional - docs: The employee's username that appears in the remote UI. - groups: optional>> - work_email: - type: optional - docs: The employee's work email. - validation: - format: email - maxLength: 254 - personal_email: - type: optional - docs: The employee's personal email. - validation: - format: email - maxLength: 254 - mobile_phone_number: - type: optional - docs: The employee's mobile phone number. - employments: - type: optional>> - docs: Array of `Employment` IDs for this Employee. - home_location: - type: optional - docs: The employee's home address. - work_location: - type: optional - docs: The employee's work address. - manager: - type: optional - docs: The employee ID of the employee's manager. - team: - type: optional - docs: The employee's team. - availability: deprecated - pay_group: - type: optional - docs: The employee's pay group - ssn: - type: optional - docs: The employee's social security number. - validation: - maxLength: 100 - gender: - type: optional - docs: |- - The employee's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - ethnicity: - type: optional - docs: >- - The employee's ethnicity. - - - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - - AMERICAN_INDIAN_OR_ALASKA_NATIVE - - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `WHITE` - WHITE - - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - marital_status: - type: optional - docs: >- - The employee's filing status as related to marital status. - - - * `SINGLE` - SINGLE - - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - date_of_birth: - type: optional - docs: The employee's date of birth. - hire_date: - type: optional - docs: >- - The date that the employee was hired, usually the day that an offer - letter is signed. If an employee has multiple hire dates from previous - employments, this represents the most recent hire date. Note: If - you're looking for the employee's start date, refer to the start_date - field. - availability: deprecated - start_date: - type: optional - docs: >- - The date that the employee started working. If an employee was - rehired, the most recent start date will be returned. - remote_created_at: - type: optional - docs: When the third party's employee was created. - employment_status: - type: optional - docs: |- - The employment status of the employee. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - termination_date: - type: optional - docs: The employee's termination date. - avatar: - type: optional - docs: The URL of the employee's avatar image. - validation: - format: uri - maxLength: 2000 - custom_fields: - type: optional> - docs: Custom fields configured for a given model. - 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: hris_v3.yml - EmployeePayrollRunEmployee: - discriminated: false - docs: The employee whose payroll is being run. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - EmployeePayrollRunPayrollRun: - discriminated: false - docs: The payroll being run. - union: - - type: string - validation: - format: uuid - - PayrollRun - source: - openapi: hris_v3.yml - inline: true - EmployeePayrollRun: - docs: >- - # The EmployeePayrollRun Object - - ### Description - - The `EmployeePayrollRun` object is used to represent an employee's pay - statement for a specific payroll run. - - - ### Usage Example - - Fetch from the `LIST EmployeePayrollRun` endpoint and filter by `ID` to - show all employee payroll runs. - 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 - employee: - type: optional - docs: The employee whose payroll is being run. - payroll_run: - type: optional - docs: The payroll being run. - gross_pay: - type: optional - docs: >- - The total earnings throughout a given period for an employee before - any deductions are made. - net_pay: - type: optional - docs: >- - The take-home pay throughout a given period for an employee after - deductions are made. - start_date: - type: optional - docs: The day and time the payroll run started. - end_date: - type: optional - docs: The day and time the payroll run ended. - check_date: - type: optional - docs: The day and time the payroll run was checked. - earnings: - type: optional> - access: read-only - deductions: - type: optional> - access: read-only - taxes: - type: optional> - access: read-only - 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: hris_v3.yml - EmployeeRequestCompany: - discriminated: false - docs: The ID of the employee's company. - union: - - type: string - validation: - format: uuid - - Company - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestGroupsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Group - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestEmploymentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Employment - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestHomeLocation: - discriminated: false - docs: The employee's home address. - union: - - type: string - validation: - format: uuid - - Location - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestWorkLocation: - discriminated: false - docs: The employee's work address. - union: - - type: string - validation: - format: uuid - - Location - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestManager: - discriminated: false - docs: The employee ID of the employee's manager. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestTeam: - discriminated: false - docs: The employee's team. - union: - - type: string - validation: - format: uuid - - Team - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestPayGroup: - discriminated: false - docs: The employee's pay group - union: - - type: string - validation: - format: uuid - - PayGroup - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestGender: - discriminated: false - docs: |- - The employee's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - union: - - GenderEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestEthnicity: - discriminated: false - docs: >- - The employee's ethnicity. - - - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE - - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `WHITE` - WHITE - - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - union: - - EthnicityEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestMaritalStatus: - discriminated: false - docs: >- - The employee's filing status as related to marital status. - - - * `SINGLE` - SINGLE - - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - union: - - MaritalStatusEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployeeRequestEmploymentStatus: - discriminated: false - docs: |- - The employment status of the employee. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - union: - - EmploymentStatusEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployeeRequest: - docs: >- - # The Employee Object - - ### Description - - The `Employee` object is used to represent any person who has been - employed by a company. By default, it returns all employees. To filter for - only active employees, set the `employment_status` query parameter to - `ACTIVE`. - - - ### Usage Example - - Fetch from the `LIST Employee` endpoint and filter by `ID` to show all - employees. - properties: - employee_number: - type: optional - docs: >- - The employee's number that appears in the third-party integration's - UI. - company: - type: optional - docs: The ID of the employee's company. - first_name: - type: optional - docs: The employee's first name. - last_name: - type: optional - docs: The employee's last name. - preferred_name: - type: optional - docs: The employee's preferred first name. - display_full_name: - type: optional - docs: >- - The employee's full name, to use for display purposes. If a preferred - first name is available, the full name will include the preferred - first name. - username: - type: optional - docs: The employee's username that appears in the remote UI. - groups: optional>> - work_email: - type: optional - docs: The employee's work email. - validation: - format: email - maxLength: 254 - personal_email: - type: optional - docs: The employee's personal email. - validation: - format: email - maxLength: 254 - mobile_phone_number: - type: optional - docs: The employee's mobile phone number. - employments: - type: optional>> - docs: Array of `Employment` IDs for this Employee. - home_location: - type: optional - docs: The employee's home address. - work_location: - type: optional - docs: The employee's work address. - manager: - type: optional - docs: The employee ID of the employee's manager. - team: - type: optional - docs: The employee's team. - availability: deprecated - pay_group: - type: optional - docs: The employee's pay group - ssn: - type: optional - docs: The employee's social security number. - validation: - maxLength: 100 - gender: - type: optional - docs: |- - The employee's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - ethnicity: - type: optional - docs: >- - The employee's ethnicity. - - - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - - AMERICAN_INDIAN_OR_ALASKA_NATIVE - - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `WHITE` - WHITE - - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - marital_status: - type: optional - docs: >- - The employee's filing status as related to marital status. - - - * `SINGLE` - SINGLE - - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - date_of_birth: - type: optional - docs: The employee's date of birth. - hire_date: - type: optional - docs: >- - The date that the employee was hired, usually the day that an offer - letter is signed. If an employee has multiple hire dates from previous - employments, this represents the most recent hire date. Note: If - you're looking for the employee's start date, refer to the start_date - field. - availability: deprecated - start_date: - type: optional - docs: >- - The date that the employee started working. If an employee was - rehired, the most recent start date will be returned. - employment_status: - type: optional - docs: |- - The employment status of the employee. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - termination_date: - type: optional - docs: The employee's termination date. - avatar: - type: optional - docs: The URL of the employee's avatar image. - validation: - format: uri - maxLength: 2000 - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: hris_v3.yml - EmployeeResponse: - properties: - model: Employee - warnings: list - errors: list - logs: optional> - source: - openapi: hris_v3.yml - EmployerBenefitBenefitPlanType: - discriminated: false - docs: |- - The type of benefit plan. - - * `MEDICAL` - MEDICAL - * `HEALTH_SAVINGS` - HEALTH_SAVINGS - * `INSURANCE` - INSURANCE - * `RETIREMENT` - RETIREMENT - * `OTHER` - OTHER - union: - - BenefitPlanTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmployerBenefit: - docs: >- - # The EmployerBenefit Object - - ### Description - - The `Employer Benefit` object is used to represent a benefit plan offered - by a company. - - - ### Usage Example - - Fetch from the `LIST EmployerBenefits` endpoint and filter by `ID` to show - all EmployerBenefits. - 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 - benefit_plan_type: - type: optional - docs: |- - The type of benefit plan. - - * `MEDICAL` - MEDICAL - * `HEALTH_SAVINGS` - HEALTH_SAVINGS - * `INSURANCE` - INSURANCE - * `RETIREMENT` - RETIREMENT - * `OTHER` - OTHER - name: - type: optional - docs: The employer benefit's name - typically the carrier or network name. - validation: - maxLength: 200 - description: - type: optional - docs: The employer benefit's description. - validation: - maxLength: 2000 - deduction_code: - type: optional - docs: The employer benefit's deduction code. - validation: - maxLength: 60 - 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: hris_v3.yml - EmploymentEmployee: - discriminated: false - docs: The employee holding this position. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - EmploymentPayPeriod: - discriminated: false - docs: |- - The time period this pay rate encompasses. - - * `HOUR` - HOUR - * `DAY` - DAY - * `WEEK` - WEEK - * `EVERY_TWO_WEEKS` - EVERY_TWO_WEEKS - * `SEMIMONTHLY` - SEMIMONTHLY - * `MONTH` - MONTH - * `QUARTER` - QUARTER - * `EVERY_SIX_MONTHS` - EVERY_SIX_MONTHS - * `YEAR` - YEAR - union: - - PayPeriodEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmploymentPayFrequency: - discriminated: false - docs: |- - The position's pay frequency. - - * `WEEKLY` - WEEKLY - * `BIWEEKLY` - BIWEEKLY - * `MONTHLY` - MONTHLY - * `QUARTERLY` - QUARTERLY - * `SEMIANNUALLY` - SEMIANNUALLY - * `ANNUALLY` - ANNUALLY - * `THIRTEEN-MONTHLY` - THIRTEEN-MONTHLY - * `PRO_RATA` - PRO_RATA - * `SEMIMONTHLY` - SEMIMONTHLY - union: - - PayFrequencyEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmploymentPayCurrency: - discriminated: false - docs: >- - The position's currency code. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - union: - - PayCurrencyEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmploymentPayGroup: - discriminated: false - docs: The employment's pay group - union: - - type: string - validation: - format: uuid - - PayGroup - source: - openapi: hris_v3.yml - inline: true - EmploymentFlsaStatus: - discriminated: false - docs: |- - The position's FLSA status. - - * `EXEMPT` - EXEMPT - * `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT - * `NONEXEMPT` - NONEXEMPT - * `OWNER` - OWNER - union: - - FlsaStatusEnum - - string - source: - openapi: hris_v3.yml - inline: true - EmploymentEmploymentType: - discriminated: false - docs: |- - The position's type of employment. - - * `FULL_TIME` - FULL_TIME - * `PART_TIME` - PART_TIME - * `INTERN` - INTERN - * `CONTRACTOR` - CONTRACTOR - * `FREELANCE` - FREELANCE - union: - - EmploymentTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - Employment: - docs: >- - # The Employment Object - - ### Description - - The `Employment` object is used to represent a job position at a company. - - - If an integration supports historical tracking of employments, it will be - reflected in the data. If not, a new `Employment` object will be created - whenever there is a change in job title or pay. The `effective_date` field - should be used to order `Employment` objects, with the most recent date - corresponding to the latest employment record for an employee. - - - ### Usage Example - - Fetch from the `LIST Employments` endpoint and filter by `ID` to show all - employees. - 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 - employee: - type: optional - docs: The employee holding this position. - job_title: - type: optional - docs: The position's title. - pay_rate: - type: optional - docs: The position's pay rate. - pay_period: - type: optional - docs: |- - The time period this pay rate encompasses. - - * `HOUR` - HOUR - * `DAY` - DAY - * `WEEK` - WEEK - * `EVERY_TWO_WEEKS` - EVERY_TWO_WEEKS - * `SEMIMONTHLY` - SEMIMONTHLY - * `MONTH` - MONTH - * `QUARTER` - QUARTER - * `EVERY_SIX_MONTHS` - EVERY_SIX_MONTHS - * `YEAR` - YEAR - pay_frequency: - type: optional - docs: |- - The position's pay frequency. - - * `WEEKLY` - WEEKLY - * `BIWEEKLY` - BIWEEKLY - * `MONTHLY` - MONTHLY - * `QUARTERLY` - QUARTERLY - * `SEMIANNUALLY` - SEMIANNUALLY - * `ANNUALLY` - ANNUALLY - * `THIRTEEN-MONTHLY` - THIRTEEN-MONTHLY - * `PRO_RATA` - PRO_RATA - * `SEMIMONTHLY` - SEMIMONTHLY - pay_currency: - type: optional - docs: >- - The position's currency code. - - - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - pay_group: - type: optional - docs: The employment's pay group - flsa_status: - type: optional - docs: |- - The position's FLSA status. - - * `EXEMPT` - EXEMPT - * `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT - * `NONEXEMPT` - NONEXEMPT - * `OWNER` - OWNER - effective_date: - type: optional - docs: The position's effective date. - employment_type: - type: optional - docs: |- - The position's type of employment. - - * `FULL_TIME` - FULL_TIME - * `PART_TIME` - PART_TIME - * `INTERN` - INTERN - * `CONTRACTOR` - CONTRACTOR - * `FREELANCE` - FREELANCE - 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: hris_v3.yml - EmploymentStatusEnum: - enum: - - ACTIVE - - PENDING - - INACTIVE - docs: |- - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - source: - openapi: hris_v3.yml - EmploymentTypeEnum: - enum: - - FULL_TIME - - PART_TIME - - INTERN - - CONTRACTOR - - FREELANCE - docs: |- - * `FULL_TIME` - FULL_TIME - * `PART_TIME` - PART_TIME - * `INTERN` - INTERN - * `CONTRACTOR` - CONTRACTOR - * `FREELANCE` - FREELANCE - source: - openapi: hris_v3.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: hris_v3.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: hris_v3.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: hris_v3.yml - EthnicityEnum: - enum: - - AMERICAN_INDIAN_OR_ALASKA_NATIVE - - ASIAN_OR_INDIAN_SUBCONTINENT - - BLACK_OR_AFRICAN_AMERICAN - - HISPANIC_OR_LATINO - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - TWO_OR_MORE_RACES - - WHITE - - PREFER_NOT_TO_DISCLOSE - docs: >- - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE - - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - - * `WHITE` - WHITE - - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - source: - openapi: hris_v3.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: hris_v3.yml - ExternalTargetFieldApi: - properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only - source: - openapi: hris_v3.yml - ExternalTargetFieldApiResponse: - properties: - Benefit: optional> - EmployerBenefit: optional> - Company: optional> - EmployeePayrollRun: optional> - Employee: optional> - Employment: optional> - Location: optional> - PayrollRun: optional> - Team: optional> - TimeOff: optional> - TimeOffBalance: optional> - BankInfo: optional> - PayGroup: optional> - Group: optional> - Dependent: optional> - TimesheetEntry: optional> - source: - openapi: hris_v3.yml - FieldMappingApiInstanceTargetField: - properties: - name: string - description: string - is_organization_wide: boolean - source: - openapi: hris_v3.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: - properties: - method: optional - url_path: optional - field_traversal_path: optional> - source: - openapi: hris_v3.yml - inline: true - FieldMappingApiInstanceRemoteField: - properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - source: - openapi: hris_v3.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 - source: - openapi: hris_v3.yml - FieldMappingApiInstanceResponse: - properties: - Benefit: optional> - EmployerBenefit: optional> - Company: optional> - EmployeePayrollRun: optional> - Employee: optional> - Employment: optional> - Location: optional> - PayrollRun: optional> - Team: optional> - TimeOff: optional> - TimeOffBalance: optional> - BankInfo: optional> - PayGroup: optional> - Group: optional> - Dependent: optional> - TimesheetEntry: optional> - source: - openapi: hris_v3.yml - FieldMappingInstanceResponse: - properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> - source: - openapi: hris_v3.yml - FieldPermissionDeserializer: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: hris_v3.yml - FieldPermissionDeserializerRequest: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: hris_v3.yml - FlsaStatusEnum: - enum: - - EXEMPT - - SALARIED_NONEXEMPT - - NONEXEMPT - - OWNER - docs: |- - * `EXEMPT` - EXEMPT - * `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT - * `NONEXEMPT` - NONEXEMPT - * `OWNER` - OWNER - source: - openapi: hris_v3.yml - GenderEnum: - enum: - - MALE - - FEMALE - - value: NON-BINARY - name: NonBinary - - OTHER - - PREFER_NOT_TO_DISCLOSE - docs: |- - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - source: - openapi: hris_v3.yml - GroupType: - discriminated: false - docs: |- - The Group type returned directly from the third-party. - - * `TEAM` - TEAM - * `DEPARTMENT` - DEPARTMENT - * `COST_CENTER` - COST_CENTER - * `BUSINESS_UNIT` - BUSINESS_UNIT - * `GROUP` - GROUP - union: - - GroupTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - Group: - docs: >- - # The Group Object - - ### Description - - The `Group` object is used to represent any subset of employees across, - for example, `DEPARTMENT` or `TEAM`. Employees can be in multiple Groups. - - - ### Usage Example - - Fetch from the `LIST Employee` endpoint and expand groups to view an - employee's 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 - parent_group: - type: optional - docs: The parent group for this group. - validation: - format: uuid - name: - type: optional - docs: The group name. - type: - type: optional - docs: |- - The Group type returned directly from the third-party. - - * `TEAM` - TEAM - * `DEPARTMENT` - DEPARTMENT - * `COST_CENTER` - COST_CENTER - * `BUSINESS_UNIT` - BUSINESS_UNIT - * `GROUP` - GROUP - is_commonly_used_as_team: - type: optional - docs: >- - Indicates whether the Group refers to a team in the third party - platform. Note that this is an opinionated view based on how Merge - observes most organizations representing teams in each third party - platform. If your customer uses a platform different from most, there - is a chance this will not be correct. - 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: hris_v3.yml - GroupTypeEnum: - enum: - - TEAM - - DEPARTMENT - - COST_CENTER - - BUSINESS_UNIT - - GROUP - docs: |- - * `TEAM` - TEAM - * `DEPARTMENT` - DEPARTMENT - * `COST_CENTER` - COST_CENTER - * `BUSINESS_UNIT` - BUSINESS_UNIT - * `GROUP` - GROUP - source: - openapi: hris_v3.yml - IgnoreCommonModelRequestReason: - discriminated: false - union: - - ReasonEnum - - string - source: - openapi: hris_v3.yml - inline: true - IgnoreCommonModelRequest: - properties: - reason: IgnoreCommonModelRequestReason - message: - type: optional - validation: - minLength: 1 - maxLength: 256 - source: - openapi: hris_v3.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: hris_v3.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: hris_v3.yml - IssueStatus: - discriminated: false - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - union: - - IssueStatusEnum - - string - source: - openapi: hris_v3.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: hris_v3.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: hris_v3.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: hris_v3.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: hris_v3.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: hris_v3.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean - source: - openapi: hris_v3.yml - LocationCountry: - discriminated: false - docs: |- - The location's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - union: - - CountryEnum - - string - source: - openapi: hris_v3.yml - inline: true - LocationLocationType: - discriminated: false - docs: |- - The location's type. Can be either WORK or HOME - - * `HOME` - HOME - * `WORK` - WORK - union: - - LocationTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - Location: - docs: >- - # The Location Object - - ### Description - - The `Location` object is used to represent an address that can be - associated with an employee. - - - ### Usage Example - - Fetch from the `LIST Locations` endpoint and filter by `ID` to show all - office locations. - 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 location's name. - phone_number: - type: optional - docs: The location's phone number. - street_1: - type: optional - docs: Line 1 of the location's street address. - street_2: - type: optional - docs: Line 2 of the location's street address. - city: - type: optional - docs: The location's city. - state: - type: optional - docs: The location's state. Represents a region if outside of the US. - zip_code: - type: optional - docs: The location's zip code or postal code. - country: - type: optional - docs: |- - The location's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - location_type: - type: optional - docs: |- - The location's type. Can be either WORK or HOME - - * `HOME` - HOME - * `WORK` - WORK - 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: hris_v3.yml - LocationTypeEnum: - enum: - - HOME - - WORK - docs: |- - * `HOME` - HOME - * `WORK` - WORK - source: - openapi: hris_v3.yml - MaritalStatusEnum: - enum: - - SINGLE - - MARRIED_FILING_JOINTLY - - MARRIED_FILING_SEPARATELY - - HEAD_OF_HOUSEHOLD - - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - docs: >- - * `SINGLE` - SINGLE - - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - source: - openapi: hris_v3.yml - MetaResponse: - properties: - request_schema: map - remote_field_classes: optional> - status: optional - has_conditional_params: boolean - has_required_linked_account_params: boolean - source: - openapi: hris_v3.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: hris_v3.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: hris_v3.yml - ModelPermissionDeserializer: - properties: - is_enabled: optional - source: - openapi: hris_v3.yml - ModelPermissionDeserializerRequest: - properties: - is_enabled: optional - source: - openapi: hris_v3.yml - 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: hris_v3.yml - PaginatedAccountDetailsAndActionsList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedAuditLogEventList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedBankInfoList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedBenefitList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedCompanyList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedDependentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedEmployeeList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedEmployeePayrollRunList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedEmployerBenefitList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedEmploymentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedGroupList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedIssueList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedLocationList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedPayGroupList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedPayrollRunList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedSyncStatusList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedTeamList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedTimeOffBalanceList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedTimeOffList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PaginatedTimesheetEntryList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: hris_v3.yml - PayCurrencyEnum: - enum: - - XUA - - AFN - - AFA - - ALL - - ALK - - DZD - - ADP - - AOA - - AOK - - AON - - AOR - - ARA - - ARS - - ARM - - ARP - - ARL - - AMD - - AWG - - AUD - - ATS - - AZN - - AZM - - BSD - - BHD - - BDT - - BBD - - BYN - - BYB - - BYR - - BEF - - BEC - - BEL - - BZD - - BMD - - BTN - - BOB - - BOL - - BOV - - BOP - - BAM - - BAD - - BAN - - BWP - - BRC - - BRZ - - BRE - - BRR - - BRN - - BRB - - BRL - - GBP - - BND - - BGL - - BGN - - BGO - - BGM - - BUK - - BIF - - XPF - - KHR - - CAD - - CVE - - KYD - - XAF - - CLE - - CLP - - CLF - - CNX - - CNY - - CNH - - COP - - COU - - KMF - - CDF - - CRC - - HRD - - HRK - - CUC - - CUP - - CYP - - CZK - - CSK - - DKK - - DJF - - DOP - - NLG - - XCD - - DDM - - ECS - - ECV - - EGP - - GQE - - ERN - - EEK - - ETB - - EUR - - XBA - - XEU - - XBB - - XBC - - XBD - - FKP - - FJD - - FIM - - FRF - - XFO - - XFU - - GMD - - GEK - - GEL - - DEM - - GHS - - GHC - - GIP - - XAU - - GRD - - GTQ - - GWP - - GNF - - GNS - - GYD - - HTG - - HNL - - HKD - - HUF - - IMP - - ISK - - ISJ - - INR - - IDR - - IRR - - IQD - - IEP - - ILS - - ILP - - ILR - - ITL - - JMD - - JPY - - JOD - - KZT - - KES - - KWD - - KGS - - LAK - - LVL - - LVR - - LBP - - LSL - - LRD - - LYD - - LTL - - LTT - - LUL - - LUC - - LUF - - MOP - - MKD - - MKN - - MGA - - MGF - - MWK - - MYR - - MVR - - MVP - - MLF - - MTL - - MTP - - MRU - - MRO - - MUR - - MXV - - MXN - - MXP - - MDC - - MDL - - MCF - - MNT - - MAD - - MAF - - MZE - - MZN - - MZM - - MMK - - NAD - - NPR - - ANG - - TWD - - NZD - - NIO - - NIC - - NGN - - KPW - - NOK - - OMR - - PKR - - XPD - - PAB - - PGK - - PYG - - PEI - - PEN - - PES - - PHP - - XPT - - PLN - - PLZ - - PTE - - GWE - - QAR - - XRE - - RHD - - RON - - ROL - - RUB - - RUR - - RWF - - SVC - - WST - - SAR - - RSD - - CSD - - SCR - - SLL - - XAG - - SGD - - SKK - - SIT - - SBD - - SOS - - ZAR - - ZAL - - KRH - - KRW - - KRO - - SSP - - SUR - - ESP - - ESA - - ESB - - XDR - - LKR - - SHP - - XSU - - SDD - - SDG - - SDP - - SRD - - SRG - - SZL - - SEK - - CHF - - SYP - - STN - - STD - - TVD - - TJR - - TJS - - TZS - - XTS - - THB - - XXX - - TPE - - TOP - - TTD - - TND - - TRY - - TRL - - TMT - - TMM - - USD - - USN - - USS - - UGX - - UGS - - UAH - - UAK - - AED - - UYW - - UYU - - UYP - - UYI - - UZS - - VUV - - VES - - VEB - - VEF - - VND - - VNN - - CHE - - CHW - - XOF - - YDD - - YER - - YUN - - YUD - - YUM - - YUR - - ZWN - - ZRN - - ZRZ - - ZMW - - ZMK - - ZWD - - ZWR - - ZWL - docs: >- - * `XUA` - ADB Unit of Account - - * `AFN` - Afghan Afghani - - * `AFA` - Afghan Afghani (1927–2002) - - * `ALL` - Albanian Lek - - * `ALK` - Albanian Lek (1946–1965) - - * `DZD` - Algerian Dinar - - * `ADP` - Andorran Peseta - - * `AOA` - Angolan Kwanza - - * `AOK` - Angolan Kwanza (1977–1991) - - * `AON` - Angolan New Kwanza (1990–2000) - - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - - * `ARA` - Argentine Austral - - * `ARS` - Argentine Peso - - * `ARM` - Argentine Peso (1881–1970) - - * `ARP` - Argentine Peso (1983–1985) - - * `ARL` - Argentine Peso Ley (1970–1983) - - * `AMD` - Armenian Dram - - * `AWG` - Aruban Florin - - * `AUD` - Australian Dollar - - * `ATS` - Austrian Schilling - - * `AZN` - Azerbaijani Manat - - * `AZM` - Azerbaijani Manat (1993–2006) - - * `BSD` - Bahamian Dollar - - * `BHD` - Bahraini Dinar - - * `BDT` - Bangladeshi Taka - - * `BBD` - Barbadian Dollar - - * `BYN` - Belarusian Ruble - - * `BYB` - Belarusian Ruble (1994–1999) - - * `BYR` - Belarusian Ruble (2000–2016) - - * `BEF` - Belgian Franc - - * `BEC` - Belgian Franc (convertible) - - * `BEL` - Belgian Franc (financial) - - * `BZD` - Belize Dollar - - * `BMD` - Bermudan Dollar - - * `BTN` - Bhutanese Ngultrum - - * `BOB` - Bolivian Boliviano - - * `BOL` - Bolivian Boliviano (1863–1963) - - * `BOV` - Bolivian Mvdol - - * `BOP` - Bolivian Peso - - * `BAM` - Bosnia-Herzegovina Convertible Mark - - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - - * `BWP` - Botswanan Pula - - * `BRC` - Brazilian Cruzado (1986–1989) - - * `BRZ` - Brazilian Cruzeiro (1942–1967) - - * `BRE` - Brazilian Cruzeiro (1990–1993) - - * `BRR` - Brazilian Cruzeiro (1993–1994) - - * `BRN` - Brazilian New Cruzado (1989–1990) - - * `BRB` - Brazilian New Cruzeiro (1967–1986) - - * `BRL` - Brazilian Real - - * `GBP` - British Pound - - * `BND` - Brunei Dollar - - * `BGL` - Bulgarian Hard Lev - - * `BGN` - Bulgarian Lev - - * `BGO` - Bulgarian Lev (1879–1952) - - * `BGM` - Bulgarian Socialist Lev - - * `BUK` - Burmese Kyat - - * `BIF` - Burundian Franc - - * `XPF` - CFP Franc - - * `KHR` - Cambodian Riel - - * `CAD` - Canadian Dollar - - * `CVE` - Cape Verdean Escudo - - * `KYD` - Cayman Islands Dollar - - * `XAF` - Central African CFA Franc - - * `CLE` - Chilean Escudo - - * `CLP` - Chilean Peso - - * `CLF` - Chilean Unit of Account (UF) - - * `CNX` - Chinese People’s Bank Dollar - - * `CNY` - Chinese Yuan - - * `CNH` - Chinese Yuan (offshore) - - * `COP` - Colombian Peso - - * `COU` - Colombian Real Value Unit - - * `KMF` - Comorian Franc - - * `CDF` - Congolese Franc - - * `CRC` - Costa Rican Colón - - * `HRD` - Croatian Dinar - - * `HRK` - Croatian Kuna - - * `CUC` - Cuban Convertible Peso - - * `CUP` - Cuban Peso - - * `CYP` - Cypriot Pound - - * `CZK` - Czech Koruna - - * `CSK` - Czechoslovak Hard Koruna - - * `DKK` - Danish Krone - - * `DJF` - Djiboutian Franc - - * `DOP` - Dominican Peso - - * `NLG` - Dutch Guilder - - * `XCD` - East Caribbean Dollar - - * `DDM` - East German Mark - - * `ECS` - Ecuadorian Sucre - - * `ECV` - Ecuadorian Unit of Constant Value - - * `EGP` - Egyptian Pound - - * `GQE` - Equatorial Guinean Ekwele - - * `ERN` - Eritrean Nakfa - - * `EEK` - Estonian Kroon - - * `ETB` - Ethiopian Birr - - * `EUR` - Euro - - * `XBA` - European Composite Unit - - * `XEU` - European Currency Unit - - * `XBB` - European Monetary Unit - - * `XBC` - European Unit of Account (XBC) - - * `XBD` - European Unit of Account (XBD) - - * `FKP` - Falkland Islands Pound - - * `FJD` - Fijian Dollar - - * `FIM` - Finnish Markka - - * `FRF` - French Franc - - * `XFO` - French Gold Franc - - * `XFU` - French UIC-Franc - - * `GMD` - Gambian Dalasi - - * `GEK` - Georgian Kupon Larit - - * `GEL` - Georgian Lari - - * `DEM` - German Mark - - * `GHS` - Ghanaian Cedi - - * `GHC` - Ghanaian Cedi (1979–2007) - - * `GIP` - Gibraltar Pound - - * `XAU` - Gold - - * `GRD` - Greek Drachma - - * `GTQ` - Guatemalan Quetzal - - * `GWP` - Guinea-Bissau Peso - - * `GNF` - Guinean Franc - - * `GNS` - Guinean Syli - - * `GYD` - Guyanaese Dollar - - * `HTG` - Haitian Gourde - - * `HNL` - Honduran Lempira - - * `HKD` - Hong Kong Dollar - - * `HUF` - Hungarian Forint - - * `IMP` - IMP - - * `ISK` - Icelandic Króna - - * `ISJ` - Icelandic Króna (1918–1981) - - * `INR` - Indian Rupee - - * `IDR` - Indonesian Rupiah - - * `IRR` - Iranian Rial - - * `IQD` - Iraqi Dinar - - * `IEP` - Irish Pound - - * `ILS` - Israeli New Shekel - - * `ILP` - Israeli Pound - - * `ILR` - Israeli Shekel (1980–1985) - - * `ITL` - Italian Lira - - * `JMD` - Jamaican Dollar - - * `JPY` - Japanese Yen - - * `JOD` - Jordanian Dinar - - * `KZT` - Kazakhstani Tenge - - * `KES` - Kenyan Shilling - - * `KWD` - Kuwaiti Dinar - - * `KGS` - Kyrgystani Som - - * `LAK` - Laotian Kip - - * `LVL` - Latvian Lats - - * `LVR` - Latvian Ruble - - * `LBP` - Lebanese Pound - - * `LSL` - Lesotho Loti - - * `LRD` - Liberian Dollar - - * `LYD` - Libyan Dinar - - * `LTL` - Lithuanian Litas - - * `LTT` - Lithuanian Talonas - - * `LUL` - Luxembourg Financial Franc - - * `LUC` - Luxembourgian Convertible Franc - - * `LUF` - Luxembourgian Franc - - * `MOP` - Macanese Pataca - - * `MKD` - Macedonian Denar - - * `MKN` - Macedonian Denar (1992–1993) - - * `MGA` - Malagasy Ariary - - * `MGF` - Malagasy Franc - - * `MWK` - Malawian Kwacha - - * `MYR` - Malaysian Ringgit - - * `MVR` - Maldivian Rufiyaa - - * `MVP` - Maldivian Rupee (1947–1981) - - * `MLF` - Malian Franc - - * `MTL` - Maltese Lira - - * `MTP` - Maltese Pound - - * `MRU` - Mauritanian Ouguiya - - * `MRO` - Mauritanian Ouguiya (1973–2017) - - * `MUR` - Mauritian Rupee - - * `MXV` - Mexican Investment Unit - - * `MXN` - Mexican Peso - - * `MXP` - Mexican Silver Peso (1861–1992) - - * `MDC` - Moldovan Cupon - - * `MDL` - Moldovan Leu - - * `MCF` - Monegasque Franc - - * `MNT` - Mongolian Tugrik - - * `MAD` - Moroccan Dirham - - * `MAF` - Moroccan Franc - - * `MZE` - Mozambican Escudo - - * `MZN` - Mozambican Metical - - * `MZM` - Mozambican Metical (1980–2006) - - * `MMK` - Myanmar Kyat - - * `NAD` - Namibian Dollar - - * `NPR` - Nepalese Rupee - - * `ANG` - Netherlands Antillean Guilder - - * `TWD` - New Taiwan Dollar - - * `NZD` - New Zealand Dollar - - * `NIO` - Nicaraguan Córdoba - - * `NIC` - Nicaraguan Córdoba (1988–1991) - - * `NGN` - Nigerian Naira - - * `KPW` - North Korean Won - - * `NOK` - Norwegian Krone - - * `OMR` - Omani Rial - - * `PKR` - Pakistani Rupee - - * `XPD` - Palladium - - * `PAB` - Panamanian Balboa - - * `PGK` - Papua New Guinean Kina - - * `PYG` - Paraguayan Guarani - - * `PEI` - Peruvian Inti - - * `PEN` - Peruvian Sol - - * `PES` - Peruvian Sol (1863–1965) - - * `PHP` - Philippine Peso - - * `XPT` - Platinum - - * `PLN` - Polish Zloty - - * `PLZ` - Polish Zloty (1950–1995) - - * `PTE` - Portuguese Escudo - - * `GWE` - Portuguese Guinea Escudo - - * `QAR` - Qatari Rial - - * `XRE` - RINET Funds - - * `RHD` - Rhodesian Dollar - - * `RON` - Romanian Leu - - * `ROL` - Romanian Leu (1952–2006) - - * `RUB` - Russian Ruble - - * `RUR` - Russian Ruble (1991–1998) - - * `RWF` - Rwandan Franc - - * `SVC` - Salvadoran Colón - - * `WST` - Samoan Tala - - * `SAR` - Saudi Riyal - - * `RSD` - Serbian Dinar - - * `CSD` - Serbian Dinar (2002–2006) - - * `SCR` - Seychellois Rupee - - * `SLL` - Sierra Leonean Leone - - * `XAG` - Silver - - * `SGD` - Singapore Dollar - - * `SKK` - Slovak Koruna - - * `SIT` - Slovenian Tolar - - * `SBD` - Solomon Islands Dollar - - * `SOS` - Somali Shilling - - * `ZAR` - South African Rand - - * `ZAL` - South African Rand (financial) - - * `KRH` - South Korean Hwan (1953–1962) - - * `KRW` - South Korean Won - - * `KRO` - South Korean Won (1945–1953) - - * `SSP` - South Sudanese Pound - - * `SUR` - Soviet Rouble - - * `ESP` - Spanish Peseta - - * `ESA` - Spanish Peseta (A account) - - * `ESB` - Spanish Peseta (convertible account) - - * `XDR` - Special Drawing Rights - - * `LKR` - Sri Lankan Rupee - - * `SHP` - St. Helena Pound - - * `XSU` - Sucre - - * `SDD` - Sudanese Dinar (1992–2007) - - * `SDG` - Sudanese Pound - - * `SDP` - Sudanese Pound (1957–1998) - - * `SRD` - Surinamese Dollar - - * `SRG` - Surinamese Guilder - - * `SZL` - Swazi Lilangeni - - * `SEK` - Swedish Krona - - * `CHF` - Swiss Franc - - * `SYP` - Syrian Pound - - * `STN` - São Tomé & Príncipe Dobra - - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - - * `TVD` - TVD - - * `TJR` - Tajikistani Ruble - - * `TJS` - Tajikistani Somoni - - * `TZS` - Tanzanian Shilling - - * `XTS` - Testing Currency Code - - * `THB` - Thai Baht - - * `XXX` - The codes assigned for transactions where no currency is - involved - - * `TPE` - Timorese Escudo - - * `TOP` - Tongan Paʻanga - - * `TTD` - Trinidad & Tobago Dollar - - * `TND` - Tunisian Dinar - - * `TRY` - Turkish Lira - - * `TRL` - Turkish Lira (1922–2005) - - * `TMT` - Turkmenistani Manat - - * `TMM` - Turkmenistani Manat (1993–2009) - - * `USD` - US Dollar - - * `USN` - US Dollar (Next day) - - * `USS` - US Dollar (Same day) - - * `UGX` - Ugandan Shilling - - * `UGS` - Ugandan Shilling (1966–1987) - - * `UAH` - Ukrainian Hryvnia - - * `UAK` - Ukrainian Karbovanets - - * `AED` - United Arab Emirates Dirham - - * `UYW` - Uruguayan Nominal Wage Index Unit - - * `UYU` - Uruguayan Peso - - * `UYP` - Uruguayan Peso (1975–1993) - - * `UYI` - Uruguayan Peso (Indexed Units) - - * `UZS` - Uzbekistani Som - - * `VUV` - Vanuatu Vatu - - * `VES` - Venezuelan Bolívar - - * `VEB` - Venezuelan Bolívar (1871–2008) - - * `VEF` - Venezuelan Bolívar (2008–2018) - - * `VND` - Vietnamese Dong - - * `VNN` - Vietnamese Dong (1978–1985) - - * `CHE` - WIR Euro - - * `CHW` - WIR Franc - - * `XOF` - West African CFA Franc - - * `YDD` - Yemeni Dinar - - * `YER` - Yemeni Rial - - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - - * `YUM` - Yugoslavian New Dinar (1994–2002) - - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - - * `ZWN` - ZWN - - * `ZRN` - Zairean New Zaire (1993–1998) - - * `ZRZ` - Zairean Zaire (1971–1993) - - * `ZMW` - Zambian Kwacha - - * `ZMK` - Zambian Kwacha (1968–2012) - - * `ZWD` - Zimbabwean Dollar (1980–2008) - - * `ZWR` - Zimbabwean Dollar (2008) - - * `ZWL` - Zimbabwean Dollar (2009) - source: - openapi: hris_v3.yml - PayFrequencyEnum: - enum: - - WEEKLY - - BIWEEKLY - - MONTHLY - - QUARTERLY - - SEMIANNUALLY - - ANNUALLY - - value: THIRTEEN-MONTHLY - name: ThirteenMonthly - - PRO_RATA - - SEMIMONTHLY - docs: |- - * `WEEKLY` - WEEKLY - * `BIWEEKLY` - BIWEEKLY - * `MONTHLY` - MONTHLY - * `QUARTERLY` - QUARTERLY - * `SEMIANNUALLY` - SEMIANNUALLY - * `ANNUALLY` - ANNUALLY - * `THIRTEEN-MONTHLY` - THIRTEEN-MONTHLY - * `PRO_RATA` - PRO_RATA - * `SEMIMONTHLY` - SEMIMONTHLY - source: - openapi: hris_v3.yml - PayGroup: - docs: >- - # The PayGroup Object - - ### Description - - The `PayGroup` object is used to represent a subset of employees that are - put together for payroll processing purposes. - - - ### Usage Example - - Fetch from the `LIST PayGroup` endpoint and filter by `ID` to show all pay - group information. - 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 - pay_group_name: - type: optional - docs: The pay group name. - 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: hris_v3.yml - PayPeriodEnum: - enum: - - HOUR - - DAY - - WEEK - - EVERY_TWO_WEEKS - - SEMIMONTHLY - - MONTH - - QUARTER - - EVERY_SIX_MONTHS - - YEAR - docs: |- - * `HOUR` - HOUR - * `DAY` - DAY - * `WEEK` - WEEK - * `EVERY_TWO_WEEKS` - EVERY_TWO_WEEKS - * `SEMIMONTHLY` - SEMIMONTHLY - * `MONTH` - MONTH - * `QUARTER` - QUARTER - * `EVERY_SIX_MONTHS` - EVERY_SIX_MONTHS - * `YEAR` - YEAR - source: - openapi: hris_v3.yml - PayrollRunRunState: - discriminated: false - docs: |- - The state of the payroll run - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `APPROVED` - APPROVED - * `FAILED` - FAILED - * `CLOSED` - CLOSED - union: - - RunStateEnum - - string - source: - openapi: hris_v3.yml - inline: true - PayrollRunRunType: - discriminated: false - docs: |- - The type of the payroll run - - * `REGULAR` - REGULAR - * `OFF_CYCLE` - OFF_CYCLE - * `CORRECTION` - CORRECTION - * `TERMINATION` - TERMINATION - * `SIGN_ON_BONUS` - SIGN_ON_BONUS - union: - - RunTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - PayrollRun: - docs: >- - # The PayrollRun Object - - ### Description - - The `PayrollRun` object is used to represent a group of pay statements for - a specific pay schedule. - - - ### Usage Example - - Fetch from the `LIST PayrollRuns` endpoint and filter by `ID` to show all - payroll runs. - 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 - run_state: - type: optional - docs: |- - The state of the payroll run - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `APPROVED` - APPROVED - * `FAILED` - FAILED - * `CLOSED` - CLOSED - run_type: - type: optional - docs: |- - The type of the payroll run - - * `REGULAR` - REGULAR - * `OFF_CYCLE` - OFF_CYCLE - * `CORRECTION` - CORRECTION - * `TERMINATION` - TERMINATION - * `SIGN_ON_BONUS` - SIGN_ON_BONUS - start_date: - type: optional - docs: The day and time the payroll run started. - end_date: - type: optional - docs: The day and time the payroll run ended. - check_date: - type: optional - docs: The day and time the payroll run was checked. - 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: hris_v3.yml - PolicyTypeEnum: - enum: - - VACATION - - SICK - - PERSONAL - - JURY_DUTY - - VOLUNTEER - - BEREAVEMENT - docs: |- - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - source: - openapi: hris_v3.yml - ReasonEnum: - enum: - - GENERAL_CUSTOMER_REQUEST - - GDPR - - OTHER - docs: |- - * `GENERAL_CUSTOMER_REQUEST` - GENERAL_CUSTOMER_REQUEST - * `GDPR` - GDPR - * `OTHER` - OTHER - source: - openapi: hris_v3.yml - RelationshipEnum: - enum: - - CHILD - - SPOUSE - - DOMESTIC_PARTNER - docs: |- - * `CHILD` - CHILD - * `SPOUSE` - SPOUSE - * `DOMESTIC_PARTNER` - DOMESTIC_PARTNER - source: - openapi: hris_v3.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: hris_v3.yml - RemoteEndpointInfo: - properties: - method: string - url_path: string - field_traversal_path: list - source: - openapi: hris_v3.yml - RemoteFieldApiCoverage: - discriminated: false - union: - - integer - - double - source: - openapi: hris_v3.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: hris_v3.yml - RemoteFieldApiResponse: - properties: - Benefit: optional> - EmployerBenefit: optional> - Company: optional> - EmployeePayrollRun: optional> - Employee: optional> - Employment: optional> - Location: optional> - PayrollRun: optional> - Team: optional> - TimeOff: optional> - TimeOffBalance: optional> - BankInfo: optional> - PayGroup: optional> - Group: optional> - Dependent: optional> - TimesheetEntry: optional> - source: - openapi: hris_v3.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: hris_v3.yml - RemoteResponseResponseType: - discriminated: false - union: - - ResponseTypeEnum - - string - source: - openapi: hris_v3.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: hris_v3.yml - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - docs: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - source: - openapi: hris_v3.yml - RequestTypeEnum: - enum: - - VACATION - - SICK - - PERSONAL - - JURY_DUTY - - VOLUNTEER - - BEREAVEMENT - docs: |- - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - source: - openapi: hris_v3.yml - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - docs: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - source: - openapi: hris_v3.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: hris_v3.yml - RunStateEnum: - enum: - - PAID - - DRAFT - - APPROVED - - FAILED - - CLOSED - docs: |- - * `PAID` - PAID - * `DRAFT` - DRAFT - * `APPROVED` - APPROVED - * `FAILED` - FAILED - * `CLOSED` - CLOSED - source: - openapi: hris_v3.yml - RunTypeEnum: - enum: - - REGULAR - - OFF_CYCLE - - CORRECTION - - TERMINATION - - SIGN_ON_BONUS - docs: |- - * `REGULAR` - REGULAR - * `OFF_CYCLE` - OFF_CYCLE - * `CORRECTION` - CORRECTION - * `TERMINATION` - TERMINATION - * `SIGN_ON_BONUS` - SIGN_ON_BONUS - source: - openapi: hris_v3.yml - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - docs: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - source: - openapi: hris_v3.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: hris_v3.yml - SyncStatusLastSyncResult: - discriminated: false - union: - - LastSyncResultEnum - - string - source: - openapi: hris_v3.yml - inline: true - SyncStatusStatus: - discriminated: false - union: - - StatusFd5Enum - - string - source: - openapi: hris_v3.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: hris_v3.yml - Tax: - docs: >- - # The Tax Object - - ### Description - - The `Tax` object is used to represent an array of the tax deductions for a - given employee's payroll run. - - - ### Usage Example - - Fetch from the `LIST Taxes` endpoint and filter by `ID` to show all taxes. - 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 - employee_payroll_run: - type: optional - validation: - format: uuid - name: - type: optional - docs: The tax's name. - amount: - type: optional - docs: The tax amount. - employer_tax: - type: optional - docs: Whether or not the employer is responsible for paying the tax. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: hris_v3.yml - TeamParentTeam: - discriminated: false - docs: The team's parent team. - union: - - type: string - validation: - format: uuid - - Team - source: - openapi: hris_v3.yml - inline: true - Team: - docs: >- - # The Team Object - - ### Description - - The `Team` object is used to represent a subdivision of the company, - usually a department. Each employee will be grouped into one specific - Team. - - - ### Usage Example - - If you're building a way to filter by `Team`, you'd hit the `GET Teams` - endpoint to fetch the `Teams`, and then use the `ID` of the team your user - selects to filter the `GET Employees` endpoint. - 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 team's name. - parent_team: - type: optional - docs: The team's parent team. - 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: hris_v3.yml - TimeOffEmployee: - discriminated: false - docs: The employee requesting time off. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - TimeOffApprover: - discriminated: false - docs: >- - The Merge ID of the employee with the ability to approve the time off - request. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - TimeOffStatus: - discriminated: false - docs: |- - The status of this time off request. - - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - union: - - TimeOffStatusEnum - - string - source: - openapi: hris_v3.yml - inline: true - TimeOffUnits: - discriminated: false - docs: >- - The measurement that the third-party integration uses to count time - requested. - - - * `HOURS` - HOURS - - * `DAYS` - DAYS - union: - - UnitsEnum - - string - source: - openapi: hris_v3.yml - inline: true - TimeOffRequestType: - discriminated: false - docs: |- - The type of time off request. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - union: - - RequestTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - TimeOff: - docs: >- - # The TimeOff Object - - ### Description - - The `TimeOff` object is used to represent all employees' Time Off entries. - - - ### Usage Example - - Fetch from the `LIST TimeOffs` endpoint and filter by `ID` to show all - time off requests. - 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 - employee: - type: optional - docs: The employee requesting time off. - approver: - type: optional - docs: >- - The Merge ID of the employee with the ability to approve the time off - request. - status: - type: optional - docs: |- - The status of this time off request. - - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - employee_note: - type: optional - docs: The employee note for this time off request. - units: - type: optional - docs: >- - The measurement that the third-party integration uses to count time - requested. - - - * `HOURS` - HOURS - - * `DAYS` - DAYS - amount: - type: optional - docs: The time off quantity measured by the prescribed “units”. - request_type: - type: optional - docs: |- - The type of time off request. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - start_time: - type: optional - docs: The day and time of the start of the time requested off. - end_time: - type: optional - docs: The day and time of the end of the time requested off. - 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: hris_v3.yml - TimeOffBalanceEmployee: - discriminated: false - docs: The employee the balance belongs to. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - TimeOffBalancePolicyType: - discriminated: false - docs: |- - The policy type of this time off balance. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - union: - - PolicyTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - TimeOffBalance: - docs: >- - # The TimeOffBalance Object - - ### Description - - The `TimeOffBalance` object is used to represent current balances for an - employee's Time Off plan. - - - ### Usage Example - - Fetch from the `LIST TimeOffBalances` endpoint and filter by `ID` to show - all time off balances. - 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 - employee: - type: optional - docs: The employee the balance belongs to. - balance: - type: optional - docs: >- - The current remaining PTO balance, measured in hours. For integrations - that return this value in days, Merge multiplies by 8 to calculate - hours. - used: - type: optional - docs: >- - The amount of PTO used in terms of hours. For integrations that return - this value in days, Merge multiplies by 8 to calculate hours. - policy_type: - type: optional - docs: |- - The policy type of this time off balance. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - 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: hris_v3.yml - TimeOffRequestEmployee: - discriminated: false - docs: The employee requesting time off. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - TimeOffRequestApprover: - discriminated: false - docs: >- - The Merge ID of the employee with the ability to approve the time off - request. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - TimeOffRequestStatus: - discriminated: false - docs: |- - The status of this time off request. - - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - union: - - TimeOffStatusEnum - - string - source: - openapi: hris_v3.yml - inline: true - TimeOffRequestUnits: - discriminated: false - docs: >- - The measurement that the third-party integration uses to count time - requested. - - - * `HOURS` - HOURS - - * `DAYS` - DAYS - union: - - UnitsEnum - - string - source: - openapi: hris_v3.yml - inline: true - TimeOffRequestRequestType: - discriminated: false - docs: |- - The type of time off request. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - union: - - RequestTypeEnum - - string - source: - openapi: hris_v3.yml - inline: true - TimeOffRequest: - docs: >- - # The TimeOff Object - - ### Description - - The `TimeOff` object is used to represent all employees' Time Off entries. - - - ### Usage Example - - Fetch from the `LIST TimeOffs` endpoint and filter by `ID` to show all - time off requests. - properties: - employee: - type: optional - docs: The employee requesting time off. - approver: - type: optional - docs: >- - The Merge ID of the employee with the ability to approve the time off - request. - status: - type: optional - docs: |- - The status of this time off request. - - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - employee_note: - type: optional - docs: The employee note for this time off request. - units: - type: optional - docs: >- - The measurement that the third-party integration uses to count time - requested. - - - * `HOURS` - HOURS - - * `DAYS` - DAYS - amount: - type: optional - docs: The time off quantity measured by the prescribed “units”. - request_type: - type: optional - docs: |- - The type of time off request. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - start_time: - type: optional - docs: The day and time of the start of the time requested off. - end_time: - type: optional - docs: The day and time of the end of the time requested off. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: hris_v3.yml - TimeOffResponse: - properties: - model: TimeOff - warnings: list - errors: list - logs: optional> - source: - openapi: hris_v3.yml - TimeOffStatusEnum: - enum: - - REQUESTED - - APPROVED - - DECLINED - - CANCELLED - - DELETED - docs: |- - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - source: - openapi: hris_v3.yml - TimesheetEntryEmployee: - discriminated: false - docs: The employee the timesheet entry is for. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - TimesheetEntry: - docs: >- - # The Timesheet Entry Object - - ### Description - - The `Timesheet Entry` object is used to track coverage for hours worked by - an 'Employee'. - - - - ### Usage Example - - GET and POST Timesheet Entries - 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 - employee: - type: optional - docs: The employee the timesheet entry is for. - hours_worked: - type: optional - docs: The number of hours logged by the employee. - start_time: - type: optional - docs: The time at which the employee started work. - end_time: - type: optional - docs: The time at which the employee ended work. - 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: hris_v3.yml - TimesheetEntryRequestEmployee: - discriminated: false - docs: The employee the timesheet entry is for. - union: - - type: string - validation: - format: uuid - - Employee - source: - openapi: hris_v3.yml - inline: true - TimesheetEntryRequest: - docs: >- - # The Timesheet Entry Object - - ### Description - - The `Timesheet Entry` object is used to track coverage for hours worked by - an 'Employee'. - - - - ### Usage Example - - GET and POST Timesheet Entries - properties: - employee: - type: optional - docs: The employee the timesheet entry is for. - hours_worked: - type: optional - docs: The number of hours logged by the employee. - start_time: - type: optional - docs: The time at which the employee started work. - end_time: - type: optional - docs: The time at which the employee ended work. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: hris_v3.yml - TimesheetEntryResponse: - properties: - model: TimesheetEntry - warnings: list - errors: list - logs: optional> - source: - openapi: hris_v3.yml - UnitsEnum: - enum: - - HOURS - - DAYS - docs: |- - * `HOURS` - HOURS - * `DAYS` - DAYS - source: - openapi: hris_v3.yml - ValidationProblemSource: - properties: - pointer: string - source: - openapi: hris_v3.yml - WarningValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: hris_v3.yml - WebhookReceiver: - properties: - event: string - is_active: boolean - key: optional - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/accountDetails.yml b/.mock/definition/HRIS/accountDetails.yml deleted file mode 100644 index f392c0098..000000000 --- a/.mock/definition/HRIS/accountDetails.yml +++ /dev/null @@ -1,38 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /hris/v1/account-details - method: GET - auth: - - tokenAuth: [] - docs: Get details for a linked account. - source: - openapi: hris_v3.yml - response: - docs: '' - type: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/accountToken.yml b/.mock/definition/HRIS/accountToken.yml deleted file mode 100644 index 7f9116bb0..000000000 --- a/.mock/definition/HRIS/accountToken.yml +++ /dev/null @@ -1,47 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /hris/v1/account-token/{public_token} - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns the account token for the end user with the provided public - token. - source: - openapi: hris_v3.yml - path-parameters: - public_token: string - response: - docs: '' - type: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/asyncPassthrough.yml b/.mock/definition/HRIS/asyncPassthrough.yml deleted file mode 100644 index 0b6a9ea34..000000000 --- a/.mock/definition/HRIS/asyncPassthrough.yml +++ /dev/null @@ -1,74 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /hris/v1/async-passthrough - method: POST - auth: - - tokenAuth: [] - docs: >- - Asynchronously pull data from an endpoint not currently supported by - Merge. - source: - openapi: hris_v3.yml - request: - body: hrisRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: hrisRoot.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: /hris/v1/async-passthrough/{async_passthrough_receipt_id} - method: GET - auth: - - tokenAuth: [] - docs: Retrieves data from earlier async-passthrough POST request - source: - openapi: hris_v3.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: hris_v3.yml -types: - AsyncPassthroughRetrieveResponse: - discriminated: false - union: - - hrisRoot.RemoteResponse - - string - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/auditTrail.yml b/.mock/definition/HRIS/auditTrail.yml deleted file mode 100644 index 49c27548e..000000000 --- a/.mock/definition/HRIS/auditTrail.yml +++ /dev/null @@ -1,107 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/audit-trail - method: GET - auth: - - tokenAuth: [] - docs: Gets a list of audit trail events. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.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`, - `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: hrisRoot.PaginatedAuditLogEventList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - event_type: event_type - page_size: 1 - start_date: start_date - user_email: user_email - 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: hris_v3.yml diff --git a/.mock/definition/HRIS/availableActions.yml b/.mock/definition/HRIS/availableActions.yml deleted file mode 100644 index 0d065d20d..000000000 --- a/.mock/definition/HRIS/availableActions.yml +++ /dev/null @@ -1,52 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /hris/v1/available-actions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of models and actions available for an account. - source: - openapi: hris_v3.yml - response: - docs: '' - type: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/bankInfo.yml b/.mock/definition/HRIS/bankInfo.yml deleted file mode 100644 index 309396796..000000000 --- a/.mock/definition/HRIS/bankInfo.yml +++ /dev/null @@ -1,244 +0,0 @@ -types: - BankInfoListRequestAccountType: - enum: - - CHECKING - - SAVINGS - source: - openapi: hris_v3.yml - BankInfoListRequestOrderBy: - enum: - - value: '-remote_created_at' - name: RemoteCreatedAtDescending - - value: remote_created_at - name: RemoteCreatedAtAscending - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/bank-info - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `BankInfo` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: BankInfoListRequest - query-parameters: - account_type: - type: optional - docs: >- - If provided, will only return BankInfo's with this account type. - Options: ('SAVINGS', 'CHECKING') - - - * `SAVINGS` - SAVINGS - - * `CHECKING` - CHECKING - bank_name: - type: optional - docs: If provided, will only return BankInfo's with this bank name. - 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. - employee_id: - type: optional - docs: If provided, will only return bank accounts for this employee. - expand: - type: optional> - allow-multiple: true - 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. - order_by: - type: optional - docs: >- - Overrides the default ordering for this endpoint. Possible values - include: remote_created_at, -remote_created_at. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: hrisRoot.PaginatedBankInfoList - status-code: 200 - examples: - - query-parameters: - account_type: CHECKING - bank_name: bank_name - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - employee_id: employee_id - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - order_by: '-remote_created_at' - page_size: 1 - remote_fields: account_type - remote_id: remote_id - show_enum_origins: account_type - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: fd1e0fb5-8f92-4ec9-9f32-179cf732867d - remote_id: '123234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - account_number: '439291590' - routing_number: '089690059' - bank_name: Chase - account_type: SAVINGS - remote_created_at: '2021-12-06T10:11:26Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /bank-info - data: - - Varies by platform - retrieve: - path: /hris/v1/bank-info/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `BankInfo` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: BankInfoRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: hrisRoot.BankInfo - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: account_type - show_enum_origins: account_type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: fd1e0fb5-8f92-4ec9-9f32-179cf732867d - remote_id: '123234' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - account_number: '439291590' - routing_number: '089690059' - bank_name: Chase - account_type: SAVINGS - remote_created_at: '2021-12-06T10:11:26Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /bank-info - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/benefits.yml b/.mock/definition/HRIS/benefits.yml deleted file mode 100644 index 0d5618f24..000000000 --- a/.mock/definition/HRIS/benefits.yml +++ /dev/null @@ -1,188 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/benefits - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Benefit` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: BenefitsListRequest - 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. - employee_id: - type: optional - docs: >- - If provided, will return the benefits associated with the - employee. - expand: - type: optional> - allow-multiple: true - 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: hrisRoot.PaginatedBenefitList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - employee_id: employee_id - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 3fe5ae7a-f1ba-4529-b7af-84e86dc6d232 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - provider_name: Blue Shield of California - employee_contribution: 23.65 - company_contribution: 150 - start_date: '2020-11-15T00:59:25Z' - end_date: '2021-10-15T00:23:25Z' - remote_was_deleted: true - employer_benefit: 025fjlc6-6000-430a-848e-aafacbadf4fe - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /benefits - data: - - Varies by platform - retrieve: - path: /hris/v1/benefits/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Benefit` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: BenefitsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: hrisRoot.Benefit - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 3fe5ae7a-f1ba-4529-b7af-84e86dc6d232 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - provider_name: Blue Shield of California - employee_contribution: 23.65 - company_contribution: 150 - start_date: '2020-11-15T00:59:25Z' - end_date: '2021-10-15T00:23:25Z' - remote_was_deleted: true - employer_benefit: 025fjlc6-6000-430a-848e-aafacbadf4fe - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /benefits - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/companies.yml b/.mock/definition/HRIS/companies.yml deleted file mode 100644 index f9025b094..000000000 --- a/.mock/definition/HRIS/companies.yml +++ /dev/null @@ -1,168 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/companies - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Company` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: CompaniesListRequest - 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: hrisRoot.PaginatedCompanyList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 1b998423-db0a-4037-a4cf-f79c60cb67b3 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - legal_name: Waystar Royco, Inc. - display_name: Waystar Royco - eins: - - 12-3456789 - - 12-3451111 - - 11-0011000 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /companies - data: - - Varies by platform - retrieve: - path: /hris/v1/companies/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Company` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: CompaniesRetrieveRequest - 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: hrisRoot.Company - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 1b998423-db0a-4037-a4cf-f79c60cb67b3 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - legal_name: Waystar Royco, Inc. - display_name: Waystar Royco - eins: - - 12-3456789 - - 12-3451111 - - 11-0011000 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /companies - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/deleteAccount.yml b/.mock/definition/HRIS/deleteAccount.yml deleted file mode 100644 index 796d1449f..000000000 --- a/.mock/definition/HRIS/deleteAccount.yml +++ /dev/null @@ -1,17 +0,0 @@ -service: - auth: false - base-path: '' - endpoints: - delete: - path: /hris/v1/delete-account - method: POST - auth: - - tokenAuth: [] - docs: Delete a linked account. - source: - openapi: hris_v3.yml - examples: - - headers: - X-Account-Token: X-Account-Token - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/dependents.yml b/.mock/definition/HRIS/dependents.yml deleted file mode 100644 index bdae82935..000000000 --- a/.mock/definition/HRIS/dependents.yml +++ /dev/null @@ -1,190 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/dependents - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Dependent` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: DependentsListRequest - 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_sensitive_fields: - type: optional - docs: >- - Whether to include sensitive fields (such as social security - numbers) in the response. - 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: hrisRoot.PaginatedDependentList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_sensitive_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 025fjlc6-6000-430a-848e-aafacbadf4fe - remote_id: '19202940' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Greg - middle_name: A - last_name: Hirsch - relationship: CHILD - employee: 0958cbc6-6040-430a-848e-aafacbadf4ae - date_of_birth: '1990-11-10T00:00:00Z' - gender: MALE - phone_number: '+1234567890' - home_location: d2f972d0-2526-434b-9409-4c3b468e08f0 - is_student: true - ssn: '1234567890' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /dependent - data: - - Varies by platform - retrieve: - path: /hris/v1/dependents/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Dependent` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: DependentsRetrieveRequest - 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_sensitive_fields: - type: optional - docs: >- - Whether to include sensitive fields (such as social security - numbers) in the response. - 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: hrisRoot.Dependent - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_sensitive_fields: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 025fjlc6-6000-430a-848e-aafacbadf4fe - remote_id: '19202940' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - first_name: Greg - middle_name: A - last_name: Hirsch - relationship: CHILD - employee: 0958cbc6-6040-430a-848e-aafacbadf4ae - date_of_birth: '1990-11-10T00:00:00Z' - gender: MALE - phone_number: '+1234567890' - home_location: d2f972d0-2526-434b-9409-4c3b468e08f0 - is_student: true - ssn: '1234567890' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /dependent - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/employeePayrollRuns.yml b/.mock/definition/HRIS/employeePayrollRuns.yml deleted file mode 100644 index e16eb5651..000000000 --- a/.mock/definition/HRIS/employeePayrollRuns.yml +++ /dev/null @@ -1,327 +0,0 @@ -types: - EmployeePayrollRunsListRequestExpandItem: - enum: - - employee - - payroll_run - source: - openapi: hris_v3.yml - EmployeePayrollRunsRetrieveRequestExpandItem: - enum: - - employee - - payroll_run - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/employee-payroll-runs - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `EmployeePayrollRun` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: EmployeePayrollRunsListRequest - 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. - employee_id: - type: optional - docs: >- - If provided, will only return employee payroll runs for this - employee. - ended_after: - type: optional - docs: >- - If provided, will only return employee payroll runs ended after - this datetime. - ended_before: - type: optional - docs: >- - If provided, will only return employee payroll runs ended before - this datetime. - expand: - type: optional - allow-multiple: true - 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. - payroll_run_id: - type: optional - docs: >- - If provided, will only return employee payroll runs for this - employee. - remote_id: - type: optional - docs: The API provider's ID for the given object. - started_after: - type: optional - docs: >- - If provided, will only return employee payroll runs started after - this datetime. - started_before: - type: optional - docs: >- - If provided, will only return employee payroll runs started before - this datetime. - response: - docs: '' - type: hrisRoot.PaginatedEmployeePayrollRunList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - employee_id: employee_id - ended_after: '2024-01-15T09:30:00Z' - ended_before: '2024-01-15T09:30:00Z' - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - payroll_run_id: payroll_run_id - remote_id: remote_id - started_after: '2024-01-15T09:30:00Z' - started_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - payroll_run: payroll_run - gross_pay: 1342.67 - net_pay: 865.78 - start_date: '2020-11-08T00:00:00Z' - end_date: '2020-11-09T00:00:00Z' - check_date: '2020-11-10T00:00:00Z' - earnings: - - id: babbced6-3a81-4775-8da2-490dc6385259 - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - amount: 1002.34 - type: SALARY - - id: babbced6-3a81-4775-8da2-490dc6385259 - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - amount: 8342.34 - type: OVERTIME - deductions: - - id: 5fd439fc-1b64-4755-b275-64918936c365 - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: Social Security - employee_deduction: 34.54 - company_deduction: 78.78 - taxes: - - id: e3a825fd-c38d-4095-a717-df98c4cb9ebc - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: California State Income Tax - amount: 100.25 - employer_tax: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /employee-payroll - data: - - Varies by platform - retrieve: - path: /hris/v1/employee-payroll-runs/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `EmployeePayrollRun` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: EmployeePayrollRunsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: hrisRoot.EmployeePayrollRun - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - payroll_run: payroll_run - gross_pay: 1342.67 - net_pay: 865.78 - start_date: '2020-11-08T00:00:00Z' - end_date: '2020-11-09T00:00:00Z' - check_date: '2020-11-10T00:00:00Z' - earnings: - - id: babbced6-3a81-4775-8da2-490dc6385259 - remote_id: '52802' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - amount: 1002.34 - type: SALARY - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - - id: babbced6-3a81-4775-8da2-490dc6385259 - remote_id: '52802' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - amount: 8342.34 - type: OVERTIME - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - deductions: - - id: 5fd439fc-1b64-4755-b275-64918936c365 - remote_id: '93478612' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: Social Security - employee_deduction: 34.54 - company_deduction: 78.78 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /payroll-deduction - data: - - Varies by platform - taxes: - - id: e3a825fd-c38d-4095-a717-df98c4cb9ebc - remote_id: '26806834' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: California State Income Tax - amount: 100.25 - employer_tax: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /employee-payroll - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/employees.yml b/.mock/definition/HRIS/employees.yml deleted file mode 100644 index 545cc55c2..000000000 --- a/.mock/definition/HRIS/employees.yml +++ /dev/null @@ -1,831 +0,0 @@ -types: - EmployeesListRequestEmploymentStatus: - enum: - - ACTIVE - - INACTIVE - - PENDING - source: - openapi: hris_v3.yml - EmployeesListRequestExpandItem: - enum: - - company - - employments - - groups - - home_location - - manager - - pay_group - - team - - work_location - source: - openapi: hris_v3.yml - EmployeesListRequestRemoteFields: - enum: - - employment_status - - value: employment_status,ethnicity - name: EmploymentStatusEthnicity - - value: employment_status,ethnicity,gender - name: EmploymentStatusEthnicityGender - - value: employment_status,ethnicity,gender,marital_status - name: EmploymentStatusEthnicityGenderMaritalStatus - - value: employment_status,ethnicity,marital_status - name: EmploymentStatusEthnicityMaritalStatus - - value: employment_status,gender - name: EmploymentStatusGender - - value: employment_status,gender,marital_status - name: EmploymentStatusGenderMaritalStatus - - value: employment_status,marital_status - name: EmploymentStatusMaritalStatus - - ethnicity - - value: ethnicity,gender - name: EthnicityGender - - value: ethnicity,gender,marital_status - name: EthnicityGenderMaritalStatus - - value: ethnicity,marital_status - name: EthnicityMaritalStatus - - gender - - value: gender,marital_status - name: GenderMaritalStatus - - marital_status - source: - openapi: hris_v3.yml - EmployeesListRequestShowEnumOrigins: - enum: - - employment_status - - value: employment_status,ethnicity - name: EmploymentStatusEthnicity - - value: employment_status,ethnicity,gender - name: EmploymentStatusEthnicityGender - - value: employment_status,ethnicity,gender,marital_status - name: EmploymentStatusEthnicityGenderMaritalStatus - - value: employment_status,ethnicity,marital_status - name: EmploymentStatusEthnicityMaritalStatus - - value: employment_status,gender - name: EmploymentStatusGender - - value: employment_status,gender,marital_status - name: EmploymentStatusGenderMaritalStatus - - value: employment_status,marital_status - name: EmploymentStatusMaritalStatus - - ethnicity - - value: ethnicity,gender - name: EthnicityGender - - value: ethnicity,gender,marital_status - name: EthnicityGenderMaritalStatus - - value: ethnicity,marital_status - name: EthnicityMaritalStatus - - gender - - value: gender,marital_status - name: GenderMaritalStatus - - marital_status - source: - openapi: hris_v3.yml - EmployeesRetrieveRequestExpandItem: - enum: - - company - - employments - - groups - - home_location - - manager - - pay_group - - team - - work_location - source: - openapi: hris_v3.yml - EmployeesRetrieveRequestRemoteFields: - enum: - - employment_status - - value: employment_status,ethnicity - name: EmploymentStatusEthnicity - - value: employment_status,ethnicity,gender - name: EmploymentStatusEthnicityGender - - value: employment_status,ethnicity,gender,marital_status - name: EmploymentStatusEthnicityGenderMaritalStatus - - value: employment_status,ethnicity,marital_status - name: EmploymentStatusEthnicityMaritalStatus - - value: employment_status,gender - name: EmploymentStatusGender - - value: employment_status,gender,marital_status - name: EmploymentStatusGenderMaritalStatus - - value: employment_status,marital_status - name: EmploymentStatusMaritalStatus - - ethnicity - - value: ethnicity,gender - name: EthnicityGender - - value: ethnicity,gender,marital_status - name: EthnicityGenderMaritalStatus - - value: ethnicity,marital_status - name: EthnicityMaritalStatus - - gender - - value: gender,marital_status - name: GenderMaritalStatus - - marital_status - source: - openapi: hris_v3.yml - EmployeesRetrieveRequestShowEnumOrigins: - enum: - - employment_status - - value: employment_status,ethnicity - name: EmploymentStatusEthnicity - - value: employment_status,ethnicity,gender - name: EmploymentStatusEthnicityGender - - value: employment_status,ethnicity,gender,marital_status - name: EmploymentStatusEthnicityGenderMaritalStatus - - value: employment_status,ethnicity,marital_status - name: EmploymentStatusEthnicityMaritalStatus - - value: employment_status,gender - name: EmploymentStatusGender - - value: employment_status,gender,marital_status - name: EmploymentStatusGenderMaritalStatus - - value: employment_status,marital_status - name: EmploymentStatusMaritalStatus - - ethnicity - - value: ethnicity,gender - name: EthnicityGender - - value: ethnicity,gender,marital_status - name: EthnicityGenderMaritalStatus - - value: ethnicity,marital_status - name: EthnicityMaritalStatus - - gender - - value: gender,marital_status - name: GenderMaritalStatus - - marital_status - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/employees - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Employee` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: EmployeesListRequest - query-parameters: - company_id: - type: optional - docs: If provided, will only return employees for this company. - 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. - display_full_name: - type: optional - docs: If provided, will only return employees with this display name. - employment_status: - type: optional - docs: >- - If provided, will only return employees with this employment - status. - - - * `ACTIVE` - ACTIVE - - * `PENDING` - PENDING - - * `INACTIVE` - INACTIVE - employment_type: - type: optional - docs: >- - If provided, will only return employees that have an employment of - the specified employment_type. - expand: - type: optional - allow-multiple: true - docs: >- - Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - first_name: - type: optional - docs: If provided, will only return employees with this first name. - groups: - type: optional - docs: >- - If provided, will only return employees matching the group ids; - multiple groups can be separated by commas. - home_location_id: - type: optional - docs: If provided, will only return employees for this home location. - 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_sensitive_fields: - type: optional - docs: >- - Whether to include sensitive fields (such as social security - numbers) in the response. - 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). - job_title: - type: optional - docs: >- - If provided, will only return employees that have an employment of - the specified job_title. - last_name: - type: optional - docs: If provided, will only return employees with this last name. - manager_id: - type: optional - docs: If provided, will only return employees for this manager. - 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. - pay_group_id: - type: optional - docs: If provided, will only return employees for this pay group - personal_email: - type: optional - docs: If provided, will only return Employees with this personal email - validation: - format: email - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional - docs: >- - 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: - type: optional - docs: >- - If provided, will only return employees that started after this - datetime. - started_before: - type: optional - docs: >- - If provided, will only return employees that started before this - datetime. - team_id: - type: optional - docs: If provided, will only return employees for this team. - terminated_after: - type: optional - docs: >- - If provided, will only return employees that were terminated after - this datetime. - terminated_before: - type: optional - docs: >- - If provided, will only return employees that were terminated - before this datetime. - work_email: - type: optional - docs: If provided, will only return Employees with this work email - validation: - format: email - work_location_id: - type: optional - docs: If provided, will only return employees for this location. - response: - docs: '' - type: hrisRoot.PaginatedEmployeeList - status-code: 200 - examples: - - query-parameters: - company_id: company_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - display_full_name: display_full_name - employment_status: ACTIVE - employment_type: employment_type - first_name: first_name - groups: groups - home_location_id: home_location_id - include_deleted_data: true - include_remote_data: true - include_sensitive_fields: true - include_shell_data: true - job_title: job_title - last_name: last_name - manager_id: manager_id - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - pay_group_id: pay_group_id - personal_email: personal_email - remote_fields: employment_status - remote_id: remote_id - show_enum_origins: employment_status - started_after: '2024-01-15T09:30:00Z' - started_before: '2024-01-15T09:30:00Z' - team_id: team_id - terminated_after: '2024-01-15T09:30:00Z' - terminated_before: '2024-01-15T09:30:00Z' - work_email: work_email - work_location_id: work_location_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_number: '2' - company: company - first_name: Greg - last_name: Hirsch - preferred_name: Greg the egg - display_full_name: Cousin Greg Hirsch - username: cousingreg - groups: - - 21a54124-397f-494d-985e-3c5b330b8a68 - work_email: greg@merge.dev - personal_email: greg@gmail.com - mobile_phone_number: '+1234567890' - employments: - - 17a54124-287f-494d-965e-3c5b330c9a68 - home_location: home_location - work_location: work_location - manager: manager - pay_group: pay_group - ssn: '1234567890' - gender: MALE - ethnicity: AMERICAN_INDIAN_OR_ALASKA_NATIVE - marital_status: SINGLE - date_of_birth: '1990-11-10T00:00:00Z' - start_date: '2020-10-11T00:00:00Z' - remote_created_at: '2020-10-11T00:00:00Z' - employment_status: ACTIVE - termination_date: '2021-10-12T00:00:00Z' - avatar: http://alturl.com/h2h8m - custom_fields: - key: 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: /people - data: - - Varies by platform - create: - path: /hris/v1/employees - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Employee` object with the given values. - source: - openapi: hris_v3.yml - request: - name: EmployeeEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: hrisRoot.EmployeeRequest - content-type: application/json - response: - docs: '' - type: hrisRoot.EmployeeResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_number: '2' - company: company - first_name: Greg - last_name: Hirsch - preferred_name: Greg the egg - display_full_name: Cousin Greg Hirsch - username: cousingreg - groups: - - 21a54124-397f-494d-985e-3c5b330b8a68 - work_email: greg@merge.dev - personal_email: greg@gmail.com - mobile_phone_number: '+1234567890' - employments: - - 17a54124-287f-494d-965e-3c5b330c9a68 - home_location: home_location - work_location: work_location - manager: manager - pay_group: pay_group - ssn: '1234567890' - gender: MALE - ethnicity: AMERICAN_INDIAN_OR_ALASKA_NATIVE - marital_status: SINGLE - date_of_birth: '1990-11-10T00:00:00Z' - start_date: '2020-10-11T00:00:00Z' - remote_created_at: '2020-10-11T00:00:00Z' - employment_status: ACTIVE - termination_date: '2021-10-12T00:00:00Z' - avatar: http://alturl.com/h2h8m - custom_fields: - key: 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: /people - data: - - Varies by platform - 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 - retrieve: - path: /hris/v1/employees/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Employee` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: EmployeesRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_sensitive_fields: - type: optional - docs: >- - Whether to include sensitive fields (such as social security - numbers) in the response. - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: hrisRoot.Employee - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_sensitive_fields: true - include_shell_data: true - remote_fields: employment_status - show_enum_origins: employment_status - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee_number: '2' - company: company - first_name: Greg - last_name: Hirsch - preferred_name: Greg the egg - display_full_name: Cousin Greg Hirsch - username: cousingreg - groups: - - 21a54124-397f-494d-985e-3c5b330b8a68 - work_email: greg@merge.dev - personal_email: greg@gmail.com - mobile_phone_number: '+1234567890' - employments: - - 17a54124-287f-494d-965e-3c5b330c9a68 - home_location: home_location - work_location: work_location - manager: manager - pay_group: pay_group - ssn: '1234567890' - gender: MALE - ethnicity: AMERICAN_INDIAN_OR_ALASKA_NATIVE - marital_status: SINGLE - date_of_birth: '1990-11-10T00:00:00Z' - start_date: '2020-10-11T00:00:00Z' - remote_created_at: '2020-10-11T00:00:00Z' - employment_status: ACTIVE - termination_date: '2021-10-12T00:00:00Z' - avatar: http://alturl.com/h2h8m - custom_fields: - key: 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: /people - data: - - Varies by platform - ignoreCreate: - path: /hris/v1/employees/ignore/{model_id} - method: POST - auth: - - tokenAuth: [] - docs: >- - 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. - source: - openapi: hris_v3.yml - path-parameters: - model_id: string - request: - body: hrisRoot.IgnoreCommonModelRequest - content-type: application/json - examples: - - path-parameters: - model_id: model_id - headers: - X-Account-Token: X-Account-Token - request: - reason: GENERAL_CUSTOMER_REQUEST - metaPostRetrieve: - path: /hris/v1/employees/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Employee` POSTs. - source: - openapi: hris_v3.yml - response: - docs: '' - type: hrisRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/employerBenefits.yml b/.mock/definition/HRIS/employerBenefits.yml deleted file mode 100644 index db54627de..000000000 --- a/.mock/definition/HRIS/employerBenefits.yml +++ /dev/null @@ -1,162 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/employer-benefits - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `EmployerBenefit` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: EmployerBenefitsListRequest - 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: hrisRoot.PaginatedEmployerBenefitList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 025fjlc6-6000-430a-848e-aafacbadf4fele - remote_id: '19202939' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - benefit_plan_type: MEDICAL - name: Kaiser Permanente Medical Plan - description: HDHP Silver Plan - deduction_code: COL - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /hris/v1/employer-benefits/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `EmployerBenefit` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: EmployerBenefitsRetrieveRequest - 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: hrisRoot.EmployerBenefit - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 025fjlc6-6000-430a-848e-aafacbadf4fele - remote_id: '19202939' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - benefit_plan_type: MEDICAL - name: Kaiser Permanente Medical Plan - description: HDHP Silver Plan - deduction_code: COL - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/employments.yml b/.mock/definition/HRIS/employments.yml deleted file mode 100644 index 4fdd65f29..000000000 --- a/.mock/definition/HRIS/employments.yml +++ /dev/null @@ -1,363 +0,0 @@ -types: - EmploymentsListRequestExpandItem: - enum: - - employee - - pay_group - source: - openapi: hris_v3.yml - EmploymentsListRequestOrderBy: - enum: - - value: '-effective_date' - name: EffectiveDateDescending - - value: effective_date - name: EffectiveDateAscending - source: - openapi: hris_v3.yml - EmploymentsListRequestRemoteFields: - enum: - - employment_type - - value: employment_type,flsa_status - name: EmploymentTypeFlsaStatus - - value: employment_type,flsa_status,pay_frequency - name: EmploymentTypeFlsaStatusPayFrequency - - value: employment_type,flsa_status,pay_frequency,pay_period - name: EmploymentTypeFlsaStatusPayFrequencyPayPeriod - - value: employment_type,flsa_status,pay_period - name: EmploymentTypeFlsaStatusPayPeriod - - value: employment_type,pay_frequency - name: EmploymentTypePayFrequency - - value: employment_type,pay_frequency,pay_period - name: EmploymentTypePayFrequencyPayPeriod - - value: employment_type,pay_period - name: EmploymentTypePayPeriod - - flsa_status - - value: flsa_status,pay_frequency - name: FlsaStatusPayFrequency - - value: flsa_status,pay_frequency,pay_period - name: FlsaStatusPayFrequencyPayPeriod - - value: flsa_status,pay_period - name: FlsaStatusPayPeriod - - pay_frequency - - value: pay_frequency,pay_period - name: PayFrequencyPayPeriod - - pay_period - source: - openapi: hris_v3.yml - EmploymentsListRequestShowEnumOrigins: - enum: - - employment_type - - value: employment_type,flsa_status - name: EmploymentTypeFlsaStatus - - value: employment_type,flsa_status,pay_frequency - name: EmploymentTypeFlsaStatusPayFrequency - - value: employment_type,flsa_status,pay_frequency,pay_period - name: EmploymentTypeFlsaStatusPayFrequencyPayPeriod - - value: employment_type,flsa_status,pay_period - name: EmploymentTypeFlsaStatusPayPeriod - - value: employment_type,pay_frequency - name: EmploymentTypePayFrequency - - value: employment_type,pay_frequency,pay_period - name: EmploymentTypePayFrequencyPayPeriod - - value: employment_type,pay_period - name: EmploymentTypePayPeriod - - flsa_status - - value: flsa_status,pay_frequency - name: FlsaStatusPayFrequency - - value: flsa_status,pay_frequency,pay_period - name: FlsaStatusPayFrequencyPayPeriod - - value: flsa_status,pay_period - name: FlsaStatusPayPeriod - - pay_frequency - - value: pay_frequency,pay_period - name: PayFrequencyPayPeriod - - pay_period - source: - openapi: hris_v3.yml - EmploymentsRetrieveRequestExpandItem: - enum: - - employee - - pay_group - source: - openapi: hris_v3.yml - EmploymentsRetrieveRequestRemoteFields: - enum: - - employment_type - - value: employment_type,flsa_status - name: EmploymentTypeFlsaStatus - - value: employment_type,flsa_status,pay_frequency - name: EmploymentTypeFlsaStatusPayFrequency - - value: employment_type,flsa_status,pay_frequency,pay_period - name: EmploymentTypeFlsaStatusPayFrequencyPayPeriod - - value: employment_type,flsa_status,pay_period - name: EmploymentTypeFlsaStatusPayPeriod - - value: employment_type,pay_frequency - name: EmploymentTypePayFrequency - - value: employment_type,pay_frequency,pay_period - name: EmploymentTypePayFrequencyPayPeriod - - value: employment_type,pay_period - name: EmploymentTypePayPeriod - - flsa_status - - value: flsa_status,pay_frequency - name: FlsaStatusPayFrequency - - value: flsa_status,pay_frequency,pay_period - name: FlsaStatusPayFrequencyPayPeriod - - value: flsa_status,pay_period - name: FlsaStatusPayPeriod - - pay_frequency - - value: pay_frequency,pay_period - name: PayFrequencyPayPeriod - - pay_period - source: - openapi: hris_v3.yml - EmploymentsRetrieveRequestShowEnumOrigins: - enum: - - employment_type - - value: employment_type,flsa_status - name: EmploymentTypeFlsaStatus - - value: employment_type,flsa_status,pay_frequency - name: EmploymentTypeFlsaStatusPayFrequency - - value: employment_type,flsa_status,pay_frequency,pay_period - name: EmploymentTypeFlsaStatusPayFrequencyPayPeriod - - value: employment_type,flsa_status,pay_period - name: EmploymentTypeFlsaStatusPayPeriod - - value: employment_type,pay_frequency - name: EmploymentTypePayFrequency - - value: employment_type,pay_frequency,pay_period - name: EmploymentTypePayFrequencyPayPeriod - - value: employment_type,pay_period - name: EmploymentTypePayPeriod - - flsa_status - - value: flsa_status,pay_frequency - name: FlsaStatusPayFrequency - - value: flsa_status,pay_frequency,pay_period - name: FlsaStatusPayFrequencyPayPeriod - - value: flsa_status,pay_period - name: FlsaStatusPayPeriod - - pay_frequency - - value: pay_frequency,pay_period - name: PayFrequencyPayPeriod - - pay_period - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/employments - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Employment` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: EmploymentsListRequest - 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. - employee_id: - type: optional - docs: If provided, will only return employments for this employee. - expand: - type: optional - allow-multiple: true - 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. - order_by: - type: optional - docs: >- - Overrides the default ordering for this endpoint. Possible values - include: effective_date, -effective_date. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: hrisRoot.PaginatedEmploymentList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - employee_id: employee_id - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - order_by: '-effective_date' - page_size: 1 - remote_fields: employment_type - remote_id: remote_id - show_enum_origins: employment_type - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 65d8ffd0-211b-4ba4-b85a-fbe2ce220982 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - job_title: Executive Assistant to Tom Wambsgans - pay_rate: 1.1 - pay_period: HOUR - pay_frequency: WEEKLY - pay_currency: XUA - pay_group: pay_group - flsa_status: EXEMPT - effective_date: '2023-10-06T18:42:34Z' - employment_type: FULL_TIME - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /jobs - data: - - Varies by platform - retrieve: - path: /hris/v1/employments/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Employment` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: EmploymentsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: hrisRoot.Employment - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: employment_type - show_enum_origins: employment_type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 65d8ffd0-211b-4ba4-b85a-fbe2ce220982 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - job_title: Executive Assistant to Tom Wambsgans - pay_rate: 1.1 - pay_period: HOUR - pay_frequency: WEEKLY - pay_currency: XUA - pay_group: pay_group - flsa_status: EXEMPT - effective_date: '2023-10-06T18:42:34Z' - employment_type: FULL_TIME - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /jobs - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/fieldMapping.yml b/.mock/definition/HRIS/fieldMapping.yml deleted file mode 100644 index 995d6404c..000000000 --- a/.mock/definition/HRIS/fieldMapping.yml +++ /dev/null @@ -1,911 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - field_mappings_retrieve: - path: /hris/v1/field-mappings - method: GET - auth: - - tokenAuth: [] - 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: hris_v3.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: hrisRoot.FieldMappingApiInstanceResponse - status-code: 200 - examples: - - query-parameters: - exclude_remote_field_metadata: true - headers: - X-Account-Token: X-Account-Token - response: - body: - Benefit: - - 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 - EmployerBenefit: - - 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 - Company: - - 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 - EmployeePayrollRun: - - 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 - Employee: - - 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 - Employment: - - 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 - Location: - - 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 - PayrollRun: - - 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 - Team: - - 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 - TimeOff: - - 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 - TimeOffBalance: - - 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 - BankInfo: - - 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 - PayGroup: - - 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 - 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 - Dependent: - - 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 - TimesheetEntry: - - 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 - field_mappings_create: - path: /hris/v1/field-mappings - method: POST - auth: - - tokenAuth: [] - 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: hris_v3.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 - content-type: application/json - response: - docs: '' - type: hrisRoot.FieldMappingInstanceResponse - status-code: 201 - examples: - - query-parameters: - exclude_remote_field_metadata: true - 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 - 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: /hris/v1/field-mappings/{field_mapping_id} - method: DELETE - auth: - - tokenAuth: [] - 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: hris_v3.yml - path-parameters: - field_mapping_id: string - response: - docs: '' - type: hrisRoot.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 - 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: /hris/v1/field-mappings/{field_mapping_id} - method: PATCH - auth: - - tokenAuth: [] - 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: hris_v3.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 - content-type: application/json - response: - docs: '' - type: hrisRoot.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 - 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: /hris/v1/remote-fields - method: GET - auth: - - tokenAuth: [] - 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: hris_v3.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: hrisRoot.RemoteFieldApiResponse - status-code: 200 - examples: - - query-parameters: - common_models: common_models - include_example_values: include_example_values - headers: - X-Account-Token: X-Account-Token - response: - body: - Benefit: - - 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 - EmployerBenefit: - - 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 - Company: - - 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 - EmployeePayrollRun: - - 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 - Employee: - - 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 - Employment: - - 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 - Location: - - 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 - PayrollRun: - - 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 - Team: - - 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 - TimeOff: - - 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 - TimeOffBalance: - - 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 - BankInfo: - - 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 - PayGroup: - - 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 - Dependent: - - 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 - TimesheetEntry: - - 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: /hris/v1/target-fields - method: GET - auth: - - tokenAuth: [] - 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: hris_v3.yml - response: - docs: '' - type: hrisRoot.ExternalTargetFieldApiResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - Benefit: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - EmployerBenefit: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Company: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - EmployeePayrollRun: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Employee: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Employment: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Location: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - PayrollRun: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Team: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - TimeOff: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - TimeOffBalance: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - BankInfo: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - PayGroup: - - 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 - Dependent: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - TimesheetEntry: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/forceResync.yml b/.mock/definition/HRIS/forceResync.yml deleted file mode 100644 index bd0a3857e..000000000 --- a/.mock/definition/HRIS/forceResync.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - sync_status_resync_create: - path: /hris/v1/sync-status/resync - method: POST - auth: - - tokenAuth: [] - 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: hris_v3.yml - response: - docs: '' - type: list - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - - model_name: Employee - model_id: hris.Employee - 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: hris_v3.yml diff --git a/.mock/definition/HRIS/generateKey.yml b/.mock/definition/HRIS/generateKey.yml deleted file mode 100644 index 8cb621dbf..000000000 --- a/.mock/definition/HRIS/generateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /hris/v1/generate-key - method: POST - auth: - - tokenAuth: [] - docs: Create a remote key. - source: - openapi: hris_v3.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: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/groups.yml b/.mock/definition/HRIS/groups.yml deleted file mode 100644 index 9693030f0..000000000 --- a/.mock/definition/HRIS/groups.yml +++ /dev/null @@ -1,208 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/groups - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Group` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.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. - 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). - is_commonly_used_as_team: - type: optional - docs: >- - 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. - 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. - names: - type: optional - docs: >- - If provided, will only return groups with these names. Multiple - values can be separated by commas. - page_size: - type: optional - docs: Number of results to return per page. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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: - type: optional - docs: >- - If provided, will only return groups of these types. Multiple - values can be separated by commas. - response: - docs: '' - type: hrisRoot.PaginatedGroupList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_commonly_used_as_team: is_commonly_used_as_team - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - names: names - page_size: 1 - remote_fields: type - remote_id: remote_id - show_enum_origins: type - types: types - 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' - parent_group: 2ef51b11-2c4e-4b02-8d1d-50592d9e96ef - name: COST_CENTER_US - type: TEAM - is_commonly_used_as_team: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /group - data: - - Varies by platform - retrieve: - path: /hris/v1/groups/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Group` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: GroupsRetrieveRequest - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: hrisRoot.Group - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: type - show_enum_origins: type - 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' - parent_group: 2ef51b11-2c4e-4b02-8d1d-50592d9e96ef - name: COST_CENTER_US - type: TEAM - is_commonly_used_as_team: true - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /group - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/issues.yml b/.mock/definition/HRIS/issues.yml deleted file mode 100644 index fb74883d4..000000000 --- a/.mock/definition/HRIS/issues.yml +++ /dev/null @@ -1,154 +0,0 @@ -types: - IssuesListRequestStatus: - enum: - - ONGOING - - RESOLVED - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/issues - method: GET - auth: - - tokenAuth: [] - docs: Gets all issues for Organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.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: hrisRoot.PaginatedIssueList - status-code: 200 - examples: - - query-parameters: - account_token: account_token - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - end_user_organization_name: end_user_organization_name - first_incident_time_after: '2024-01-15T09:30:00Z' - first_incident_time_before: '2024-01-15T09:30:00Z' - include_muted: include_muted - integration_name: integration_name - last_incident_time_after: '2024-01-15T09:30:00Z' - last_incident_time_before: '2024-01-15T09:30:00Z' - linked_account_id: linked_account_id - page_size: 1 - start_date: start_date - status: ONGOING - 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: /hris/v1/issues/{id} - method: GET - auth: - - tokenAuth: [] - docs: Get a specific issue. - source: - openapi: hris_v3.yml - path-parameters: - id: string - response: - docs: '' - type: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/linkToken.yml b/.mock/definition/HRIS/linkToken.yml deleted file mode 100644 index f589adda2..000000000 --- a/.mock/definition/HRIS/linkToken.yml +++ /dev/null @@ -1,155 +0,0 @@ -imports: - hrisRoot: __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: - - hrisRoot.LanguageEnum - - string - source: - openapi: hris_v3.yml - inline: true -service: - auth: false - base-path: '' - endpoints: - create: - path: /hris/v1/link-token - method: POST - auth: - - tokenAuth: [] - docs: Creates a link token to be used when linking a new end user. - source: - openapi: hris_v3.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: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/linkedAccounts.yml b/.mock/definition/HRIS/linkedAccounts.yml deleted file mode 100644 index a5afc183a..000000000 --- a/.mock/definition/HRIS/linkedAccounts.yml +++ /dev/null @@ -1,169 +0,0 @@ -types: - LinkedAccountsListRequestCategory: - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/linked-accounts - method: GET - auth: - - tokenAuth: [] - docs: List linked accounts for your organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: LinkedAccountsListRequest - query-parameters: - category: - type: optional - docs: >- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, - `mktg`, `ticketing` - - - * `hris` - hris - - * `ats` - ats - - * `accounting` - accounting - - * `ticketing` - ticketing - - * `crm` - crm - - * `mktg` - mktg - - * `filestorage` - filestorage - 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: hrisRoot.PaginatedAccountDetailsAndActionsList - status-code: 200 - examples: - - query-parameters: - category: accounting - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - 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: true - integration_name: integration_name - is_test_account: is_test_account - page_size: 1 - status: status - 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' - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/locations.yml b/.mock/definition/HRIS/locations.yml deleted file mode 100644 index 58bafc923..000000000 --- a/.mock/definition/HRIS/locations.yml +++ /dev/null @@ -1,245 +0,0 @@ -types: - LocationsListRequestLocationType: - enum: - - HOME - - WORK - source: - openapi: hris_v3.yml - LocationsListRequestRemoteFields: - enum: - - country - - value: country,location_type - name: CountryLocationType - - location_type - source: - openapi: hris_v3.yml - LocationsListRequestShowEnumOrigins: - enum: - - country - - value: country,location_type - name: CountryLocationType - - location_type - source: - openapi: hris_v3.yml - LocationsRetrieveRequestRemoteFields: - enum: - - country - - value: country,location_type - name: CountryLocationType - - location_type - source: - openapi: hris_v3.yml - LocationsRetrieveRequestShowEnumOrigins: - enum: - - country - - value: country,location_type - name: CountryLocationType - - location_type - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/locations - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Location` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: LocationsListRequest - 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). - location_type: - type: optional - docs: |- - If provided, will only return locations with this location_type - - * `HOME` - HOME - * `WORK` - WORK - 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_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: hrisRoot.PaginatedLocationList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - location_type: HOME - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: country - remote_id: remote_id - show_enum_origins: country - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: f5e6a151-f44e-449a-afb1-8fd781905958 - remote_id: '93018402' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: NYC Office - phone_number: '+1111111111' - street_1: 2920 Broadway - street_2: 2nd Floor - city: 'New York ' - state: NY - zip_code: '10027' - country: AF - location_type: HOME - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /locations - data: - - Varies by platform - retrieve: - path: /hris/v1/locations/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Location` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: LocationsRetrieveRequest - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: hrisRoot.Location - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: country - show_enum_origins: country - headers: - X-Account-Token: X-Account-Token - response: - body: - id: f5e6a151-f44e-449a-afb1-8fd781905958 - remote_id: '93018402' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: NYC Office - phone_number: '+1111111111' - street_1: 2920 Broadway - street_2: 2nd Floor - city: 'New York ' - state: NY - zip_code: '10027' - country: AF - location_type: HOME - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /locations - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/passthrough.yml b/.mock/definition/HRIS/passthrough.yml deleted file mode 100644 index d3e6c8607..000000000 --- a/.mock/definition/HRIS/passthrough.yml +++ /dev/null @@ -1,42 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /hris/v1/passthrough - method: POST - auth: - - tokenAuth: [] - docs: Pull data from an endpoint not currently supported by Merge. - source: - openapi: hris_v3.yml - request: - body: hrisRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/payGroups.yml b/.mock/definition/HRIS/payGroups.yml deleted file mode 100644 index 25fa26504..000000000 --- a/.mock/definition/HRIS/payGroups.yml +++ /dev/null @@ -1,158 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/pay-groups - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `PayGroup` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: PayGroupsListRequest - 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: hrisRoot.PaginatedPayGroupList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: fd1e0fb5-8f92-4ec9-9f32-179cf732867d - remote_id: '800293' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - pay_group_name: contractor - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /pay-group - data: - - Varies by platform - retrieve: - path: /hris/v1/pay-groups/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `PayGroup` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: PayGroupsRetrieveRequest - 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: hrisRoot.PayGroup - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: fd1e0fb5-8f92-4ec9-9f32-179cf732867d - remote_id: '800293' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - pay_group_name: contractor - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /pay-group - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/payrollRuns.yml b/.mock/definition/HRIS/payrollRuns.yml deleted file mode 100644 index 2ee23ce83..000000000 --- a/.mock/definition/HRIS/payrollRuns.yml +++ /dev/null @@ -1,274 +0,0 @@ -types: - PayrollRunsListRequestRemoteFields: - enum: - - run_state - - value: run_state,run_type - name: RunStateRunType - - run_type - source: - openapi: hris_v3.yml - PayrollRunsListRequestRunType: - enum: - - CORRECTION - - OFF_CYCLE - - REGULAR - - SIGN_ON_BONUS - - TERMINATION - source: - openapi: hris_v3.yml - PayrollRunsListRequestShowEnumOrigins: - enum: - - run_state - - value: run_state,run_type - name: RunStateRunType - - run_type - source: - openapi: hris_v3.yml - PayrollRunsRetrieveRequestRemoteFields: - enum: - - run_state - - value: run_state,run_type - name: RunStateRunType - - run_type - source: - openapi: hris_v3.yml - PayrollRunsRetrieveRequestShowEnumOrigins: - enum: - - run_state - - value: run_state,run_type - name: RunStateRunType - - run_type - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/payroll-runs - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `PayrollRun` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: PayrollRunsListRequest - 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. - ended_after: - type: optional - docs: >- - If provided, will only return payroll runs ended after this - datetime. - ended_before: - type: optional - docs: >- - If provided, will only return payroll runs ended before this - datetime. - 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_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - run_type: - type: optional - docs: >- - If provided, will only return PayrollRun's with this status. - Options: ('REGULAR', 'OFF_CYCLE', 'CORRECTION', 'TERMINATION', - 'SIGN_ON_BONUS') - - - * `REGULAR` - REGULAR - - * `OFF_CYCLE` - OFF_CYCLE - - * `CORRECTION` - CORRECTION - - * `TERMINATION` - TERMINATION - - * `SIGN_ON_BONUS` - SIGN_ON_BONUS - show_enum_origins: - type: optional - docs: >- - 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: - type: optional - docs: >- - If provided, will only return payroll runs started after this - datetime. - started_before: - type: optional - docs: >- - If provided, will only return payroll runs started before this - datetime. - response: - docs: '' - type: hrisRoot.PaginatedPayrollRunList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - ended_after: '2024-01-15T09:30:00Z' - ended_before: '2024-01-15T09:30:00Z' - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: run_state - remote_id: remote_id - run_type: CORRECTION - show_enum_origins: run_state - started_after: '2024-01-15T09:30:00Z' - started_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 37336947-b3d4-4a4c-a310-ab6ab510e079 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - run_state: PAID - run_type: REGULAR - start_date: '2020-11-08T00:00:00Z' - end_date: '2020-11-15T00:00:00Z' - check_date: '2020-11-15T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /payroll - data: - - Varies by platform - retrieve: - path: /hris/v1/payroll-runs/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `PayrollRun` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: PayrollRunsRetrieveRequest - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: hrisRoot.PayrollRun - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: run_state - show_enum_origins: run_state - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 37336947-b3d4-4a4c-a310-ab6ab510e079 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - run_state: PAID - run_type: REGULAR - start_date: '2020-11-08T00:00:00Z' - end_date: '2020-11-15T00:00:00Z' - check_date: '2020-11-15T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /payroll - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/regenerateKey.yml b/.mock/definition/HRIS/regenerateKey.yml deleted file mode 100644 index 041f97c44..000000000 --- a/.mock/definition/HRIS/regenerateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /hris/v1/regenerate-key - method: POST - auth: - - tokenAuth: [] - docs: Exchange remote keys. - source: - openapi: hris_v3.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: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/scopes.yml b/.mock/definition/HRIS/scopes.yml deleted file mode 100644 index 24139c3f3..000000000 --- a/.mock/definition/HRIS/scopes.yml +++ /dev/null @@ -1,167 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - default_scopes_retrieve: - path: /hris/v1/default-scopes - method: GET - auth: - - tokenAuth: [] - 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: hris_v3.yml - response: - docs: '' - type: hrisRoot.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: /hris/v1/linked-account-scopes - method: GET - auth: - - tokenAuth: [] - 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: hris_v3.yml - response: - docs: '' - type: hrisRoot.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: /hris/v1/linked-account-scopes - method: POST - auth: - - tokenAuth: [] - 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: hris_v3.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: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/HRIS/syncStatus.yml b/.mock/definition/HRIS/syncStatus.yml deleted file mode 100644 index 8f676be29..000000000 --- a/.mock/definition/HRIS/syncStatus.yml +++ /dev/null @@ -1,64 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/sync-status - method: GET - auth: - - tokenAuth: [] - 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). - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.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: hrisRoot.PaginatedSyncStatusList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - model_name: Employee - model_id: hris.Employee - 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: hris_v3.yml diff --git a/.mock/definition/HRIS/teams.yml b/.mock/definition/HRIS/teams.yml deleted file mode 100644 index fce94aed9..000000000 --- a/.mock/definition/HRIS/teams.yml +++ /dev/null @@ -1,176 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/teams - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Team` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: TeamsListRequest - 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> - allow-multiple: true - 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_team_id: - type: optional - docs: If provided, will only return teams with this parent team. - remote_id: - type: optional - docs: The API provider's ID for the given object. - response: - docs: '' - type: hrisRoot.PaginatedTeamList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - parent_team_id: parent_team_id - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 13a72919-9fae-4f54-81ca-ddfd8712a1ba - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Engineering - parent_team: parent_team - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /teams - data: - - Varies by platform - retrieve: - path: /hris/v1/teams/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Team` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: TeamsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: hrisRoot.Team - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 13a72919-9fae-4f54-81ca-ddfd8712a1ba - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Engineering - parent_team: parent_team - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /teams - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/timeOff.yml b/.mock/definition/HRIS/timeOff.yml deleted file mode 100644 index 4b024ba98..000000000 --- a/.mock/definition/HRIS/timeOff.yml +++ /dev/null @@ -1,638 +0,0 @@ -types: - TimeOffListRequestExpandItem: - enum: - - approver - - employee - source: - openapi: hris_v3.yml - TimeOffListRequestRemoteFields: - enum: - - request_type - - value: request_type,status - name: RequestTypeStatus - - value: request_type,status,units - name: RequestTypeStatusUnits - - value: request_type,units - name: RequestTypeUnits - - status - - value: status,units - name: StatusUnits - - units - source: - openapi: hris_v3.yml - TimeOffListRequestRequestType: - enum: - - BEREAVEMENT - - JURY_DUTY - - PERSONAL - - SICK - - VACATION - - VOLUNTEER - source: - openapi: hris_v3.yml - TimeOffListRequestShowEnumOrigins: - enum: - - request_type - - value: request_type,status - name: RequestTypeStatus - - value: request_type,status,units - name: RequestTypeStatusUnits - - value: request_type,units - name: RequestTypeUnits - - status - - value: status,units - name: StatusUnits - - units - source: - openapi: hris_v3.yml - TimeOffListRequestStatus: - enum: - - APPROVED - - CANCELLED - - DECLINED - - DELETED - - REQUESTED - source: - openapi: hris_v3.yml - TimeOffRetrieveRequestExpandItem: - enum: - - approver - - employee - source: - openapi: hris_v3.yml - TimeOffRetrieveRequestRemoteFields: - enum: - - request_type - - value: request_type,status - name: RequestTypeStatus - - value: request_type,status,units - name: RequestTypeStatusUnits - - value: request_type,units - name: RequestTypeUnits - - status - - value: status,units - name: StatusUnits - - units - source: - openapi: hris_v3.yml - TimeOffRetrieveRequestShowEnumOrigins: - enum: - - request_type - - value: request_type,status - name: RequestTypeStatus - - value: request_type,status,units - name: RequestTypeStatusUnits - - value: request_type,units - name: RequestTypeUnits - - status - - value: status,units - name: StatusUnits - - units - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/time-off - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `TimeOff` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: TimeOffListRequest - query-parameters: - approver_id: - type: optional - docs: If provided, will only return time off for this approver. - 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. - employee_id: - type: optional - docs: If provided, will only return time off for this employee. - ended_after: - type: optional - docs: >- - If provided, will only return employees that ended after this - datetime. - ended_before: - type: optional - docs: >- - If provided, will only return time-offs that ended before this - datetime. - expand: - type: optional - allow-multiple: true - 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_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - request_type: - type: optional - docs: >- - 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 - show_enum_origins: - type: optional - docs: >- - 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: - type: optional - docs: >- - If provided, will only return time-offs that started after this - datetime. - started_before: - type: optional - docs: >- - If provided, will only return time-offs that started before this - datetime. - status: - type: optional - docs: >- - 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 - response: - docs: '' - type: hrisRoot.PaginatedTimeOffList - status-code: 200 - examples: - - query-parameters: - approver_id: approver_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - employee_id: employee_id - ended_after: '2024-01-15T09:30:00Z' - ended_before: '2024-01-15T09:30:00Z' - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_fields: request_type - remote_id: remote_id - request_type: BEREAVEMENT - show_enum_origins: request_type - started_after: '2024-01-15T09:30:00Z' - started_before: '2024-01-15T09:30:00Z' - status: APPROVED - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - approver: approver - status: REQUESTED - employee_note: Moving into the new apartment Kendall Roy gave me! - units: HOURS - amount: 3 - request_type: VACATION - start_time: '2020-11-10T00:00:00Z' - end_time: '2020-11-17T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leave - data: - - Varies by platform - create: - path: /hris/v1/time-off - method: POST - auth: - - tokenAuth: [] - docs: Creates a `TimeOff` object with the given values. - source: - openapi: hris_v3.yml - request: - name: TimeOffEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: hrisRoot.TimeOffRequest - content-type: application/json - response: - docs: '' - type: hrisRoot.TimeOffResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - approver: approver - status: REQUESTED - employee_note: Moving into the new apartment Kendall Roy gave me! - units: HOURS - amount: 3 - request_type: VACATION - start_time: '2020-11-10T00:00:00Z' - end_time: '2020-11-17T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leave - data: - - Varies by platform - 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 - retrieve: - path: /hris/v1/time-off/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `TimeOff` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: TimeOffRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: hrisRoot.TimeOff - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: request_type - show_enum_origins: request_type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - approver: approver - status: REQUESTED - employee_note: Moving into the new apartment Kendall Roy gave me! - units: HOURS - amount: 3 - request_type: VACATION - start_time: '2020-11-10T00:00:00Z' - end_time: '2020-11-17T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leave - data: - - Varies by platform - metaPostRetrieve: - path: /hris/v1/time-off/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `TimeOff` POSTs. - source: - openapi: hris_v3.yml - response: - docs: '' - type: hrisRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/timeOffBalances.yml b/.mock/definition/HRIS/timeOffBalances.yml deleted file mode 100644 index 0fec21a1c..000000000 --- a/.mock/definition/HRIS/timeOffBalances.yml +++ /dev/null @@ -1,235 +0,0 @@ -types: - TimeOffBalancesListRequestPolicyType: - enum: - - BEREAVEMENT - - JURY_DUTY - - PERSONAL - - SICK - - VACATION - - VOLUNTEER - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/time-off-balances - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `TimeOffBalance` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: TimeOffBalancesListRequest - 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. - employee_id: - type: optional - docs: If provided, will only return time off balances for this employee. - expand: - type: optional> - allow-multiple: true - 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. - policy_type: - type: optional - docs: >- - 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: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: hrisRoot.PaginatedTimeOffBalanceList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - employee_id: employee_id - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - policy_type: BEREAVEMENT - remote_fields: policy_type - remote_id: remote_id - show_enum_origins: policy_type - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - balance: 1.1 - used: 1.1 - policy_type: VACATION - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leave - data: - - Varies by platform - retrieve: - path: /hris/v1/time-off-balances/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `TimeOffBalance` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: TimeOffBalancesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: hrisRoot.TimeOffBalance - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: policy_type - show_enum_origins: policy_type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - balance: 1.1 - used: 1.1 - policy_type: VACATION - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /leave - data: - - Varies by platform - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/timesheetEntries.yml b/.mock/definition/HRIS/timesheetEntries.yml deleted file mode 100644 index 6c7fb8335..000000000 --- a/.mock/definition/HRIS/timesheetEntries.yml +++ /dev/null @@ -1,481 +0,0 @@ -types: - TimesheetEntriesListRequestOrderBy: - enum: - - value: '-start_time' - name: StartTimeDescending - - value: start_time - name: StartTimeAscending - source: - openapi: hris_v3.yml -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/timesheet-entries - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `TimesheetEntry` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: hris_v3.yml - request: - name: TimesheetEntriesListRequest - 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. - employee_id: - type: optional - docs: If provided, will only return timesheet entries for this employee. - ended_after: - type: optional - docs: >- - If provided, will only return timesheet entries ended after this - datetime. - ended_before: - type: optional - docs: >- - If provided, will only return timesheet entries ended before this - datetime. - expand: - type: optional> - allow-multiple: true - 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. - order_by: - type: optional - docs: >- - Overrides the default ordering for this endpoint. Possible values - include: start_time, -start_time. - 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. - started_after: - type: optional - docs: >- - If provided, will only return timesheet entries started after this - datetime. - started_before: - type: optional - docs: >- - If provided, will only return timesheet entries started before - this datetime. - response: - docs: '' - type: hrisRoot.PaginatedTimesheetEntryList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - employee_id: employee_id - ended_after: '2024-01-15T09:30:00Z' - ended_before: '2024-01-15T09:30:00Z' - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - order_by: '-start_time' - page_size: 1 - remote_id: remote_id - started_after: '2024-01-15T09:30:00Z' - started_before: '2024-01-15T09:30:00Z' - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - hours_worked: 10 - start_time: '2020-11-10T00:00:00Z' - end_time: '2020-11-10T00:10:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /dependent - data: - - Varies by platform - create: - path: /hris/v1/timesheet-entries - method: POST - auth: - - tokenAuth: [] - docs: Creates a `TimesheetEntry` object with the given values. - source: - openapi: hris_v3.yml - request: - name: TimesheetEntryEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: hrisRoot.TimesheetEntryRequest - content-type: application/json - response: - docs: '' - type: hrisRoot.TimesheetEntryResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - hours_worked: 10 - start_time: '2020-11-10T00:00:00Z' - end_time: '2020-11-10T00:10:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /dependent - data: - - Varies by platform - 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 - retrieve: - path: /hris/v1/timesheet-entries/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `TimesheetEntry` object with the given `id`. - source: - openapi: hris_v3.yml - path-parameters: - id: string - request: - name: TimesheetEntriesRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: hrisRoot.TimesheetEntry - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - employee: employee - hours_worked: 10 - start_time: '2020-11-10T00:00:00Z' - end_time: '2020-11-10T00:10:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /dependent - data: - - Varies by platform - metaPostRetrieve: - path: /hris/v1/timesheet-entries/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `TimesheetEntry` POSTs. - source: - openapi: hris_v3.yml - response: - docs: '' - type: hrisRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: hris_v3.yml diff --git a/.mock/definition/HRIS/webhookReceivers.yml b/.mock/definition/HRIS/webhookReceivers.yml deleted file mode 100644 index 3bc0cc7d8..000000000 --- a/.mock/definition/HRIS/webhookReceivers.yml +++ /dev/null @@ -1,65 +0,0 @@ -imports: - hrisRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /hris/v1/webhook-receivers - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `WebhookReceiver` objects. - source: - openapi: hris_v3.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: /hris/v1/webhook-receivers - method: POST - auth: - - tokenAuth: [] - docs: Creates a `WebhookReceiver` object with the given values. - source: - openapi: hris_v3.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: hrisRoot.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: hris_v3.yml diff --git a/.mock/definition/Ticketing/__package__.yml b/.mock/definition/Ticketing/__package__.yml deleted file mode 100644 index 966e73662..000000000 --- a/.mock/definition/Ticketing/__package__.yml +++ /dev/null @@ -1,3405 +0,0 @@ -types: - Account: - docs: >- - # The Account Object - - ### Description - - The `Account` object is used to represent the account that a ticket is - associated with. - - - The account is a company that may be a customer. This does not represent - the company that is receiving the ticket. - - - ### Usage Example - - TODO - 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 account's name. - domains: - type: optional>> - docs: The account's domain names. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: ticketing_v3.yml - AccountDetailsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: ticketing_v3.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: ticketing_v3.yml - AccountDetailsAndActionsCategory: - discriminated: false - union: - - CategoryEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - AccountDetailsAndActionsStatus: - discriminated: false - union: - - AccountDetailsAndActionsStatusEnum - - string - source: - openapi: ticketing_v3.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 - source: - openapi: ticketing_v3.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: ticketing_v3.yml - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - docs: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - source: - openapi: ticketing_v3.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: ticketing_v3.yml - AccountToken: - properties: - account_token: string - integration: AccountIntegration - id: string - source: - openapi: ticketing_v3.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: ticketing_v3.yml - AsyncPassthroughReciept: - properties: - async_passthrough_receipt_id: - type: string - validation: - format: uuid - source: - openapi: ticketing_v3.yml - AttachmentTicket: - discriminated: false - docs: The ticket associated with the attachment. - union: - - type: string - validation: - format: uuid - - Ticket - source: - openapi: ticketing_v3.yml - inline: true - Attachment: - docs: |- - # The Attachment Object - ### Description - The `Attachment` object is used to represent an attachment for a ticket. - - ### Usage Example - TODO - 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 - file_name: - type: optional - docs: >- - The attachment's name. It is required to include the file extension in - the attachment's name. - ticket: - type: optional - docs: The ticket associated with the attachment. - file_url: - type: optional - docs: >- - The attachment's url. It is required to include the file extension in - the file's URL. - content_type: - type: optional - docs: The attachment's file format. - uploaded_by: - type: optional - docs: The user who uploaded the attachment. - validation: - format: uuid - remote_created_at: - type: optional - docs: When the third party's attachment was created. - 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: ticketing_v3.yml - AttachmentRequestTicket: - discriminated: false - docs: The ticket associated with the attachment. - union: - - type: string - validation: - format: uuid - - Ticket - source: - openapi: ticketing_v3.yml - inline: true - AttachmentRequest: - docs: |- - # The Attachment Object - ### Description - The `Attachment` object is used to represent an attachment for a ticket. - - ### Usage Example - TODO - properties: - file_name: - type: optional - docs: >- - The attachment's name. It is required to include the file extension in - the attachment's name. - ticket: - type: optional - docs: The ticket associated with the attachment. - file_url: - type: optional - docs: >- - The attachment's url. It is required to include the file extension in - the file's URL. - content_type: - type: optional - docs: The attachment's file format. - uploaded_by: - type: optional - docs: The user who uploaded the attachment. - validation: - format: uuid - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ticketing_v3.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: ticketing_v3.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: ticketing_v3.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: ticketing_v3.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: ticketing_v3.yml - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: ticketing_v3.yml - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - docs: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - source: - openapi: ticketing_v3.yml - CollectionAccessLevel: - discriminated: false - docs: |- - The level of access a User has to the Collection and its sub-objects. - - * `PRIVATE` - PRIVATE - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PARENT_COLLECTION` - PARENT_COLLECTION - union: - - CollectionAccessLevelEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - CollectionParentCollection: - discriminated: false - docs: The parent collection for this collection. - union: - - type: string - validation: - format: uuid - - Collection - source: - openapi: ticketing_v3.yml - inline: true - Collection: - docs: >- - # The Collection Object - - ### Description - - The `Collection` object is used to represent one or more `Tickets`. There - can be a hierarchy of `Collections`, in which a sub-collection belongs to - a parent-collection. - - - ### Usage Example - - TODO - 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 collection's name. - description: - type: optional - docs: The collection's description. - access_level: - type: optional - docs: |- - The level of access a User has to the Collection and its sub-objects. - - * `PRIVATE` - PRIVATE - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PARENT_COLLECTION` - PARENT_COLLECTION - collection_type: - type: optional - docs: |- - The collection's type. - - * `LIST` - LIST - * `PROJECT` - PROJECT - parent_collection: - type: optional - docs: The parent collection for this collection. - collection_url: - type: optional - docs: The 3rd party url of the Collection. - validation: - format: uri - maxLength: 2000 - remote_created_at: - type: optional - docs: When the third party's collection was created. - remote_updated_at: - type: optional - docs: When the third party's collection was updated. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: ticketing_v3.yml - CollectionAccessLevelEnum: - enum: - - PRIVATE - - COMPANY - - PUBLIC - - PARENT_COLLECTION - docs: |- - * `PRIVATE` - PRIVATE - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PARENT_COLLECTION` - PARENT_COLLECTION - source: - openapi: ticketing_v3.yml - CollectionTypeEnum: - enum: - - LIST - - PROJECT - docs: |- - * `LIST` - LIST - * `PROJECT` - PROJECT - source: - openapi: ticketing_v3.yml - CommentUser: - discriminated: false - docs: >- - The author of the Comment, if the author is a User. If the third party - does not support specifying an author, we will append "[Posted on behalf - of {name}]" to the comment. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: ticketing_v3.yml - inline: true - CommentContact: - discriminated: false - docs: >- - The author of the Comment, if the author is a Contact.If the third party - does not support specifying an author, we will append "[Posted on behalf - of {name}]" to the comment. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: ticketing_v3.yml - inline: true - CommentTicket: - discriminated: false - docs: 'The ticket associated with the comment. ' - union: - - type: string - validation: - format: uuid - - Ticket - source: - openapi: ticketing_v3.yml - inline: true - Comment: - docs: |- - # The Comment Object - ### Description - The `Comment` object is used to represent a comment on a ticket. - - ### Usage Example - TODO - 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: - type: optional - docs: >- - The author of the Comment, if the author is a User. If the third party - does not support specifying an author, we will append "[Posted on - behalf of {name}]" to the comment. - contact: - type: optional - docs: >- - The author of the Comment, if the author is a Contact.If the third - party does not support specifying an author, we will append "[Posted - on behalf of {name}]" to the comment. - body: - type: optional - docs: The comment's text body. - html_body: - type: optional - docs: The comment's text body formatted as html. - ticket: - type: optional - docs: 'The ticket associated with the comment. ' - is_private: - type: optional - docs: Whether or not the comment is internal. - remote_created_at: - type: optional - docs: When the third party's comment was created. - 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: ticketing_v3.yml - CommentRequestUser: - discriminated: false - docs: >- - The author of the Comment, if the author is a User. If the third party - does not support specifying an author, we will append "[Posted on behalf - of {name}]" to the comment. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: ticketing_v3.yml - inline: true - CommentRequestContact: - discriminated: false - docs: >- - The author of the Comment, if the author is a Contact.If the third party - does not support specifying an author, we will append "[Posted on behalf - of {name}]" to the comment. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: ticketing_v3.yml - inline: true - CommentRequestTicket: - discriminated: false - docs: 'The ticket associated with the comment. ' - union: - - type: string - validation: - format: uuid - - Ticket - source: - openapi: ticketing_v3.yml - inline: true - CommentRequest: - docs: |- - # The Comment Object - ### Description - The `Comment` object is used to represent a comment on a ticket. - - ### Usage Example - TODO - properties: - user: - type: optional - docs: >- - The author of the Comment, if the author is a User. If the third party - does not support specifying an author, we will append "[Posted on - behalf of {name}]" to the comment. - contact: - type: optional - docs: >- - The author of the Comment, if the author is a Contact.If the third - party does not support specifying an author, we will append "[Posted - on behalf of {name}]" to the comment. - body: - type: optional - docs: The comment's text body. - html_body: - type: optional - docs: The comment's text body formatted as html. - ticket: - type: optional - docs: 'The ticket associated with the comment. ' - is_private: - type: optional - docs: Whether or not the comment is internal. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ticketing_v3.yml - CommentResponse: - properties: - model: Comment - warnings: list - errors: list - logs: optional> - source: - openapi: ticketing_v3.yml - CommonModelScopeApi: - properties: - common_models: - docs: The common models you want to update the scopes for - type: list - source: - openapi: ticketing_v3.yml - CommonModelScopesBodyRequest: - properties: - model_id: - type: string - validation: - minLength: 1 - enabled_actions: list - disabled_fields: list - source: - openapi: ticketing_v3.yml - ContactAccount: - discriminated: false - docs: The contact's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: ticketing_v3.yml - inline: true - Contact: - docs: >- - # The Contact Object - - ### Description - - The `Contact` object is used to represent the customer, lead, or external - user that a ticket is associated with. - - - ### Usage Example - - TODO - 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 contact's name. - email_address: - type: optional - docs: The contact's email address. - phone_number: - type: optional - docs: The contact's phone number. - details: - type: optional - docs: The contact's details. - account: - type: optional - docs: The contact's account. - 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: ticketing_v3.yml - ContactRequestAccount: - discriminated: false - docs: The contact's account. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: ticketing_v3.yml - inline: true - ContactRequest: - docs: >- - # The Contact Object - - ### Description - - The `Contact` object is used to represent the customer, lead, or external - user that a ticket is associated with. - - - ### Usage Example - - TODO - properties: - name: - type: optional - docs: The contact's name. - email_address: - type: optional - docs: The contact's email address. - phone_number: - type: optional - docs: The contact's phone number. - details: - type: optional - docs: The contact's details. - account: - type: optional - docs: The contact's account. - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - source: - openapi: ticketing_v3.yml - 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: MethodEnum - 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: ticketing_v3.yml - DebugModeLog: - properties: - log_id: string - dashboard_view: string - log_summary: DebugModelLogSummary - source: - openapi: ticketing_v3.yml - DebugModelLogSummary: - properties: - url: string - method: string - status_code: integer - source: - openapi: ticketing_v3.yml - EnabledActionsEnum: - enum: - - READ - - WRITE - docs: |- - * `READ` - READ - * `WRITE` - WRITE - source: - openapi: ticketing_v3.yml - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - docs: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - source: - openapi: ticketing_v3.yml - ErrorValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: ticketing_v3.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: ticketing_v3.yml - ExternalTargetFieldApi: - properties: - name: - type: optional - access: read-only - description: - type: optional - access: read-only - is_mapped: - type: optional - access: read-only - source: - openapi: ticketing_v3.yml - ExternalTargetFieldApiResponse: - properties: - Ticket: optional> - Comment: optional> - Project: optional> - Collection: optional> - User: optional> - Role: optional> - Account: optional> - Team: optional> - Attachment: optional> - Tag: optional> - Contact: optional> - source: - openapi: ticketing_v3.yml - FieldFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: ticketing_v3.yml - FieldMappingApiInstanceTargetField: - properties: - name: string - description: string - is_organization_wide: boolean - source: - openapi: ticketing_v3.yml - inline: true - FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: - properties: - method: optional - url_path: optional - field_traversal_path: optional> - source: - openapi: ticketing_v3.yml - inline: true - FieldMappingApiInstanceRemoteField: - properties: - remote_key_name: optional - schema: optional> - remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo - source: - openapi: ticketing_v3.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 - source: - openapi: ticketing_v3.yml - FieldMappingApiInstanceResponse: - properties: - Ticket: optional> - Comment: optional> - Project: optional> - Collection: optional> - User: optional> - Role: optional> - Account: optional> - Team: optional> - Attachment: optional> - Tag: optional> - Contact: optional> - source: - openapi: ticketing_v3.yml - FieldMappingInstanceResponse: - properties: - model: FieldMappingApiInstance - warnings: list - errors: list - logs: optional> - source: - openapi: ticketing_v3.yml - FieldPermissionDeserializer: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: ticketing_v3.yml - FieldPermissionDeserializerRequest: - properties: - enabled_fields: optional> - disabled_fields: optional> - source: - openapi: ticketing_v3.yml - FieldTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: ticketing_v3.yml - IndividualCommonModelScopeDeserializer: - properties: - model_name: string - model_permissions: optional> - field_permissions: optional - source: - openapi: ticketing_v3.yml - IndividualCommonModelScopeDeserializerRequest: - properties: - model_name: - type: string - validation: - minLength: 1 - model_permissions: optional> - field_permissions: optional - source: - openapi: ticketing_v3.yml - IssueStatus: - discriminated: false - docs: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - union: - - IssueStatusEnum - - string - source: - openapi: ticketing_v3.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: ticketing_v3.yml - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - docs: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - source: - openapi: ticketing_v3.yml - ItemFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - uuid - * `number` - url - * `date` - email - * `datetime` - phone - * `bool` - currency - * `list` - decimal - source: - openapi: ticketing_v3.yml - ItemSchema: - properties: - item_type: optional - item_format: optional - item_choices: optional> - source: - openapi: ticketing_v3.yml - ItemTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - docs: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - source: - openapi: ticketing_v3.yml - LanguageEnum: - enum: - - en - - de - docs: |- - * `en` - en - * `de` - de - source: - openapi: ticketing_v3.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: ticketing_v3.yml - LinkToken: - properties: - link_token: string - integration_name: optional - magic_link_url: optional - source: - openapi: ticketing_v3.yml - LinkedAccountStatus: - properties: - linked_account_status: string - can_make_request: boolean - source: - openapi: ticketing_v3.yml - MetaResponse: - properties: - request_schema: map - remote_field_classes: optional> - status: optional - has_conditional_params: boolean - has_required_linked_account_params: boolean - source: - openapi: ticketing_v3.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: ticketing_v3.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: ticketing_v3.yml - ModelPermissionDeserializer: - properties: - is_enabled: optional - source: - openapi: ticketing_v3.yml - ModelPermissionDeserializerRequest: - properties: - is_enabled: optional - source: - openapi: ticketing_v3.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: ticketing_v3.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: ticketing_v3.yml - PaginatedAccountDetailsAndActionsList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedAccountList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedAttachmentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedAuditLogEventList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedCollectionList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedCommentList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedContactList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedIssueList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedProjectList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedRemoteFieldClassList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedRoleList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedSyncStatusList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedTagList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedTeamList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedTicketList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedUserList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PaginatedViewerList: - properties: - next: optional - previous: optional - results: optional> - source: - openapi: ticketing_v3.yml - PatchedTicketRequestStatus: - discriminated: false - docs: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - union: - - TicketStatusEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - PatchedTicketRequestAccessLevel: - discriminated: false - docs: >- - The description of who is able to access a given ticket, or where access - is inherited from. - - - * `COMPANY` - COMPANY - - * `PUBLIC` - PUBLIC - - * `PRIVATE` - PRIVATE - - * `COLLECTION` - COLLECTION - union: - - TicketAccessLevelEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - PatchedTicketRequest: - docs: |- - # The Ticket Object - ### Description - The `Ticket` object is used to represent a ticket, issue, task or case. - ### Usage Example - TODO - properties: - name: - type: optional - docs: The ticket's name. - assignees: - type: optional>> - docs: >- - The individual `Users` who are assigned to this ticket. This does not - include `Users` who just have view access to this ticket. To fetch all - `Users` and `Teams` that can access the ticket, use the `GET - /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - assigned_teams: - type: optional>> - docs: >- - The `Teams` that are assigned to this ticket. This does not include - `Teams` who just have view access to this ticket. To fetch all `Users` - and `Teams` that can access this ticket, use the `GET - /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - creator: - type: optional - docs: The user who created this ticket. - validation: - format: uuid - due_date: - type: optional - docs: The ticket's due date. - status: - type: optional - docs: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - description: - type: optional - docs: >- - The ticket’s description. HTML version of description is mapped if - supported by the third-party platform. - collections: - type: optional>> - docs: The `Collections` that this `Ticket` is included in. - ticket_type: - type: optional - docs: >- - The sub category of the ticket within the 3rd party system. Examples - include incident, task, subtask or to-do. - account: - type: optional - docs: The account associated with the ticket. - validation: - format: uuid - contact: - type: optional - docs: The contact associated with the ticket. - validation: - format: uuid - parent_ticket: - type: optional - docs: The ticket's parent ticket. - validation: - format: uuid - access_level: - type: optional - docs: >- - The description of who is able to access a given ticket, or where - access is inherited from. - - - * `COMPANY` - COMPANY - - * `PUBLIC` - PUBLIC - - * `PRIVATE` - PRIVATE - - * `COLLECTION` - COLLECTION - tags: optional>> - roles: optional>> - completed_at: - type: optional - docs: When the ticket was completed. - ticket_url: - type: optional - docs: The 3rd party url of the Ticket. - validation: - format: uri - maxLength: 2000 - priority: - type: optional - docs: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: ticketing_v3.yml - PriorityEnum: - enum: - - URGENT - - HIGH - - NORMAL - - LOW - docs: |- - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - source: - openapi: ticketing_v3.yml - Project: - docs: >- - # The Project Object - - ### Description - - Please use the `Collection` model. This model will be fully deprecated on - 3/30/2024. - - - ### Usage Example - - TODO - 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 project''s name. ' - description: - type: optional - docs: The project's description. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: ticketing_v3.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: ticketing_v3.yml - RemoteEndpointInfo: - properties: - method: string - url_path: string - field_traversal_path: list - source: - openapi: ticketing_v3.yml - RemoteFieldRemoteFieldClass: - discriminated: false - union: - - string - - RemoteFieldClass - source: - openapi: ticketing_v3.yml - inline: true - RemoteField: - properties: - remote_field_class: RemoteFieldRemoteFieldClass - value: optional - source: - openapi: ticketing_v3.yml - RemoteFieldApiCoverage: - discriminated: false - union: - - integer - - double - source: - openapi: ticketing_v3.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: ticketing_v3.yml - RemoteFieldApiResponse: - properties: - Ticket: optional> - Comment: optional> - Project: optional> - Collection: optional> - User: optional> - Role: optional> - Account: optional> - Team: optional> - Attachment: optional> - Tag: optional> - Contact: optional> - source: - openapi: ticketing_v3.yml - RemoteFieldClassFieldChoicesItem: - properties: - value: optional - display_name: optional - source: - openapi: ticketing_v3.yml - inline: true - RemoteFieldClass: - properties: - id: optional - display_name: optional - remote_key_name: optional - description: optional - is_custom: optional - is_common_model_field: optional - is_required: optional - field_type: optional - field_format: optional - field_choices: - type: optional> - access: read-only - item_schema: optional - source: - openapi: ticketing_v3.yml - RemoteFieldRequestRemoteFieldClass: - discriminated: false - union: - - type: string - validation: - format: uuid - - RemoteFieldClass - source: - openapi: ticketing_v3.yml - inline: true - RemoteFieldRequest: - properties: - remote_field_class: RemoteFieldRequestRemoteFieldClass - value: optional - source: - openapi: ticketing_v3.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: ticketing_v3.yml - RemoteResponseResponseType: - discriminated: false - union: - - ResponseTypeEnum - - string - source: - openapi: ticketing_v3.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: ticketing_v3.yml - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - docs: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - source: - openapi: ticketing_v3.yml - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - docs: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - source: - openapi: ticketing_v3.yml - RoleTicketActionsItem: - discriminated: false - union: - - TicketActionsEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - RoleTicketAccess: - discriminated: false - docs: |- - The level of Ticket access that a User with this Role can perform. - - * `ALL` - ALL - * `ASSIGNED_ONLY` - ASSIGNED_ONLY - * `TEAM_ONLY` - TEAM_ONLY - union: - - TicketAccessEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - Role: - docs: >- - # The Role Object - - ### Description - - The `Role` object is used to represent the set of actions & access that a - user with this role is allowed to perform. - - - ### Usage Example - - TODO - 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 name of the Role. - ticket_actions: - type: optional>> - docs: >- - The set of actions that a User with this Role can perform. Possible - enum values include: `VIEW`, `CREATE`, `EDIT`, `DELETE`, `CLOSE`, and - `ASSIGN`. - ticket_access: - type: optional - docs: |- - The level of Ticket access that a User with this Role can perform. - - * `ALL` - ALL - * `ASSIGNED_ONLY` - ASSIGNED_ONLY - * `TEAM_ONLY` - TEAM_ONLY - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: ticketing_v3.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: ticketing_v3.yml - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - docs: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - source: - openapi: ticketing_v3.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: ticketing_v3.yml - SyncStatusLastSyncResult: - discriminated: false - union: - - LastSyncResultEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - SyncStatusStatus: - discriminated: false - union: - - StatusFd5Enum - - string - source: - openapi: ticketing_v3.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: ticketing_v3.yml - Tag: - docs: |- - # The Tag Object - ### Description - The `Tag` object is used to represent a tag or label for a ticket. - - ### Usage Example - TODO - properties: - 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 - id: - type: optional - validation: - format: uuid - access: read-only - name: - type: optional - docs: The tag's name. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: ticketing_v3.yml - Team: - docs: >- - # The Team Object - - ### Description - - The `Team` object is used to represent one or more `Users` within the - company receiving the ticket. - - - ### Usage Example - - TODO - 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 team's name. - description: - type: optional - docs: The team's description. - 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/). - field_mappings: - type: optional> - access: read-only - remote_data: - type: optional> - access: read-only - source: - openapi: ticketing_v3.yml - TicketAssigneesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - User - source: - openapi: ticketing_v3.yml - inline: true - TicketAssignedTeamsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Team - source: - openapi: ticketing_v3.yml - inline: true - TicketCreator: - discriminated: false - docs: The user who created this ticket. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: ticketing_v3.yml - inline: true - TicketStatus: - discriminated: false - docs: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - union: - - TicketStatusEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - TicketCollectionsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Collection - source: - openapi: ticketing_v3.yml - inline: true - TicketAccount: - discriminated: false - docs: The account associated with the ticket. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: ticketing_v3.yml - inline: true - TicketContact: - discriminated: false - docs: The contact associated with the ticket. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: ticketing_v3.yml - inline: true - TicketParentTicket: - discriminated: false - docs: The ticket's parent ticket. - union: - - type: string - validation: - format: uuid - - Ticket - source: - openapi: ticketing_v3.yml - inline: true - TicketAttachmentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Attachment - source: - openapi: ticketing_v3.yml - inline: true - TicketAccessLevel: - discriminated: false - docs: >- - The description of who is able to access a given ticket, or where access - is inherited from. - - - * `COMPANY` - COMPANY - - * `PUBLIC` - PUBLIC - - * `PRIVATE` - PRIVATE - - * `COLLECTION` - COLLECTION - union: - - TicketAccessLevelEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - TicketPriority: - discriminated: false - docs: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - union: - - PriorityEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - Ticket: - docs: |- - # The Ticket Object - ### Description - The `Ticket` object is used to represent a ticket, issue, task or case. - ### Usage Example - TODO - 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 ticket's name. - assignees: - type: optional>> - docs: >- - The individual `Users` who are assigned to this ticket. This does not - include `Users` who just have view access to this ticket. To fetch all - `Users` and `Teams` that can access the ticket, use the `GET - /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - assigned_teams: - type: optional>> - docs: >- - The `Teams` that are assigned to this ticket. This does not include - `Teams` who just have view access to this ticket. To fetch all `Users` - and `Teams` that can access this ticket, use the `GET - /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - creator: - type: optional - docs: The user who created this ticket. - due_date: - type: optional - docs: The ticket's due date. - status: - type: optional - docs: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - description: - type: optional - docs: >- - The ticket’s description. HTML version of description is mapped if - supported by the third-party platform. - collections: - type: optional>> - docs: The `Collections` that this `Ticket` is included in. - ticket_type: - type: optional - docs: >- - The sub category of the ticket within the 3rd party system. Examples - include incident, task, subtask or to-do. - account: - type: optional - docs: The account associated with the ticket. - contact: - type: optional - docs: The contact associated with the ticket. - parent_ticket: - type: optional - docs: The ticket's parent ticket. - attachments: optional>> - access_level: - type: optional - docs: >- - The description of who is able to access a given ticket, or where - access is inherited from. - - - * `COMPANY` - COMPANY - - * `PUBLIC` - PUBLIC - - * `PRIVATE` - PRIVATE - - * `COLLECTION` - COLLECTION - tags: optional>> - roles: optional>> - ticket_url: - type: optional - docs: The 3rd party url of the Ticket. - validation: - format: uri - maxLength: 2000 - priority: - type: optional - docs: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - remote_created_at: - type: optional - docs: When the third party's ticket was created. - remote_updated_at: - type: optional - docs: When the third party's ticket was updated. - completed_at: - type: optional - docs: When the ticket was completed. - 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 - remote_fields: - type: optional> - access: read-only - source: - openapi: ticketing_v3.yml - TicketAccessEnum: - enum: - - ALL - - ASSIGNED_ONLY - - TEAM_ONLY - docs: |- - * `ALL` - ALL - * `ASSIGNED_ONLY` - ASSIGNED_ONLY - * `TEAM_ONLY` - TEAM_ONLY - source: - openapi: ticketing_v3.yml - TicketAccessLevelEnum: - enum: - - COMPANY - - PUBLIC - - PRIVATE - - COLLECTION - docs: |- - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - * `COLLECTION` - COLLECTION - source: - openapi: ticketing_v3.yml - TicketActionsEnum: - enum: - - VIEW - - CREATE - - EDIT - - DELETE - - CLOSE - - ASSIGN - docs: |- - * `VIEW` - VIEW - * `CREATE` - CREATE - * `EDIT` - EDIT - * `DELETE` - DELETE - * `CLOSE` - CLOSE - * `ASSIGN` - ASSIGN - source: - openapi: ticketing_v3.yml - TicketRequestAssigneesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - User - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestAssignedTeamsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Team - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestCreator: - discriminated: false - docs: The user who created this ticket. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestStatus: - discriminated: false - docs: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - union: - - TicketStatusEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestCollectionsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Collection - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestAccount: - discriminated: false - docs: The account associated with the ticket. - union: - - type: string - validation: - format: uuid - - Account - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestContact: - discriminated: false - docs: The contact associated with the ticket. - union: - - type: string - validation: - format: uuid - - Contact - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestParentTicket: - discriminated: false - docs: The ticket's parent ticket. - union: - - type: string - validation: - format: uuid - - Ticket - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestAttachmentsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Attachment - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestAccessLevel: - discriminated: false - docs: >- - The description of who is able to access a given ticket, or where access - is inherited from. - - - * `COMPANY` - COMPANY - - * `PUBLIC` - PUBLIC - - * `PRIVATE` - PRIVATE - - * `COLLECTION` - COLLECTION - union: - - TicketAccessLevelEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - TicketRequestPriority: - discriminated: false - docs: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - union: - - PriorityEnum - - string - source: - openapi: ticketing_v3.yml - inline: true - TicketRequest: - docs: |- - # The Ticket Object - ### Description - The `Ticket` object is used to represent a ticket, issue, task or case. - ### Usage Example - TODO - properties: - name: - type: optional - docs: The ticket's name. - assignees: - type: optional>> - docs: >- - The individual `Users` who are assigned to this ticket. This does not - include `Users` who just have view access to this ticket. To fetch all - `Users` and `Teams` that can access the ticket, use the `GET - /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - assigned_teams: - type: optional>> - docs: >- - The `Teams` that are assigned to this ticket. This does not include - `Teams` who just have view access to this ticket. To fetch all `Users` - and `Teams` that can access this ticket, use the `GET - /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - creator: - type: optional - docs: The user who created this ticket. - due_date: - type: optional - docs: The ticket's due date. - status: - type: optional - docs: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - description: - type: optional - docs: >- - The ticket’s description. HTML version of description is mapped if - supported by the third-party platform. - collections: - type: optional>> - docs: The `Collections` that this `Ticket` is included in. - ticket_type: - type: optional - docs: >- - The sub category of the ticket within the 3rd party system. Examples - include incident, task, subtask or to-do. - account: - type: optional - docs: The account associated with the ticket. - contact: - type: optional - docs: The contact associated with the ticket. - parent_ticket: - type: optional - docs: The ticket's parent ticket. - attachments: optional>> - access_level: - type: optional - docs: >- - The description of who is able to access a given ticket, or where - access is inherited from. - - - * `COMPANY` - COMPANY - - * `PUBLIC` - PUBLIC - - * `PRIVATE` - PRIVATE - - * `COLLECTION` - COLLECTION - tags: optional>> - roles: optional>> - completed_at: - type: optional - docs: When the ticket was completed. - ticket_url: - type: optional - docs: The 3rd party url of the Ticket. - validation: - format: uri - maxLength: 2000 - priority: - type: optional - docs: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - integration_params: - type: optional> - access: write-only - linked_account_params: - type: optional> - access: write-only - remote_fields: - type: optional> - access: write-only - source: - openapi: ticketing_v3.yml - TicketResponse: - properties: - model: Ticket - warnings: list - errors: list - logs: optional> - source: - openapi: ticketing_v3.yml - TicketStatusEnum: - enum: - - OPEN - - CLOSED - - IN_PROGRESS - - ON_HOLD - docs: |- - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - source: - openapi: ticketing_v3.yml - TicketingAttachmentResponse: - properties: - model: Attachment - warnings: list - errors: list - logs: optional> - source: - openapi: ticketing_v3.yml - TicketingContactResponse: - properties: - model: Contact - warnings: list - errors: list - logs: optional> - source: - openapi: ticketing_v3.yml - UserTeamsItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Team - source: - openapi: ticketing_v3.yml - inline: true - UserRolesItem: - discriminated: false - union: - - type: string - validation: - format: uuid - - Role - source: - openapi: ticketing_v3.yml - inline: true - User: - docs: >- - # The User Object - - ### Description - - The `User` object is used to represent a user with a login to the - ticketing system. - - Users are either assignees who are directly responsible or a viewer on a - `Ticket`/ `Collection`. - - - ### Usage Example - - TODO - 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. - email_address: - type: optional - docs: The user's email address. - is_active: - type: optional - docs: Whether or not the user is active. - teams: optional>> - roles: optional>> - avatar: - type: optional - docs: The user's avatar picture. - 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: ticketing_v3.yml - ValidationProblemSource: - properties: - pointer: string - source: - openapi: ticketing_v3.yml - ViewerTeam: - discriminated: false - docs: The Team this Viewer belongs to. - union: - - type: string - validation: - format: uuid - - Team - source: - openapi: ticketing_v3.yml - inline: true - ViewerUser: - discriminated: false - docs: The User this Viewer belongs to. - union: - - type: string - validation: - format: uuid - - User - source: - openapi: ticketing_v3.yml - inline: true - Viewer: - docs: |- - # The Viewer Object - ### Description - The `Viewer` object is used to represent a User or Team within a company. - - ### Usage Example - TODO - 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 - team: - type: optional - docs: The Team this Viewer belongs to. - user: - type: optional - docs: The User this Viewer belongs to. - source: - openapi: ticketing_v3.yml - WarningValidationProblem: - properties: - source: optional - title: string - detail: string - problem_type: string - source: - openapi: ticketing_v3.yml - WebhookReceiver: - properties: - event: string - is_active: boolean - key: optional - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/accountDetails.yml b/.mock/definition/Ticketing/accountDetails.yml deleted file mode 100644 index b5b6bd417..000000000 --- a/.mock/definition/Ticketing/accountDetails.yml +++ /dev/null @@ -1,38 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /ticketing/v1/account-details - method: GET - auth: - - tokenAuth: [] - docs: Get details for a linked account. - source: - openapi: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/accountToken.yml b/.mock/definition/Ticketing/accountToken.yml deleted file mode 100644 index 2f2e9e091..000000000 --- a/.mock/definition/Ticketing/accountToken.yml +++ /dev/null @@ -1,47 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /ticketing/v1/account-token/{public_token} - method: GET - auth: - - tokenAuth: [] - docs: >- - Returns the account token for the end user with the provided public - token. - source: - openapi: ticketing_v3.yml - path-parameters: - public_token: string - response: - docs: '' - type: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/accounts.yml b/.mock/definition/Ticketing/accounts.yml deleted file mode 100644 index f27dbee0c..000000000 --- a/.mock/definition/Ticketing/accounts.yml +++ /dev/null @@ -1,164 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/accounts - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Account` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: AccountsListRequest - 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: ticketingRoot.PaginatedAccountList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Waystar Royco - domains: - - waystar-royco.com - - royco.com - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - retrieve: - path: /ticketing/v1/accounts/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Account` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: AccountsRetrieveRequest - 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: ticketingRoot.Account - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Waystar Royco - domains: - - waystar-royco.com - - royco.com - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /actions - data: - - Varies by platform - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/asyncPassthrough.yml b/.mock/definition/Ticketing/asyncPassthrough.yml deleted file mode 100644 index 7f570a7e6..000000000 --- a/.mock/definition/Ticketing/asyncPassthrough.yml +++ /dev/null @@ -1,74 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ticketing/v1/async-passthrough - method: POST - auth: - - tokenAuth: [] - docs: >- - Asynchronously pull data from an endpoint not currently supported by - Merge. - source: - openapi: ticketing_v3.yml - request: - body: ticketingRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: ticketingRoot.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: /ticketing/v1/async-passthrough/{async_passthrough_receipt_id} - method: GET - auth: - - tokenAuth: [] - docs: Retrieves data from earlier async-passthrough POST request - source: - openapi: ticketing_v3.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: ticketing_v3.yml -types: - AsyncPassthroughRetrieveResponse: - discriminated: false - union: - - ticketingRoot.RemoteResponse - - string - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/attachments.yml b/.mock/definition/Ticketing/attachments.yml deleted file mode 100644 index e1c9d0dfd..000000000 --- a/.mock/definition/Ticketing/attachments.yml +++ /dev/null @@ -1,480 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/attachments - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Attachment` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.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. - expand: - type: optional> - allow-multiple: true - 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_created_after: - type: optional - docs: >- - If provided, will only return attachments created in the third - party platform after this datetime. - remote_id: - type: optional - docs: The API provider's ID for the given object. - ticket_id: - type: optional - docs: If provided, will only return comments for this ticket. - response: - docs: '' - type: ticketingRoot.PaginatedAttachmentList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_created_after: '2024-01-15T09:30:00Z' - remote_id: remote_id - ticket_id: ticket_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - file_name: Screenshot.png - ticket: ticket - file_url: http://alturl.com/p749b - content_type: jpeg - uploaded_by: 28b54125-287f-494d-965e-3c5b330c9a68 - remote_created_at: '2022-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - create: - path: /ticketing/v1/attachments - method: POST - auth: - - tokenAuth: [] - docs: Creates an `Attachment` object with the given values. - source: - openapi: ticketing_v3.yml - request: - name: TicketingAttachmentEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: ticketingRoot.AttachmentRequest - content-type: application/json - response: - docs: '' - type: ticketingRoot.TicketingAttachmentResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - file_name: Screenshot.png - ticket: ticket - file_url: http://alturl.com/p749b - content_type: jpeg - uploaded_by: 28b54125-287f-494d-965e-3c5b330c9a68 - remote_created_at: '2022-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - 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 - retrieve: - path: /ticketing/v1/attachments/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns an `Attachment` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: AttachmentsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: ticketingRoot.Attachment - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - file_name: Screenshot.png - ticket: ticket - file_url: http://alturl.com/p749b - content_type: jpeg - uploaded_by: 28b54125-287f-494d-965e-3c5b330c9a68 - remote_created_at: '2022-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - downloadRetrieve: - path: /ticketing/v1/attachments/{id}/download - method: GET - auth: - - tokenAuth: [] - docs: Returns the `File` content with the given `id` as a stream of bytes. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: AttachmentsDownloadRetrieveRequest - query-parameters: - 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). - mime_type: - type: optional - docs: >- - 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. - response: - docs: '' - type: file - status-code: 200 - metaPostRetrieve: - path: /ticketing/v1/attachments/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `TicketingAttachment` POSTs. - source: - openapi: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/auditTrail.yml b/.mock/definition/Ticketing/auditTrail.yml deleted file mode 100644 index bbc472c92..000000000 --- a/.mock/definition/Ticketing/auditTrail.yml +++ /dev/null @@ -1,108 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/audit-trail - method: GET - auth: - - tokenAuth: [] - docs: Gets a list of audit trail events. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.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: ticketingRoot.PaginatedAuditLogEventList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - event_type: event_type - page_size: 1 - start_date: start_date - user_email: user_email - 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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/availableActions.yml b/.mock/definition/Ticketing/availableActions.yml deleted file mode 100644 index a29cc9c8b..000000000 --- a/.mock/definition/Ticketing/availableActions.yml +++ /dev/null @@ -1,52 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - retrieve: - path: /ticketing/v1/available-actions - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of models and actions available for an account. - source: - openapi: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/collections.yml b/.mock/definition/Ticketing/collections.yml deleted file mode 100644 index 4ad4bfe8f..000000000 --- a/.mock/definition/Ticketing/collections.yml +++ /dev/null @@ -1,312 +0,0 @@ -types: - CollectionsListRequestCollectionType: - enum: - - value: '' - name: EMPTY - - LIST - - PROJECT - source: - openapi: ticketing_v3.yml - CollectionsViewersListRequestExpandItem: - enum: - - team - - user - source: - openapi: ticketing_v3.yml -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/collections - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Collection` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: CollectionsListRequest - query-parameters: - collection_type: - type: optional - docs: If provided, will only return collections of the given type. - 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> - allow-multiple: true - 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. - name: - type: optional - docs: If provided, will only return collections with this name. - page_size: - type: optional - docs: Number of results to return per page. - parent_collection_id: - type: optional - docs: >- - If provided, will only return collections whose parent collection - matches the given id. - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: ticketingRoot.PaginatedCollectionList - status-code: 200 - examples: - - query-parameters: - collection_type: '' - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - parent_collection_id: parent_collection_id - remote_fields: collection_type - remote_id: remote_id - show_enum_origins: collection_type - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Q1 Platform - description: For tracking all tasks related to Platform for Q1 - access_level: PRIVATE - collection_type: LIST - parent_collection: parent_collection - collection_url: https://example.com - remote_created_at: '2022-01-01T00:00:00Z' - remote_updated_at: '2022-01-01T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - viewersList: - path: /ticketing/v1/collections/{collection_id}/viewers - method: GET - auth: - - tokenAuth: [] - docs: >- - 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) - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - path-parameters: - collection_id: string - request: - name: CollectionsViewersListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - allow-multiple: true - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: ticketingRoot.PaginatedViewerList - status-code: 200 - examples: - - path-parameters: - collection_id: collection_id - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - team: team - user: user - retrieve: - path: /ticketing/v1/collections/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Collection` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: CollectionsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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). - remote_fields: - type: optional> - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional> - docs: >- - 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) - response: - docs: '' - type: ticketingRoot.Collection - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - remote_fields: collection_type - show_enum_origins: collection_type - headers: - X-Account-Token: X-Account-Token - response: - body: - id: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Q1 Platform - description: For tracking all tasks related to Platform for Q1 - access_level: PRIVATE - collection_type: LIST - parent_collection: parent_collection - collection_url: https://example.com - remote_created_at: '2022-01-01T00:00:00Z' - remote_updated_at: '2022-01-01T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/comments.yml b/.mock/definition/Ticketing/comments.yml deleted file mode 100644 index a7024c5f6..000000000 --- a/.mock/definition/Ticketing/comments.yml +++ /dev/null @@ -1,478 +0,0 @@ -types: - CommentsListRequestExpandItem: - enum: - - contact - - ticket - - user - source: - openapi: ticketing_v3.yml - CommentsRetrieveRequestExpandItem: - enum: - - contact - - ticket - - user - source: - openapi: ticketing_v3.yml -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/comments - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Comment` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: CommentsListRequest - 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 - allow-multiple: true - 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_created_after: - type: optional - docs: >- - If provided, will only return Comments created in the third party - platform after this datetime. - remote_id: - type: optional - docs: The API provider's ID for the given object. - ticket_id: - type: optional - docs: If provided, will only return comments for this ticket. - response: - docs: '' - type: ticketingRoot.PaginatedCommentList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_created_after: '2024-01-15T09:30:00Z' - remote_id: remote_id - ticket_id: ticket_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - user: user - contact: contact - body: >- - When will these integrations be done? You all should use - Merge. - html_body: >- - When will these integrations be done? You all should use - Merge. - ticket: ticket - is_private: true - remote_created_at: '1990-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - create: - path: /ticketing/v1/comments - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Comment` object with the given values. - source: - openapi: ticketing_v3.yml - request: - name: CommentEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: ticketingRoot.CommentRequest - content-type: application/json - response: - docs: '' - type: ticketingRoot.CommentResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - user: user - contact: contact - body: >- - When will these integrations be done? You all should use - Merge. - html_body: >- - When will these integrations be done? You all should use - Merge. - ticket: ticket - is_private: true - remote_created_at: '1990-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - 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 - retrieve: - path: /ticketing/v1/comments/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Comment` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: CommentsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: ticketingRoot.Comment - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - user: user - contact: contact - body: When will these integrations be done? You all should use Merge. - html_body: >- - When will these integrations be done? You all should use - Merge. - ticket: ticket - is_private: true - remote_created_at: '1990-11-10T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - metaPostRetrieve: - path: /ticketing/v1/comments/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Comment` POSTs. - source: - openapi: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/contacts.yml b/.mock/definition/Ticketing/contacts.yml deleted file mode 100644 index f15290628..000000000 --- a/.mock/definition/Ticketing/contacts.yml +++ /dev/null @@ -1,441 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/contacts - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Contact` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: ContactsListRequest - 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. - email_address: - type: optional - docs: If provided, will only return Contacts that match this email. - expand: - type: optional> - allow-multiple: true - 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: ticketingRoot.PaginatedContactList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email_address: email_address - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Cousin Greg - email_address: greg@waystar-royco.com - phone_number: '5108890293' - details: Executive Assistant to Tom Wambsgans - account: account - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - create: - path: /ticketing/v1/contacts - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Contact` object with the given values. - source: - openapi: ticketing_v3.yml - request: - name: TicketingContactEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: ticketingRoot.ContactRequest - content-type: application/json - response: - docs: '' - type: ticketingRoot.TicketingContactResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Cousin Greg - email_address: greg@waystar-royco.com - phone_number: '5108890293' - details: Executive Assistant to Tom Wambsgans - account: account - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - 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 - retrieve: - path: /ticketing/v1/contacts/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Contact` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: ContactsRetrieveRequest - query-parameters: - expand: - type: optional> - allow-multiple: true - 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: ticketingRoot.Contact - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Cousin Greg - email_address: greg@waystar-royco.com - phone_number: '5108890293' - details: Executive Assistant to Tom Wambsgans - account: account - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - metaPostRetrieve: - path: /ticketing/v1/contacts/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `TicketingContact` POSTs. - source: - openapi: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.MetaResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/deleteAccount.yml b/.mock/definition/Ticketing/deleteAccount.yml deleted file mode 100644 index bb3fabec6..000000000 --- a/.mock/definition/Ticketing/deleteAccount.yml +++ /dev/null @@ -1,17 +0,0 @@ -service: - auth: false - base-path: '' - endpoints: - delete: - path: /ticketing/v1/delete-account - method: POST - auth: - - tokenAuth: [] - docs: Delete a linked account. - source: - openapi: ticketing_v3.yml - examples: - - headers: - X-Account-Token: X-Account-Token - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/fieldMapping.yml b/.mock/definition/Ticketing/fieldMapping.yml deleted file mode 100644 index 3bbc3da4d..000000000 --- a/.mock/definition/Ticketing/fieldMapping.yml +++ /dev/null @@ -1,741 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - field_mappings_retrieve: - path: /ticketing/v1/field-mappings - method: GET - auth: - - tokenAuth: [] - 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: ticketing_v3.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: ticketingRoot.FieldMappingApiInstanceResponse - status-code: 200 - examples: - - query-parameters: - exclude_remote_field_metadata: true - headers: - X-Account-Token: X-Account-Token - response: - body: - Ticket: - - 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 - Comment: - - 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 - Project: - - 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 - Collection: - - 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 - 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 - Role: - - 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 - Account: - - 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 - Team: - - 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 - 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 - Tag: - - 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 - Contact: - - 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 - field_mappings_create: - path: /ticketing/v1/field-mappings - method: POST - auth: - - tokenAuth: [] - 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: ticketing_v3.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 - content-type: application/json - response: - docs: '' - type: ticketingRoot.FieldMappingInstanceResponse - status-code: 201 - examples: - - query-parameters: - exclude_remote_field_metadata: true - 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 - 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: /ticketing/v1/field-mappings/{field_mapping_id} - method: DELETE - auth: - - tokenAuth: [] - 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: ticketing_v3.yml - path-parameters: - field_mapping_id: string - response: - docs: '' - type: ticketingRoot.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 - 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: /ticketing/v1/field-mappings/{field_mapping_id} - method: PATCH - auth: - - tokenAuth: [] - 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: ticketing_v3.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 - content-type: application/json - response: - docs: '' - type: ticketingRoot.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 - 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: /ticketing/v1/remote-fields - method: GET - auth: - - tokenAuth: [] - 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: ticketing_v3.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: ticketingRoot.RemoteFieldApiResponse - status-code: 200 - examples: - - query-parameters: - common_models: common_models - include_example_values: include_example_values - headers: - X-Account-Token: X-Account-Token - response: - body: - Ticket: - - 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 - Comment: - - 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 - Project: - - 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 - Collection: - - 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 - Role: - - 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 - Account: - - 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 - Team: - - 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 - Tag: - - 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 - Contact: - - 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: /ticketing/v1/target-fields - method: GET - auth: - - tokenAuth: [] - 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: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.ExternalTargetFieldApiResponse - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - Ticket: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Comment: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Project: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Collection: - - 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 - Role: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Account: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Team: - - 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 - Tag: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - Contact: - - name: example_target_field_name - description: this is a example description of a target field - is_mapped: is_mapped - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/forceResync.yml b/.mock/definition/Ticketing/forceResync.yml deleted file mode 100644 index 9e91fd2d1..000000000 --- a/.mock/definition/Ticketing/forceResync.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - sync_status_resync_create: - path: /ticketing/v1/sync-status/resync - method: POST - auth: - - tokenAuth: [] - 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: ticketing_v3.yml - response: - docs: '' - type: list - status-code: 200 - examples: - - headers: - X-Account-Token: X-Account-Token - response: - body: - - model_name: Ticket - model_id: ticketing.Ticket - 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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/generateKey.yml b/.mock/definition/Ticketing/generateKey.yml deleted file mode 100644 index 7e6164a84..000000000 --- a/.mock/definition/Ticketing/generateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ticketing/v1/generate-key - method: POST - auth: - - tokenAuth: [] - docs: Create a remote key. - source: - openapi: ticketing_v3.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: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/issues.yml b/.mock/definition/Ticketing/issues.yml deleted file mode 100644 index dbeaa54d9..000000000 --- a/.mock/definition/Ticketing/issues.yml +++ /dev/null @@ -1,154 +0,0 @@ -types: - IssuesListRequestStatus: - enum: - - ONGOING - - RESOLVED - source: - openapi: ticketing_v3.yml -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/issues - method: GET - auth: - - tokenAuth: [] - docs: Gets all issues for Organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.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: ticketingRoot.PaginatedIssueList - status-code: 200 - examples: - - query-parameters: - account_token: account_token - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - end_date: end_date - end_user_organization_name: end_user_organization_name - first_incident_time_after: '2024-01-15T09:30:00Z' - first_incident_time_before: '2024-01-15T09:30:00Z' - include_muted: include_muted - integration_name: integration_name - last_incident_time_after: '2024-01-15T09:30:00Z' - last_incident_time_before: '2024-01-15T09:30:00Z' - linked_account_id: linked_account_id - page_size: 1 - start_date: start_date - status: ONGOING - 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: /ticketing/v1/issues/{id} - method: GET - auth: - - tokenAuth: [] - docs: Get a specific issue. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - response: - docs: '' - type: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/linkToken.yml b/.mock/definition/Ticketing/linkToken.yml deleted file mode 100644 index 90f0862fd..000000000 --- a/.mock/definition/Ticketing/linkToken.yml +++ /dev/null @@ -1,155 +0,0 @@ -imports: - ticketingRoot: __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: - - ticketingRoot.LanguageEnum - - string - source: - openapi: ticketing_v3.yml - inline: true -service: - auth: false - base-path: '' - endpoints: - create: - path: /ticketing/v1/link-token - method: POST - auth: - - tokenAuth: [] - docs: Creates a link token to be used when linking a new end user. - source: - openapi: ticketing_v3.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: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/linkedAccounts.yml b/.mock/definition/Ticketing/linkedAccounts.yml deleted file mode 100644 index f4d447469..000000000 --- a/.mock/definition/Ticketing/linkedAccounts.yml +++ /dev/null @@ -1,169 +0,0 @@ -types: - LinkedAccountsListRequestCategory: - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - source: - openapi: ticketing_v3.yml -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/linked-accounts - method: GET - auth: - - tokenAuth: [] - docs: List linked accounts for your organization. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: LinkedAccountsListRequest - query-parameters: - category: - type: optional - docs: >- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, - `mktg`, `ticketing` - - - * `hris` - hris - - * `ats` - ats - - * `accounting` - accounting - - * `ticketing` - ticketing - - * `crm` - crm - - * `mktg` - mktg - - * `filestorage` - filestorage - 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: ticketingRoot.PaginatedAccountDetailsAndActionsList - status-code: 200 - examples: - - query-parameters: - category: accounting - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - 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: true - integration_name: integration_name - is_test_account: is_test_account - page_size: 1 - status: status - 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' - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/passthrough.yml b/.mock/definition/Ticketing/passthrough.yml deleted file mode 100644 index c0968fafe..000000000 --- a/.mock/definition/Ticketing/passthrough.yml +++ /dev/null @@ -1,42 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ticketing/v1/passthrough - method: POST - auth: - - tokenAuth: [] - docs: Pull data from an endpoint not currently supported by Merge. - source: - openapi: ticketing_v3.yml - request: - body: ticketingRoot.DataPassthroughRequest - content-type: application/json - response: - docs: '' - type: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/projects.yml b/.mock/definition/Ticketing/projects.yml deleted file mode 100644 index 8920b177e..000000000 --- a/.mock/definition/Ticketing/projects.yml +++ /dev/null @@ -1,253 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/projects - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Project` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: ProjectsListRequest - 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: ticketingRoot.PaginatedProjectList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Q1 Platform - description: For tracking all tasks related to Platform for Q1 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /ticketing/v1/projects/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Project` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: ProjectsRetrieveRequest - 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: ticketingRoot.Project - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Q1 Platform - description: For tracking all tasks related to Platform for Q1 - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - usersList: - path: /ticketing/v1/projects/{parent_id}/users - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `User` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - path-parameters: - parent_id: string - request: - name: ProjectsUsersListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - allow-multiple: true - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: ticketingRoot.PaginatedUserList - status-code: 200 - examples: - - path-parameters: - parent_id: parent_id - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Gil Feig - email_address: help@merge.dev - is_active: true - teams: - - 28b54125-287f-494d-965e-3c5b330c9a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - roles: - - 23454124-387f-494d-265e-345b330c9123 - avatar: https://merge.dev/user_profile_pic.png - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - source: - openapi: ticketing_v3.yml -types: - ProjectsUsersListRequestExpandItem: - enum: - - roles - - teams - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/regenerateKey.yml b/.mock/definition/Ticketing/regenerateKey.yml deleted file mode 100644 index 054c3dc1c..000000000 --- a/.mock/definition/Ticketing/regenerateKey.yml +++ /dev/null @@ -1,39 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - create: - path: /ticketing/v1/regenerate-key - method: POST - auth: - - tokenAuth: [] - docs: Exchange remote keys. - source: - openapi: ticketing_v3.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: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/roles.yml b/.mock/definition/Ticketing/roles.yml deleted file mode 100644 index 3067049b8..000000000 --- a/.mock/definition/Ticketing/roles.yml +++ /dev/null @@ -1,166 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/roles - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Role` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: RolesListRequest - 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: ticketingRoot.PaginatedRoleList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 23454124-387f-494d-265e-345b330c9123 - remote_id: '123' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Member - ticket_actions: - - VIEW - - EDIT - - CREATE - ticket_access: ALL - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /ticketing/v1/roles/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Role` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: RolesRetrieveRequest - 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: ticketingRoot.Role - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 23454124-387f-494d-265e-345b330c9123 - remote_id: '123' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Member - ticket_actions: - - VIEW - - EDIT - - CREATE - ticket_access: ALL - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/scopes.yml b/.mock/definition/Ticketing/scopes.yml deleted file mode 100644 index 82bf8e0e8..000000000 --- a/.mock/definition/Ticketing/scopes.yml +++ /dev/null @@ -1,168 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - default_scopes_retrieve: - path: /ticketing/v1/default-scopes - method: GET - auth: - - tokenAuth: [] - 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: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.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: /ticketing/v1/linked-account-scopes - method: GET - auth: - - tokenAuth: [] - 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: ticketing_v3.yml - response: - docs: '' - type: ticketingRoot.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: /ticketing/v1/linked-account-scopes - method: POST - auth: - - tokenAuth: [] - 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: ticketing_v3.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: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/syncStatus.yml b/.mock/definition/Ticketing/syncStatus.yml deleted file mode 100644 index 335739ba2..000000000 --- a/.mock/definition/Ticketing/syncStatus.yml +++ /dev/null @@ -1,64 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/sync-status - method: GET - auth: - - tokenAuth: [] - 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). - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.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: ticketingRoot.PaginatedSyncStatusList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - model_name: Ticket - model_id: ticketing.Ticket - 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: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/tags.yml b/.mock/definition/Ticketing/tags.yml deleted file mode 100644 index 69e5f0434..000000000 --- a/.mock/definition/Ticketing/tags.yml +++ /dev/null @@ -1,156 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/tags - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Tag` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: TagsListRequest - 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: ticketingRoot.PaginatedTagList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - id: 17a54124-287f-494d-965e-3c5b330c9a68 - name: Ticketing API - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /ticketing/v1/tags/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Tag` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: TagsRetrieveRequest - 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: ticketingRoot.Tag - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - id: 17a54124-287f-494d-965e-3c5b330c9a68 - name: Ticketing API - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/teams.yml b/.mock/definition/Ticketing/teams.yml deleted file mode 100644 index 9654bf8a4..000000000 --- a/.mock/definition/Ticketing/teams.yml +++ /dev/null @@ -1,158 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/teams - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Team` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: TeamsListRequest - 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: ticketingRoot.PaginatedTeamList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Platform - description: Platform and Integrations Team - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /ticketing/v1/teams/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Team` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: TeamsRetrieveRequest - 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: ticketingRoot.Team - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Platform - description: Platform and Integrations Team - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/tickets.yml b/.mock/definition/Ticketing/tickets.yml deleted file mode 100644 index 76665b774..000000000 --- a/.mock/definition/Ticketing/tickets.yml +++ /dev/null @@ -1,1259 +0,0 @@ -types: - TicketsListRequestExpandItem: - enum: - - account - - assigned_teams - - assignees - - attachments - - collections - - contact - - creator - - parent_ticket - source: - openapi: ticketing_v3.yml - TicketsListRequestPriority: - enum: - - HIGH - - LOW - - NORMAL - - URGENT - source: - openapi: ticketing_v3.yml - TicketsListRequestRemoteFields: - enum: - - priority - - value: priority,status - name: PriorityStatus - - value: priority,status,ticket_type - name: PriorityStatusTicketType - - value: priority,ticket_type - name: PriorityTicketType - - status - - value: status,ticket_type - name: StatusTicketType - - ticket_type - source: - openapi: ticketing_v3.yml - TicketsListRequestShowEnumOrigins: - enum: - - priority - - value: priority,status - name: PriorityStatus - - value: priority,status,ticket_type - name: PriorityStatusTicketType - - value: priority,ticket_type - name: PriorityTicketType - - status - - value: status,ticket_type - name: StatusTicketType - - ticket_type - source: - openapi: ticketing_v3.yml - TicketsListRequestStatus: - enum: - - value: '' - name: EMPTY - - CLOSED - - IN_PROGRESS - - ON_HOLD - - OPEN - source: - openapi: ticketing_v3.yml - TicketsRetrieveRequestExpandItem: - enum: - - account - - assigned_teams - - assignees - - attachments - - collections - - contact - - creator - - parent_ticket - source: - openapi: ticketing_v3.yml - TicketsRetrieveRequestRemoteFields: - enum: - - priority - - value: priority,status - name: PriorityStatus - - value: priority,status,ticket_type - name: PriorityStatusTicketType - - value: priority,ticket_type - name: PriorityTicketType - - status - - value: status,ticket_type - name: StatusTicketType - - ticket_type - source: - openapi: ticketing_v3.yml - TicketsRetrieveRequestShowEnumOrigins: - enum: - - priority - - value: priority,status - name: PriorityStatus - - value: priority,status,ticket_type - name: PriorityStatusTicketType - - value: priority,ticket_type - name: PriorityTicketType - - status - - value: status,ticket_type - name: StatusTicketType - - ticket_type - source: - openapi: ticketing_v3.yml - TicketsViewersListRequestExpandItem: - enum: - - team - - user - source: - openapi: ticketing_v3.yml -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/tickets - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `Ticket` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: TicketsListRequest - query-parameters: - account_id: - type: optional - docs: If provided, will only return tickets for this account. - assignee_ids: - type: optional - docs: >- - If provided, will only return tickets assigned to the - assignee_ids; multiple assignee_ids can be separated by commas. - collection_ids: - type: optional - docs: >- - If provided, will only return tickets assigned to the - collection_ids; multiple collection_ids can be separated by - commas. - completed_after: - type: optional - docs: >- - If provided, will only return tickets completed after this - datetime. - completed_before: - type: optional - docs: >- - If provided, will only return tickets completed before this - datetime. - contact_id: - type: optional - docs: If provided, will only return tickets for this contact. - 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. - creator_id: - type: optional - docs: If provided, will only return tickets created by this creator_id. - creator_ids: - type: optional - docs: >- - If provided, will only return tickets created by the creator_ids; - multiple creator_ids can be separated by commas. - cursor: - type: optional - docs: The pagination cursor value. - due_after: - type: optional - docs: If provided, will only return tickets due after this datetime. - due_before: - type: optional - docs: If provided, will only return tickets due before this datetime. - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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. - name: - type: optional - docs: If provided, will only return tickets with this name. - page_size: - type: optional - docs: Number of results to return per page. - parent_ticket_id: - type: optional - docs: If provided, will only return sub tickets of the parent_ticket_id. - priority: - type: optional - docs: |- - If provided, will only return tickets of this priority. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - remote_created_after: - type: optional - docs: >- - If provided, will only return tickets created in the third party - platform after this datetime. - remote_created_before: - type: optional - docs: >- - If provided, will only return tickets created in the third party - platform before this datetime. - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - remote_id: - type: optional - docs: The API provider's ID for the given object. - remote_updated_after: - type: optional - docs: >- - If provided, will only return tickets updated in the third party - platform after this datetime. - remote_updated_before: - type: optional - docs: >- - If provided, will only return tickets updated in the third party - platform before this datetime. - show_enum_origins: - type: optional - docs: >- - 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) - status: - type: optional - docs: If provided, will only return tickets of this status. - tags: - type: optional - docs: >- - If provided, will only return tickets matching the tags; multiple - tags can be separated by commas. - ticket_type: - type: optional - docs: If provided, will only return tickets of this type. - ticket_url: - type: optional - docs: >- - If provided, will only return tickets where the URL matches or - contains the substring - validation: - format: uri - response: - docs: '' - type: ticketingRoot.PaginatedTicketList - status-code: 200 - examples: - - query-parameters: - account_id: account_id - assignee_ids: assignee_ids - collection_ids: collection_ids - completed_after: '2024-01-15T09:30:00Z' - completed_before: '2024-01-15T09:30:00Z' - contact_id: contact_id - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - creator_id: creator_id - creator_ids: creator_ids - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - due_after: '2024-01-15T09:30:00Z' - due_before: '2024-01-15T09:30:00Z' - include_deleted_data: true - include_remote_data: true - include_remote_fields: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - name: name - page_size: 1 - parent_ticket_id: parent_ticket_id - priority: HIGH - remote_created_after: '2024-01-15T09:30:00Z' - remote_created_before: '2024-01-15T09:30:00Z' - remote_fields: priority - remote_id: remote_id - remote_updated_after: '2024-01-15T09:30:00Z' - remote_updated_before: '2024-01-15T09:30:00Z' - show_enum_origins: priority - status: '' - tags: tags - ticket_type: ticket_type - ticket_url: ticket_url - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Please add more integrations - assignees: - - 17a54124-287f-494d-965e-3c5b330c9a68 - assigned_teams: - - 4857c306-c1f9-489e-a6b6-90902f736dfe - creator: creator - due_date: '2022-10-11T00:00:00Z' - status: OPEN - description: >- - Can you please add more integrations? It'll make syncing - data much easier! - collections: - - fb8c55b6-1cb8-4b4c-9fb6-17924231619d - ticket_type: incident - account: account - contact: contact - parent_ticket: parent_ticket - attachments: - - 42747df1-95e7-46e2-93cc-66f1191edca5 - - 92f972d0-2526-434b-9409-4c3b468e08f0 - access_level: COMPANY - tags: - - enterprise - - other-tag - roles: - - 21a54124-397f-494d-985e-3c5b330b8a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - remote_created_at: '2021-11-10T00:00:00Z' - remote_updated_at: '2021-12-09T00:00:00Z' - completed_at: '2021-12-09T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - remote_fields: - - remote_field_class: remote_field_class - create: - path: /ticketing/v1/tickets - method: POST - auth: - - tokenAuth: [] - docs: Creates a `Ticket` object with the given values. - source: - openapi: ticketing_v3.yml - request: - name: TicketEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: ticketingRoot.TicketRequest - content-type: application/json - response: - docs: '' - type: ticketingRoot.TicketResponse - status-code: 201 - examples: - - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Please add more integrations - assignees: - - 17a54124-287f-494d-965e-3c5b330c9a68 - assigned_teams: - - 4857c306-c1f9-489e-a6b6-90902f736dfe - creator: creator - due_date: '2022-10-11T00:00:00Z' - status: OPEN - description: >- - Can you please add more integrations? It'll make syncing data - much easier! - collections: - - fb8c55b6-1cb8-4b4c-9fb6-17924231619d - ticket_type: incident - account: account - contact: contact - parent_ticket: parent_ticket - attachments: - - 42747df1-95e7-46e2-93cc-66f1191edca5 - - 92f972d0-2526-434b-9409-4c3b468e08f0 - access_level: COMPANY - tags: - - enterprise - - other-tag - roles: - - 21a54124-397f-494d-985e-3c5b330b8a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - remote_created_at: '2021-11-10T00:00:00Z' - remote_updated_at: '2021-12-09T00:00:00Z' - completed_at: '2021-12-09T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - remote_fields: - - remote_field_class: remote_field_class - 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 - retrieve: - path: /ticketing/v1/tickets/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `Ticket` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: TicketsRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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_remote_fields: - type: optional - docs: >- - Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - 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). - remote_fields: - type: optional - docs: Deprecated. Use show_enum_origins. - show_enum_origins: - type: optional - docs: >- - 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) - response: - docs: '' - type: ticketingRoot.Ticket - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_remote_fields: true - include_shell_data: true - remote_fields: priority - show_enum_origins: priority - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Please add more integrations - assignees: - - 17a54124-287f-494d-965e-3c5b330c9a68 - assigned_teams: - - 4857c306-c1f9-489e-a6b6-90902f736dfe - creator: creator - due_date: '2022-10-11T00:00:00Z' - status: OPEN - description: >- - Can you please add more integrations? It'll make syncing data - much easier! - collections: - - fb8c55b6-1cb8-4b4c-9fb6-17924231619d - ticket_type: incident - account: account - contact: contact - parent_ticket: parent_ticket - attachments: - - 42747df1-95e7-46e2-93cc-66f1191edca5 - - 92f972d0-2526-434b-9409-4c3b468e08f0 - access_level: COMPANY - tags: - - enterprise - - other-tag - roles: - - 21a54124-397f-494d-985e-3c5b330b8a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - remote_created_at: '2021-11-10T00:00:00Z' - remote_updated_at: '2021-12-09T00:00:00Z' - completed_at: '2021-12-09T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - remote_fields: - - remote_field_class: remote_field_class - value: - key: value - partialUpdate: - path: /ticketing/v1/tickets/{id} - method: PATCH - auth: - - tokenAuth: [] - docs: Updates a `Ticket` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: PatchedTicketEndpointRequest - query-parameters: - is_debug_mode: - type: optional - docs: >- - Whether to include debug fields (such as log file links) in the - response. - run_async: - type: optional - docs: Whether or not third-party updates should be run asynchronously. - body: - properties: - model: ticketingRoot.PatchedTicketRequest - content-type: application/json - response: - docs: '' - type: ticketingRoot.TicketResponse - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - is_debug_mode: true - run_async: true - headers: - X-Account-Token: X-Account-Token - request: - model: {} - response: - body: - model: - id: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Please add more integrations - assignees: - - 17a54124-287f-494d-965e-3c5b330c9a68 - assigned_teams: - - 4857c306-c1f9-489e-a6b6-90902f736dfe - creator: creator - due_date: '2022-10-11T00:00:00Z' - status: OPEN - description: >- - Can you please add more integrations? It'll make syncing data - much easier! - collections: - - fb8c55b6-1cb8-4b4c-9fb6-17924231619d - ticket_type: incident - account: account - contact: contact - parent_ticket: parent_ticket - attachments: - - 42747df1-95e7-46e2-93cc-66f1191edca5 - - 92f972d0-2526-434b-9409-4c3b468e08f0 - access_level: COMPANY - tags: - - enterprise - - other-tag - roles: - - 21a54124-397f-494d-985e-3c5b330b8a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - ticket_url: https://thirdpartysoftware.com/project/3/issue/1 - priority: URGENT - remote_created_at: '2021-11-10T00:00:00Z' - remote_updated_at: '2021-12-09T00:00:00Z' - completed_at: '2021-12-09T00:00:00Z' - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - remote_fields: - - remote_field_class: remote_field_class - 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 - viewersList: - path: /ticketing/v1/tickets/{ticket_id}/viewers - method: GET - auth: - - tokenAuth: [] - docs: >- - 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) - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - path-parameters: - ticket_id: string - request: - name: TicketsViewersListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - expand: - type: optional - allow-multiple: true - 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). - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: ticketingRoot.PaginatedViewerList - status-code: 200 - examples: - - path-parameters: - ticket_id: ticket_id - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - include_deleted_data: true - include_remote_data: true - include_shell_data: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '088899' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - team: team - user: user - metaPatchRetrieve: - path: /ticketing/v1/tickets/meta/patch/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Ticket` PATCHs. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - response: - docs: '' - type: ticketingRoot.MetaResponse - status-code: 200 - examples: - - path-parameters: - id: id - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - metaPostRetrieve: - path: /ticketing/v1/tickets/meta/post - method: GET - auth: - - tokenAuth: [] - docs: Returns metadata for `Ticket` POSTs. - source: - openapi: ticketing_v3.yml - request: - name: TicketsMetaPostRetrieveRequest - query-parameters: - collection_id: - type: optional - docs: If provided, will only return tickets for this collection. - ticket_type: - type: optional - docs: If provided, will only return tickets for this ticket type. - response: - docs: '' - type: ticketingRoot.MetaResponse - status-code: 200 - examples: - - query-parameters: - collection_id: collection_id - ticket_type: ticket_type - headers: - X-Account-Token: X-Account-Token - response: - body: - request_schema: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - key: value - status: - linked_account_status: linked_account_status - can_make_request: true - has_conditional_params: true - has_required_linked_account_params: true - remoteFieldClassesList: - path: /ticketing/v1/tickets/remote-field-classes - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `RemoteFieldClass` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.yml - request: - name: TicketsRemoteFieldClassesListRequest - query-parameters: - cursor: - type: optional - docs: The pagination cursor value. - ids: - type: optional - docs: >- - If provided, will only return remote field classes with the `ids` - in this list - 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). - is_common_model_field: - type: optional - docs: >- - If provided, will only return remote field classes with this - is_common_model_field value - is_custom: - type: optional - docs: >- - If provided, will only return remote fields classes with this - is_custom value - page_size: - type: optional - docs: Number of results to return per page. - response: - docs: '' - type: ticketingRoot.PaginatedRemoteFieldClassList - status-code: 200 - examples: - - query-parameters: - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - ids: ids - include_deleted_data: true - include_remote_data: true - include_shell_data: true - is_common_model_field: true - is_custom: true - page_size: 1 - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: id - display_name: display_name - remote_key_name: remote_key_name - description: description - is_custom: true - is_common_model_field: true - is_required: true - field_type: string - field_format: string - field_choices: - - {} - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/users.yml b/.mock/definition/Ticketing/users.yml deleted file mode 100644 index 8ab9181ef..000000000 --- a/.mock/definition/Ticketing/users.yml +++ /dev/null @@ -1,207 +0,0 @@ -types: - UsersListRequestExpandItem: - enum: - - roles - - teams - source: - openapi: ticketing_v3.yml - UsersRetrieveRequestExpandItem: - enum: - - roles - - teams - source: - openapi: ticketing_v3.yml -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/users - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `User` objects. - pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - source: - openapi: ticketing_v3.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. - email_address: - type: optional - docs: >- - If provided, will only return users with emails equal to this - value (case insensitive). - expand: - type: optional - allow-multiple: true - 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. - team: - type: optional - docs: If provided, will only return users matching in this team. - response: - docs: '' - type: ticketingRoot.PaginatedUserList - status-code: 200 - examples: - - query-parameters: - created_after: '2024-01-15T09:30:00Z' - created_before: '2024-01-15T09:30:00Z' - cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - email_address: email_address - include_deleted_data: true - include_remote_data: true - include_shell_data: true - modified_after: '2024-01-15T09:30:00Z' - modified_before: '2024-01-15T09:30:00Z' - page_size: 1 - remote_id: remote_id - team: team - headers: - X-Account-Token: X-Account-Token - response: - body: - next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Gil Feig - email_address: help@merge.dev - is_active: true - teams: - - 28b54125-287f-494d-965e-3c5b330c9a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - roles: - - 23454124-387f-494d-265e-345b330c9123 - avatar: https://merge.dev/user_profile_pic.png - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - retrieve: - path: /ticketing/v1/users/{id} - method: GET - auth: - - tokenAuth: [] - docs: Returns a `User` object with the given `id`. - source: - openapi: ticketing_v3.yml - path-parameters: - id: string - request: - name: UsersRetrieveRequest - query-parameters: - expand: - type: optional - allow-multiple: true - 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: ticketingRoot.User - status-code: 200 - examples: - - path-parameters: - id: id - query-parameters: - include_remote_data: true - include_shell_data: true - headers: - X-Account-Token: X-Account-Token - response: - body: - id: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: '19202938' - created_at: '2021-09-15T00:00:00Z' - modified_at: '2021-10-16T00:00:00Z' - name: Gil Feig - email_address: help@merge.dev - is_active: true - teams: - - 28b54125-287f-494d-965e-3c5b330c9a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - roles: - - 23454124-387f-494d-265e-345b330c9123 - avatar: https://merge.dev/user_profile_pic.png - remote_was_deleted: true - field_mappings: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - - path: /platform-endpoint - data: - key: value - source: - openapi: ticketing_v3.yml diff --git a/.mock/definition/Ticketing/webhookReceivers.yml b/.mock/definition/Ticketing/webhookReceivers.yml deleted file mode 100644 index 3a10d7758..000000000 --- a/.mock/definition/Ticketing/webhookReceivers.yml +++ /dev/null @@ -1,65 +0,0 @@ -imports: - ticketingRoot: __package__.yml -service: - auth: false - base-path: '' - endpoints: - list: - path: /ticketing/v1/webhook-receivers - method: GET - auth: - - tokenAuth: [] - docs: Returns a list of `WebhookReceiver` objects. - source: - openapi: ticketing_v3.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: /ticketing/v1/webhook-receivers - method: POST - auth: - - tokenAuth: [] - docs: Creates a `WebhookReceiver` object with the given values. - source: - openapi: ticketing_v3.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: ticketingRoot.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: ticketing_v3.yml diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml deleted file mode 100644 index 0967ef424..000000000 --- a/.mock/definition/__package__.yml +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/.mock/definition/api.yml b/.mock/definition/api.yml deleted file mode 100644 index 062482b66..000000000 --- a/.mock/definition/api.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: api -error-discrimination: - strategy: status-code -display-name: Merge Accounting API -environments: - Production: https://api.merge.dev/api - Production_EU: https://api-eu.merge.dev/api - Sandbox: https://api-sandbox.merge.dev/api -default-environment: Production -default-url: api -headers: - X-Account-Token: - type: optional - name: accountToken - docs: Token identifying the end user. -auth-schemes: - BearerAuthScheme: - scheme: bearer - token: - name: api_key -auth: BearerAuthScheme diff --git a/.mock/fern.config.json b/.mock/fern.config.json deleted file mode 100644 index 9aef8fce9..000000000 --- a/.mock/fern.config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "organization" : "merge", - "version" : "0.83.0" -} \ No newline at end of file diff --git a/.mock/filestorage_v3.yml b/.mock/filestorage_v3.yml deleted file mode 100644 index 8ccd8e845..000000000 --- a/.mock/filestorage_v3.yml +++ /dev/null @@ -1,5574 +0,0 @@ -openapi: 3.0.3 -info: - title: Merge File Storage API - version: '1.0' - description: The unified API for building rich integrations with multiple File Storage - platforms. - contact: - name: Merge Team - url: https://www.merge.dev/ - email: hello@merge.dev -paths: - /filestorage/v1/account-details: - get: - operationId: account_details_retrieve - description: Get details for a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - account-details - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountDetails' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/account-token/{public_token}: - get: - operationId: account_token_retrieve - description: Returns the account token for the end user with the provided public - token. - parameters: - - in: path - name: public_token - schema: - type: string - required: true - tags: - - account-token - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/async-passthrough: - post: - operationId: async_passthrough_create - description: Asynchronously pull data from an endpoint not currently supported - by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - async-passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncPassthroughReciept' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/async-passthrough/{async_passthrough_receipt_id}: - get: - operationId: async_passthrough_retrieve - description: Retrieves data from earlier async-passthrough POST request - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: async_passthrough_receipt_id - schema: - type: string - format: uuid - required: true - tags: - - async-passthrough - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/RemoteResponse' - - type: string - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/audit-trail: - get: - operationId: audit_trail_list - description: Gets a list of audit trail events. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include audit trail events that occurred - before this time - - in: query - name: event_type - schema: - type: string - description: '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`' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include audit trail events that occurred - after this time - - in: query - name: user_email - schema: - type: string - description: 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. - tags: - - audit-trail - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAuditLogEventList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/available-actions: - get: - operationId: available_actions_retrieve - description: Returns a list of models and actions available for an account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - available-actions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AvailableActions' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/default-scopes: - get: - operationId: default_scopes_retrieve - description: 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). - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/delete-account: - post: - operationId: delete_account_delete - description: Delete a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - delete-account - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/drives: - get: - operationId: drives_list - description: Returns a list of `Drive` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return drives with this name. This performs - an exact match. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - drives - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDriveList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/drives/{id}: - get: - operationId: drives_retrieve - description: Returns a `Drive` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - drives - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Drive' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/field-mappings: - get: - operationId: field_mappings_retrieve - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingApiInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: field_mappings_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/field-mappings/{field_mapping_id}: - patch: - operationId: field_mappings_partial_update - 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - delete: - operationId: field_mappings_destroy - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '204': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/files: - get: - operationId: files_list - description: Returns a list of `File` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: drive_id - schema: - type: string - description: Specifying a drive id returns only the files in that drive. Specifying - null returns only the files outside the top-level drive. - examples: - DriveId: - summary: drive_id - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - drive - - folder - - permissions - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPermissions,Folder,Drive: - value: permissions,folder,drive - summary: Expand Permissions, Folder, Drive - explode: false - - in: query - name: folder_id - schema: - type: string - description: Specifying a folder id returns only the files in that folder. - Specifying null returns only the files in root directory. - examples: - FolderId: - summary: folder_id - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: mime_type - schema: - type: string - description: If provided, will only return files with these mime_types. Multiple - values can be separated by commas. - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return files with this name. This performs - an exact match. - - in: query - name: order_by - schema: - type: string - enum: - - -created_at - - -modified_at - - created_at - - modified_at - x-fern-enum: - -created_at: - name: CreatedAtDescending - created_at: - name: CreatedAtAscending - -modified_at: - name: ModifiedAtDescending - modified_at: - name: ModifiedAtAscending - description: 'Overrides the default ordering for this endpoint. Possible values - include: created_at, -created_at, modified_at, -modified_at.' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - files - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFileList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: files_create - description: Creates a `File` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - files - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileStorageFileEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FileStorageFileEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FileStorageFileEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FileStorageFileResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /filestorage/v1/files/{id}: - get: - operationId: files_retrieve - description: Returns a `File` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - drive - - folder - - permissions - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPermissions,Folder,Drive: - value: permissions,folder,drive - summary: Expand Permissions, Folder, Drive - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - files - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/File' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/files/{id}/download: - get: - operationId: files_download_retrieve - description: Returns the `File` content with the given `id` as a stream of bytes. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: mime_type - schema: - type: string - description: 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. - tags: - - files - security: - - tokenAuth: [] - responses: - '200': - content: - application/octet-stream: - schema: - type: string - format: binary - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/files/{id}/download/request-meta: - get: - operationId: files_download_request_meta_retrieve - description: Returns metadata to construct an authenticated file download request - for a singular file, allowing you to download file directly from the third-party. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: mime_type - schema: - type: string - description: 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. - tags: - - files - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DownloadRequestMeta' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/files/download/request-meta: - get: - operationId: files_download_request_meta_list - description: Returns metadata to construct authenticated file download requests, - allowing you to download files directly from the third-party. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: mime_types - schema: - type: string - description: 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. - - in: query - name: modified_after - schema: - type: string - description: If provided, will only return objects modified after this datetime. - - in: query - name: modified_before - schema: - type: string - description: If provided, will only return objects modified before this datetime. - - in: query - name: order_by - schema: - type: string - enum: - - -created_at - - -modified_at - - created_at - - modified_at - x-fern-enum: - -created_at: - name: CreatedAtDescending - created_at: - name: CreatedAtAscending - -modified_at: - name: ModifiedAtDescending - modified_at: - name: ModifiedAtAscending - description: 'Overrides the default ordering for this endpoint. Possible values - include: created_at, -created_at, modified_at, -modified_at.' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - files - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDownloadRequestMetaList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/files/meta/post: - get: - operationId: files_meta_post_retrieve - description: Returns metadata for `FileStorageFile` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - files - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/folders: - get: - operationId: folders_list - description: Returns a list of `Folder` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: drive_id - schema: - type: string - description: If provided, will only return folders in this drive. - examples: - DriveId: - summary: drive_id - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - drive - - parent_folder - - permissions - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPermissions,ParentFolder,Drive: - value: permissions,parent_folder,drive - summary: Expand Permissions, Parent_folder, Drive - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return folders with this name. This performs - an exact match. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: parent_folder_id - schema: - type: string - description: If provided, will only return folders in this parent folder. - If null, will return folders in root directory. - examples: - ParentFolderId: - summary: parent_folder_id - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - folders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFolderList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: folders_create - description: Creates a `Folder` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - folders - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileStorageFolderEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FileStorageFolderEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FileStorageFolderEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FileStorageFolderResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /filestorage/v1/folders/{id}: - get: - operationId: folders_retrieve - description: Returns a `Folder` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - drive - - parent_folder - - permissions - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandPermissions,ParentFolder,Drive: - value: permissions,parent_folder,drive - summary: Expand Permissions, Parent_folder, Drive - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - folders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Folder' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/folders/meta/post: - get: - operationId: folders_meta_post_retrieve - description: Returns metadata for `FileStorageFolder` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - folders - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/generate-key: - post: - operationId: generate_key_create - description: Create a remote key. - tags: - - generate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/groups: - get: - operationId: groups_list - description: Returns a list of `Group` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - child_groups - - users - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandChildGroups: - value: child_groups - summary: Expand Child_groups - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - groups - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedGroupList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/groups/{id}: - get: - operationId: groups_retrieve - description: Returns a `Group` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - child_groups - - users - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandChildGroups: - value: child_groups - summary: Expand Child_groups - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - groups - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Group' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/issues: - get: - operationId: issues_list - description: Gets all issues for Organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: account_token - schema: - type: string - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred before this time - - in: query - name: end_user_organization_name - schema: - type: string - - in: query - name: first_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was after this datetime. - - in: query - name: first_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was before this datetime. - - in: query - name: include_muted - schema: - type: string - description: If true, will include muted issues - - in: query - name: integration_name - schema: - type: string - - in: query - name: last_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was after this datetime. - - in: query - name: last_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was before this datetime. - - in: query - name: linked_account_id - schema: - type: string - description: If provided, will only include issues pertaining to the linked - account passed in. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred after this time - - in: query - name: status - schema: - type: string - enum: - - ONGOING - - RESOLVED - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedIssueList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/issues/{id}: - get: - operationId: issues_retrieve - description: Get a specific issue. - parameters: - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Issue' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/link-token: - post: - operationId: link_token_create - description: Creates a link token to be used when linking a new end user. - tags: - - link-token - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LinkToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/linked-account-scopes: - get: - operationId: linked_account_scopes_retrieve - 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). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: linked_account_scopes_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /filestorage/v1/linked-accounts: - get: - operationId: linked_accounts_list - description: List linked accounts for your organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: category - schema: - type: string - nullable: true - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - description: |- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` - - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_user_email_address - schema: - type: string - description: If provided, will only return linked accounts associated with - the given email address. - - in: query - name: end_user_organization_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given organization name. - - in: query - name: end_user_origin_id - schema: - type: string - description: If provided, will only return linked accounts associated with - the given origin ID. - - in: query - name: end_user_origin_ids - schema: - type: string - description: Comma-separated list of EndUser origin IDs, making it possible - to specify multiple EndUsers at once. - - in: query - name: id - schema: - type: string - format: uuid - - in: query - name: ids - schema: - type: string - description: Comma-separated list of LinkedAccount IDs, making it possible - to specify multiple LinkedAccounts at once. - - in: query - name: include_duplicates - schema: - type: boolean - description: 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. - - in: query - name: integration_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given integration name. - - in: query - name: is_test_account - schema: - type: string - description: If included, will only include test linked accounts. If not included, - will only include non-test linked accounts. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: status - schema: - type: string - description: 'Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, - `RELINK_NEEDED`' - tags: - - linked-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountDetailsAndActionsList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/passthrough: - post: - operationId: passthrough_create - description: Pull data from an endpoint not currently supported by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/regenerate-key: - post: - operationId: regenerate_key_create - description: Exchange remote keys. - tags: - - regenerate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/remote-fields: - get: - operationId: 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: common_models - schema: - type: string - description: A comma seperated list of Common Model names. If included, will - only return Remote Fields for those Common Models. - - in: query - name: include_example_values - schema: - type: string - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/sync-status: - get: - operationId: 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). - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - sync-status - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedSyncStatusList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/sync-status/resync: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - force-resync - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/target-fields: - get: - operationId: target_fields_retrieve - 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalTargetFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/users: - get: - operationId: users_list - description: Returns a list of `User` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_me - schema: - type: string - description: If provided, will only return the user object for requestor. - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/users/{id}: - get: - operationId: users_retrieve - description: Returns a `User` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /filestorage/v1/webhook-receivers: - get: - operationId: webhook_receivers_list - description: Returns a list of `WebhookReceiver` objects. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: webhook_receivers_create - description: Creates a `WebhookReceiver` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC -components: - schemas: - AccountDetails: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - integration: - type: string - readOnly: true - example: BambooHR - integration_slug: - type: string - readOnly: true - example: bamboohr - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - nullable: true - example: hris - end_user_origin_id: - type: string - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - end_user_organization_name: - type: string - readOnly: true - example: Waystar Royco - end_user_email_address: - type: string - format: email - readOnly: true - example: kendall.roy@waystar-royco.com - status: - type: string - readOnly: true - example: COMPLETE - webhook_listener_url: - type: string - format: uri - readOnly: true - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - readOnly: true - description: 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. - example: true - account_type: - type: string - readOnly: true - example: PRODUCTION - completed_at: - type: string - format: date-time - nullable: true - description: The time at which account completes the linking flow. - example: '2024-08-26T20:11:19.277118Z' - x-merge-category: filestorage - AccountDetailsAndActions: - type: object - description: |- - # 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: - type: string - example: e59b1821-f85c-4e28-a6b3-1804156f3563 - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - example: hris - status: - oneOf: - - $ref: '#/components/schemas/AccountDetailsAndActionsStatusEnum' - - type: string - example: INCOMPLETE - status_detail: - type: string - example: Invalid login credentials - end_user_origin_id: - type: string - example: 3ac95cde-6c7f-4eef-afec-be710b42308d - end_user_organization_name: - type: string - example: Foo Bar, LLC - end_user_email_address: - type: string - example: hradmin@foobar.dev - subdomain: - type: string - description: The tenant or domain the customer has provided access to. - example: foobar - webhook_listener_url: - type: string - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - description: 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. - example: true - integration: - $ref: '#/components/schemas/AccountDetailsAndActionsIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - 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: - type: string - example: PRODUCTION - completed_at: - type: string - format: date-time - example: '2024-08-26T20:11:19.277118Z' - required: - - account_type - - completed_at - - end_user_email_address - - end_user_organization_name - - id - - status - - webhook_listener_url - x-merge-sample-json: '{"id": "e59b1821-f85c-4e28-a6b3-1804156f3563", "category": - "hris", "status": "INCOMPLETE", "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", "webhook_listener_url": - "https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4", - "is_duplicate": true, "integration": {"name": "SAP SuccessFactors", "categories": - ["hris", "ats"], "image": "https://cdn.merge.dev/SuccessFactors_Logo.png", - "square_image": "https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg", "color": - "#F6A704", "slug": "sap-successfactors", "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"]}]}}' - x-merge-category: filestorage - AccountDetailsAndActionsIntegration: - type: object - properties: - name: - type: string - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - image: - type: string - square_image: - type: string - color: - type: string - slug: - type: string - passthrough_available: - type: boolean - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - required: - - categories - - color - - name - - passthrough_available - - slug - x-merge-category: filestorage - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - type: string - description: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - x-merge-category: filestorage - AccountIntegration: - type: object - properties: - name: - type: string - description: Company name. - abbreviated_name: - type: string - nullable: true - description: "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: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: Category or categories this integration belongs to. Multiple - categories should be comma separated, i.e. [ats, hris]. - readOnly: true - image: - type: string - format: uri - nullable: true - description: Company logo in rectangular shape. - square_image: - type: string - format: uri - nullable: true - description: Company logo in square shape. - color: - type: string - description: The color of this integration used for buttons and text throughout - the app and landing pages. Choose a darker, saturated color. - pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ - maxLength: 18 - slug: - type: string - readOnly: true - api_endpoints_to_documentation_urls: - type: object - additionalProperties: {} - description: "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: string - nullable: true - description: Setup guide URL for third party webhook creation. Exposed in - Merge Docs. - category_beta_status: - type: object - description: Category or categories this integration is in beta status for. - readOnly: true - required: - - name - x-merge-category: filestorage - AccountToken: - type: object - properties: - account_token: - type: string - example: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB - integration: - $ref: '#/components/schemas/AccountIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - id: - type: string - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - required: - - account_token - - id - - integration - x-merge-category: filestorage - AdvancedMetadata: - type: object - properties: - id: - type: string - format: uuid - display_name: - type: string - description: - type: string - is_required: - type: boolean - is_custom: - type: boolean - field_choices: - type: array - items: {} - required: - - id - x-merge-category: filestorage - AsyncPassthroughReciept: - type: object - properties: - async_passthrough_receipt_id: - type: string - format: uuid - example: fd29020f-2695-445e-922e-dcd5e81903fd - required: - - async_passthrough_receipt_id - x-merge-category: filestorage - AuditLogEvent: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: b5ceea2a-7171-47ce-8090-165cfce5572c - user_name: - type: string - nullable: true - description: The User's full name at the time of this Event occurring. - maxLength: 200 - example: Gil Feig - user_email: - type: string - format: email - nullable: true - description: The User's email at the time of this Event occurring. - maxLength: 254 - example: hello@merge.dev - role: - oneOf: - - $ref: '#/components/schemas/RoleEnum' - - type: string - description: |- - 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 - example: ADMIN - ip_address: - type: string - maxLength: 45 - example: 192.0.2.123 - event_type: - oneOf: - - $ref: '#/components/schemas/EventTypeEnum' - - type: string - description: |- - 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 - example: CHANGED_SCOPES - event_description: - type: string - example: Organization-wide Scopes for model hris.Employee updated from Read - to Read+Write - created_at: - type: string - format: date-time - readOnly: true - required: - - event_description - - event_type - - ip_address - - role - x-merge-category: filestorage - AvailableActions: - type: object - description: |- - # 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: - $ref: '#/components/schemas/AccountIntegration' - example: - name: Lever - categories: - - ats - image: https://merge-api-production.s3.amazonaws.com/media/Lever_Logo.png - square_image: https://merge-api-production.s3.amazonaws.com/media/Lever_Square_Logo.png - color: '#262A34' - is_in_beta: 'true' - api_endpoints_to_documentation_urls: "{'GET': [('/common-model-scopes', - 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve')], - 'POST': []}" - passthrough_available: - type: boolean - example: true - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - example: - - model_name: Candidate - available_operations: - - FETCH - - CREATE - required_post_parameters: - - remote_user_id - supported_fields: - - first_name - - last_name - - company - - title - required: - - integration - - passthrough_available - x-merge-category: filestorage - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: filestorage - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: filestorage - CommonModelScopeAPI: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializer' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: filestorage - CommonModelScopesBodyRequest: - type: object - properties: - model_id: - type: string - minLength: 1 - example: hris.Employee - enabled_actions: - type: array - items: - $ref: '#/components/schemas/EnabledActionsEnum' - example: - - READ - - WRITE - disabled_fields: - type: array - items: - type: string - minLength: 1 - example: - - first_name - required: - - disabled_fields - - enabled_actions - - model_id - x-merge-category: filestorage - CreateFieldMappingRequest: - type: object - properties: - target_field_name: - type: string - minLength: 1 - description: The name of the target field you want this remote field to - map to. - example: example_target_field_name - target_field_description: - type: string - minLength: 1 - description: The description of the target field you want this remote field - to map to. - example: this is a example description of the target field - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - common_model_name: - type: string - minLength: 1 - description: The name of the Common Model that the remote field corresponds - to in a given category. - example: ExampleCommonModel - required: - - common_model_name - - remote_field_traversal_path - - remote_method - - remote_url_path - - target_field_description - - target_field_name - x-merge-category: filestorage - DataPassthroughRequest: - type: object - description: |- - # 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: - allOf: - - $ref: '#/components/schemas/MethodEnum' - example: POST - path: - type: string - minLength: 1 - description: The path of the request in the third party's platform. - example: /scooters - base_url_override: - type: string - nullable: true - minLength: 1 - description: An optional override of the third party's base url for the - request. - example: https://api.example.com - data: - type: string - nullable: true - minLength: 1 - description: The data with the request. You must include a `request_format` - parameter matching the data's format - example: '{"company": "Lime", "model": "Gen 2.5"}' - multipart_form_data: - type: array - items: - $ref: '#/components/schemas/MultipartFormFieldRequest' - nullable: true - description: Pass an array of `MultipartFormField` objects in here instead - of using the `data` param if `request_format` is set to `MULTIPART`. - headers: - type: object - additionalProperties: {} - nullable: true - description: 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. - example: - EXTRA-HEADER: value - request_format: - allOf: - - $ref: '#/components/schemas/RequestFormatEnum' - nullable: true - example: JSON - normalize_response: - type: boolean - description: '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`.' - required: - - method - - path - x-merge-category: filestorage - DebugModeLog: - type: object - properties: - log_id: - type: string - example: 99433219-8017-4acd-bb3c-ceb23d663832 - dashboard_view: - type: string - example: https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 - log_summary: - $ref: '#/components/schemas/DebugModelLogSummary' - example: - url: www.exampleintegration.com/api/v1/exampleapi - method: POST - status_code: 200 - required: - - dashboard_view - - log_id - - log_summary - x-merge-sample-json: '{"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}}' - x-merge-category: filestorage - DebugModelLogSummary: - type: object - properties: - url: - type: string - example: www.exampleintegration.com/api/v1/exampleapi - method: - type: string - example: POST - status_code: - type: integer - example: 200 - required: - - method - - status_code - - url - x-merge-sample-json: '{"url": "www.exampleintegration.com/api/v1/exampleapi", - "method": "POST", "status_code": 200}' - x-merge-category: filestorage - DownloadRequestMeta: - type: object - properties: - id: - type: string - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - url: - type: string - example: https://www.googleapis.com/drive/v3/files/234?alt=media - method: - type: string - example: GET - headers: - type: object - additionalProperties: {} - example: - Authorization: Bearer 1234 - required: - - headers - - id - - method - - url - x-merge-category: filestorage - Drive: - type: object - description: |- - # The Drive Object - ### Description - The `Drive` object is used to represent a drive that contains the folders and files in the user's workspace. - ### Usage Example - Fetch from the `GET /api/filestorage/v1/drives` endpoint and view their drives. - properties: - id: - type: string - format: uuid - readOnly: true - example: f9e3d315-d6c2-458e-85c4-fa773d6ff4a6 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '2039348' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The drive's name. - maxLength: 254 - example: My Drive - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's drive was created. - drive_url: - type: string - nullable: true - description: The drive's url. - maxLength: 2000 - example: https://drive.com/drives/2039349 - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /drives - data: - - Varies by platform - x-merge-category: filestorage - EnabledActionsEnum: - enum: - - READ - - WRITE - type: string - description: |- - * `READ` - READ - * `WRITE` - WRITE - x-merge-category: filestorage - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - type: string - description: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - x-merge-category: filestorage - EndUserDetailsRequest: - type: object - properties: - end_user_email_address: - type: string - minLength: 1 - description: Your end user's email address. This is purely for identification - purposes - setting this value will not cause any emails to be sent. - maxLength: 100 - example: example@gmail.com - end_user_organization_name: - type: string - minLength: 1 - description: Your end user's organization. - maxLength: 100 - example: Test Organization - end_user_origin_id: - type: string - minLength: 1 - description: 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. - maxLength: 100 - example: '12345' - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: The integration categories to show in Merge Link. - example: - - hris - - ats - integration: - type: string - nullable: true - minLength: 1 - description: 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/. - example: bamboohr - link_expiry_mins: - type: integer - maximum: 10080 - minimum: 30 - default: 30 - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: array - items: - $ref: '#/components/schemas/CommonModelScopesBodyRequest' - nullable: true - description: 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: object - additionalProperties: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - nullable: true - description: 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. - example: - hris: - - model_name: Employee - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - first_name - - last_name - - personal_email - disabled_fields: - - preferred_name - - model_name: Employment - model_permissions: - READ: - is_enabled: false - WRITE: - is_enabled: false - field_permissions: - enabled_fields: - - effective_date - ats: - - model_name: Job - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - name - disabled_fields: - - description - - model_name: Department - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - language: - oneOf: - - $ref: '#/components/schemas/LanguageEnum' - - type: string - nullable: true - description: |- - The following subset of IETF language tags can be used to configure localization. - - * `en` - en - * `de` - de - example: en - are_syncs_disabled: - type: boolean - nullable: true - default: false - description: The boolean that indicates whether initial, periodic, and force - syncs will be disabled. - integration_specific_config: - type: object - additionalProperties: {} - nullable: true - description: A JSON object containing integration-specific configuration - options. - example: - rippling: - oauth_code: 3h1jj8ssdf31dfji3o1jjdfjasd - required: - - categories - - end_user_email_address - - end_user_organization_name - - end_user_origin_id - x-merge-category: filestorage - ErrorValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /model/custom_fields - title: - type: string - example: Missing Required Field - detail: - type: string - example: custom_fields is a required field on model. - problem_type: - type: string - example: MISSING_REQUIRED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: filestorage - 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 - type: string - description: |- - * `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 - x-merge-category: filestorage - ExternalTargetFieldAPI: - type: object - properties: - name: - type: string - nullable: true - readOnly: true - example: example_target_field_name - description: - type: string - nullable: true - readOnly: true - example: this is a example description of a target field - is_mapped: - type: string - nullable: true - readOnly: true - example: true - x-merge-category: filestorage - ExternalTargetFieldAPIResponse: - type: object - properties: - File: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Folder: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Drive: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Group: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - User: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - x-merge-category: filestorage - FieldMappingApiInstance: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - is_integration_wide: - type: boolean - readOnly: true - target_field: - type: object - properties: - name: - type: string - description: - type: string - is_organization_wide: - type: boolean - required: - - description - - is_organization_wide - - name - nullable: true - readOnly: true - example: - name: example_target_field_name - description: this is a example description of a target field - is_organization_wide: true - remote_field: - type: object - properties: - remote_key_name: - type: string - nullable: true - schema: - type: object - additionalProperties: {} - nullable: true - remote_endpoint_info: - type: object - properties: - method: - type: string - nullable: true - url_path: - type: string - nullable: true - field_traversal_path: - type: array - items: - type: string - nullable: true - required: - - field_traversal_path - - method - - url_path - required: - - remote_endpoint_info - - remote_key_name - - schema - nullable: true - readOnly: true - example: - 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 - x-merge-category: filestorage - FieldMappingApiInstanceResponse: - type: object - properties: - File: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Folder: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Drive: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Group: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - User: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - x-merge-category: filestorage - FieldMappingInstanceResponse: - type: object - properties: - model: - $ref: '#/components/schemas/FieldMappingApiInstance' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: filestorage - FieldPermissionDeserializer: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: filestorage - FieldPermissionDeserializerRequest: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: filestorage - File: - type: object - description: |- - # The File Object - ### Description - The `File` object is used to represent a file in the workspace. The Object typically exists under a folder or drive, if it exists. - ### Usage Example - Fetch from the `GET /api/filestorage/v1/files` endpoint and view their files. - properties: - id: - type: string - format: uuid - readOnly: true - example: 45ce474c-dhcj-43a6-754r-629f799f7d68 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '12' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The file's name. - maxLength: 254 - example: merge_file_storage_launch.docx - file_url: - type: string - nullable: true - description: The URL to access the file. - maxLength: 2000 - example: https://drive.com/1234 - file_thumbnail_url: - type: string - nullable: true - description: The URL that produces a thumbnail preview of the file. Typically - an image. - maxLength: 2000 - example: https://drive.com/1234/thumbnail.png - size: - type: integer - maximum: 9223372036854776000 - minimum: -9223372036854776000 - format: int64 - nullable: true - description: The file's size, in bytes. - example: 254 - mime_type: - type: string - nullable: true - description: The file's mime type. - maxLength: 128 - example: application/vnd.openxmlformats-officedocument.wordprocessingml.document - description: - type: string - nullable: true - description: The file's description. - maxLength: 2000 - example: Use common model scopes to redact data returned in Merge's Common - Models! - folder: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Folder' - nullable: true - description: The folder that the file belongs to. - example: 8e889422-e086-42dc-b99e-24d732039b0b - x-merge-expands-to: Folder - checksum: - type: object - additionalProperties: {} - nullable: true - description: This field stores file checksum data. 'type' indicates the - algorithm (e.g. crc_32, sha1, sha256, quickXor, or md5), and 'content_hash' - is the unique hash used to verify file integrity and detect alterations. - example: - type: sha256 - content_hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - permissions: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Permission' - - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Permission' - description: The Permission object is used to represent a user's or group's - access to a File or Folder. Permissions are unexpanded by default. Use - the query param `expand=permissions` to see more details under `GET /files`. - example: - - 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 - group: - type: USER - roles: - - OWNER - remote_data: - - id: 2ea7db93-1ae9-4686-82c9-35c768000736 - remote_id: - created_at: '2020-03-31T00:00:00Z' - modified_at: '2020-06-20T00:00:00Z' - user: - group: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - type: GROUP - roles: - - READ - remote_data: - x-merge-expands-to: Permission - drive: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Drive' - nullable: true - description: The drive that the file belongs to. - example: 204ca79c-0c86-4f6c-9ca6-61b946a4708a - x-merge-expands-to: Drive - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's file was created. - example: '2022-02-02T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's file was updated. - example: '2022-02-03T00:00:00Z' - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /files - data: - - Varies by platform - x-merge-sdk-classname-alias: FileStorageFile - x-merge-sdk-classname-original: File - x-merge-expands: '{"drive": "Drive", "folder": "Folder", "permissions": "Permission"}' - x-merge-category: filestorage - FileRequest: - type: object - description: |- - # The File Object - ### Description - The `File` object is used to represent a file in the workspace. The Object typically exists under a folder or drive, if it exists. - ### Usage Example - Fetch from the `GET /api/filestorage/v1/files` endpoint and view their files. - properties: - name: - type: string - nullable: true - description: The file's name. - maxLength: 254 - example: merge_file_storage_launch.docx - file_url: - type: string - nullable: true - description: The URL to access the file. - maxLength: 2000 - example: https://drive.com/1234 - file_thumbnail_url: - type: string - nullable: true - description: The URL that produces a thumbnail preview of the file. Typically - an image. - maxLength: 2000 - example: https://drive.com/1234/thumbnail.png - size: - type: integer - maximum: 9223372036854776000 - minimum: -9223372036854776000 - format: int64 - nullable: true - description: The file's size, in bytes. - example: 254 - mime_type: - type: string - nullable: true - description: The file's mime type. - maxLength: 128 - example: application/vnd.openxmlformats-officedocument.wordprocessingml.document - description: - type: string - nullable: true - description: The file's description. - maxLength: 2000 - example: Use common model scopes to redact data returned in Merge's Common - Models! - folder: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Folder' - nullable: true - description: The folder that the file belongs to. - example: 8e889422-e086-42dc-b99e-24d732039b0b - x-merge-expands-to: Folder - checksum: - type: object - additionalProperties: {} - nullable: true - description: This field stores file checksum data. 'type' indicates the - algorithm (e.g. crc_32, sha1, sha256, quickXor, or md5), and 'content_hash' - is the unique hash used to verify file integrity and detect alterations. - example: - type: sha256 - content_hash: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - permissions: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PermissionRequest' - - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PermissionRequest' - description: The Permission object is used to represent a user's or group's - access to a File or Folder. Permissions are unexpanded by default. Use - the query param `expand=permissions` to see more details under `GET /files`. - example: - - 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 - group: - type: USER - roles: - - OWNER - remote_data: - - id: 2ea7db93-1ae9-4686-82c9-35c768000736 - remote_id: - created_at: '2020-03-31T00:00:00Z' - modified_at: '2020-06-20T00:00:00Z' - user: - group: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - type: GROUP - roles: - - READ - remote_data: - x-merge-expands-to: Permission - drive: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Drive' - nullable: true - description: The drive that the file belongs to. - example: 204ca79c-0c86-4f6c-9ca6-61b946a4708a - x-merge-expands-to: Drive - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-sdk-classname-alias: FileStorageFile - x-merge-sdk-classname-original: File - x-merge-expands: '{"drive": "Drive", "folder": "Folder", "permissions": "Permission"}' - x-merge-category: filestorage - FileStorageFileEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/FileRequest' - required: - - model - x-merge-category: filestorage - FileStorageFileResponse: - type: object - properties: - model: - $ref: '#/components/schemas/File' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: filestorage - FileStorageFolderEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/FolderRequest' - required: - - model - x-merge-category: filestorage - FileStorageFolderResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Folder' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: filestorage - Folder: - type: object - description: |- - # The Folder Object - ### Description - The `Folder` object is used to represent a collection of files and/or folders in the workspace. Could be within a drive, if it exists. - ### Usage Example - Fetch from the `GET /api/filestorage/v1/folders` endpoint and view their folders. - properties: - id: - type: string - format: uuid - readOnly: true - example: e021f7a7-74fc-4487-8e12-14180c92d3b7 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '14' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The folder's name. - maxLength: 254 - example: R&D - folder_url: - type: string - nullable: true - description: The URL to access the folder. - maxLength: 2000 - example: https://drive.com/1234 - size: - type: integer - maximum: 9223372036854776000 - minimum: -9223372036854776000 - format: int64 - nullable: true - description: The folder's size, in bytes. - example: 2738000 - description: - type: string - nullable: true - description: The folder's description. - maxLength: 2000 - example: All things R&D related at Merge! - parent_folder: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Folder' - nullable: true - description: The folder that the folder belongs to. - example: 47ce474c-asdf-34a2-754r-629f799f7d31 - x-merge-expands-to: Folder - drive: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Drive' - nullable: true - description: The drive that the folder belongs to. - example: 31ce474c-asdf-34a2-754r-629f799f7d12 - x-merge-expands-to: Drive - permissions: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Permission' - - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Permission' - description: The Permission object is used to represent a user's or group's - access to a File or Folder. Permissions are unexpanded by default. Use - the query param `expand=permissions` to see more details under `GET /folders`. - example: - - id: 105b9265-0d52-4e5c-bb88-0cb681ec77f6 - remote_id: '102895' - created_at: '2020-03-31T00:00:00Z' - modified_at: '2020-06-20T00:00:00Z' - user: 21ce474c-asdf-34a2-754r-629f799f7d12 - group: - type: USER - roles: - - OWNER - remote_data: - - id: a77ac1b4-a04f-4baa-a388-de3c0c173e1c - remote_id: - created_at: '2020-03-31T00:00:00Z' - modified_at: '2020-06-20T00:00:00Z' - user: - group: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - type: GROUP - roles: - - READ - remote_data: - x-merge-expands-to: Permission - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's folder was created. - example: '2024-02-02T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's folder was updated. - example: '2024-06-10T00:00:00Z' - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /folders - data: - - Varies by platform - x-merge-expands: '{"drive": "Drive", "parent_folder": "Folder", "permissions": - "Permission"}' - x-merge-category: filestorage - FolderRequest: - type: object - description: |- - # The Folder Object - ### Description - The `Folder` object is used to represent a collection of files and/or folders in the workspace. Could be within a drive, if it exists. - ### Usage Example - Fetch from the `GET /api/filestorage/v1/folders` endpoint and view their folders. - properties: - name: - type: string - nullable: true - description: The folder's name. - maxLength: 254 - example: R&D - folder_url: - type: string - nullable: true - description: The URL to access the folder. - maxLength: 2000 - example: https://drive.com/1234 - size: - type: integer - maximum: 9223372036854776000 - minimum: -9223372036854776000 - format: int64 - nullable: true - description: The folder's size, in bytes. - example: 2738000 - description: - type: string - nullable: true - description: The folder's description. - maxLength: 2000 - example: All things R&D related at Merge! - parent_folder: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Folder' - nullable: true - description: The folder that the folder belongs to. - example: 47ce474c-asdf-34a2-754r-629f799f7d31 - x-merge-expands-to: Folder - drive: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Drive' - nullable: true - description: The drive that the folder belongs to. - example: 31ce474c-asdf-34a2-754r-629f799f7d12 - x-merge-expands-to: Drive - permissions: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PermissionRequest' - - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PermissionRequest' - description: The Permission object is used to represent a user's or group's - access to a File or Folder. Permissions are unexpanded by default. Use - the query param `expand=permissions` to see more details under `GET /folders`. - example: - - id: 105b9265-0d52-4e5c-bb88-0cb681ec77f6 - remote_id: '102895' - created_at: '2020-03-31T00:00:00Z' - modified_at: '2020-06-20T00:00:00Z' - user: 21ce474c-asdf-34a2-754r-629f799f7d12 - group: - type: USER - roles: - - OWNER - remote_data: - - id: a77ac1b4-a04f-4baa-a388-de3c0c173e1c - remote_id: - created_at: '2020-03-31T00:00:00Z' - modified_at: '2020-06-20T00:00:00Z' - user: - group: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - type: GROUP - roles: - - READ - remote_data: - x-merge-expands-to: Permission - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"drive": "Drive", "parent_folder": "Folder", "permissions": - "Permission"}' - x-merge-category: filestorage - GenerateRemoteKeyRequest: - type: object - description: |- - # The GenerateRemoteKey Object - ### Description - The `GenerateRemoteKey` object is used to represent a request for a new remote key. - - ### Usage Example - Post a `GenerateRemoteKey` to create a new remote key. - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: filestorage - Group: - type: object - description: |- - # 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/filestorage/v1/groups` endpoint and view their groups. - properties: - id: - type: string - format: uuid - readOnly: true - example: 5624aceb-0ea2-4864-ba08-354ac56b9884 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The group's name. - maxLength: 254 - example: Administrators - users: - type: array - items: - type: string - format: uuid - description: The users that belong in the group. If null, this typically - means it's either a domain or the third-party platform does not surface - this information. - example: - - 6e93361b-8ae7-444b-bfa2-71206cbbee24 - child_groups: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Group' - readOnly: true - description: Groups that inherit the permissions of the parent group. - example: - - a1f90b3c-633d-404e-a696-05cd54808676 - x-merge-expands-to: Group - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /groups - data: - - Varies by platform - required: - - users - x-merge-expands: '{"child_groups": "Group"}' - x-merge-category: filestorage - IndividualCommonModelScopeDeserializer: - type: object - properties: - model_name: - type: string - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializer' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializer' - required: - - model_name - x-merge-category: filestorage - IndividualCommonModelScopeDeserializerRequest: - type: object - properties: - model_name: - type: string - minLength: 1 - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializerRequest' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializerRequest' - required: - - model_name - x-merge-category: filestorage - Issue: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - status: - oneOf: - - $ref: '#/components/schemas/IssueStatusEnum' - - type: string - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - example: ONGOING - error_description: - type: string - example: Missing Permissions - end_user: - type: object - additionalProperties: {} - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - first_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - last_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - is_muted: - type: boolean - readOnly: true - example: true - error_details: - type: array - items: - type: string - readOnly: true - example: - - Missing employee permissions. - - Missing time off permissions. - required: - - error_description - x-merge-category: filestorage - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - type: string - description: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - x-merge-category: filestorage - LanguageEnum: - enum: - - en - - de - type: string - description: |- - * `en` - en - * `de` - de - x-merge-category: filestorage - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: filestorage - LinkToken: - type: object - properties: - link_token: - type: string - example: necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0 - integration_name: - type: string - example: Lever - magic_link_url: - type: string - example: https://link.merge.dev/asdfjkl12345jsndfgi2i83n - required: - - link_token - x-merge-category: filestorage - LinkedAccountCommonModelScopeDeserializerRequest: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: filestorage - LinkedAccountStatus: - type: object - properties: - linked_account_status: - type: string - can_make_request: - type: boolean - required: - - can_make_request - - linked_account_status - x-merge-category: filestorage - MetaResponse: - type: object - properties: - request_schema: - type: object - additionalProperties: {} - example: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - type: object - additionalProperties: {} - status: - $ref: '#/components/schemas/LinkedAccountStatus' - example: - linked_account_status: COMPLETE - can_make_request: true - has_conditional_params: - type: boolean - has_required_linked_account_params: - type: boolean - required: - - has_conditional_params - - has_required_linked_account_params - - request_schema - x-merge-category: filestorage - MethodEnum: - enum: - - GET - - OPTIONS - - HEAD - - POST - - PUT - - PATCH - - DELETE - type: string - description: |- - * `GET` - GET - * `OPTIONS` - OPTIONS - * `HEAD` - HEAD - * `POST` - POST - * `PUT` - PUT - * `PATCH` - PATCH - * `DELETE` - DELETE - x-merge-category: filestorage - ModelOperation: - type: object - description: |- - # 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: - type: string - example: Candidate - available_operations: - type: array - items: - type: string - example: - - FETCH - - CREATE - required_post_parameters: - type: array - items: - type: string - example: - - remote_user_id - supported_fields: - type: array - items: - type: string - example: - - first_name - - last_name - - company - - title - required: - - available_operations - - model_name - - required_post_parameters - - supported_fields - x-merge-category: filestorage - ModelPermissionDeserializer: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: filestorage - ModelPermissionDeserializerRequest: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: filestorage - MultipartFormFieldRequest: - type: object - description: |- - # 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 - minLength: 1 - description: The name of the form field - example: resume - data: - type: string - minLength: 1 - description: The data for the form field. - example: SW50ZWdyYXRlIGZhc3QKSW50ZWdyYXRlIG9uY2U= - encoding: - oneOf: - - $ref: '#/components/schemas/EncodingEnum' - - type: string - nullable: true - default: RAW - description: |- - The encoding of the value of `data`. Defaults to `RAW` if not defined. - - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - example: BASE64 - file_name: - type: string - nullable: true - minLength: 1 - description: The file name of the form field, if the field is for a file. - example: resume.pdf - content_type: - type: string - nullable: true - minLength: 1 - description: The MIME type of the file, if the field is for a file. - example: application/pdf - required: - - data - - name - x-merge-category: filestorage - PaginatedAccountDetailsAndActionsList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountDetailsAndActions' - x-merge-category: filestorage - PaginatedAuditLogEventList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AuditLogEvent' - x-merge-category: filestorage - PaginatedDownloadRequestMetaList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/DownloadRequestMeta' - x-merge-category: filestorage - PaginatedDriveList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Drive' - x-merge-category: filestorage - PaginatedFileList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/File' - x-merge-category: filestorage - PaginatedFolderList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Folder' - x-merge-category: filestorage - PaginatedGroupList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Group' - x-merge-category: filestorage - PaginatedIssueList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Issue' - x-merge-category: filestorage - PaginatedSyncStatusList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - x-merge-category: filestorage - PaginatedUserList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/User' - x-merge-category: filestorage - PatchedEditFieldMappingRequest: - type: object - properties: - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field_name - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - x-merge-category: filestorage - Permission: - type: object - description: |- - # The Permission Object - ### Description - The Permission object is used to represent a user's or group's access to a File or Folder. Permissions are unexpanded by default. - - ### Usage Example - Fetch from the `GET Files` or `GET Folders` endpoint. Permissions are unexpanded by default. Use the query param `expand=permissions` to see more details. - properties: - id: - type: string - format: uuid - readOnly: true - example: ecbe05ac-62a3-46c5-ab31-4b478b37d1b4 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '340' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - user: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The user that is granted this permission. This will only be - populated if the type is `USER`. - example: 755e0a8e-1c04-444b-980f-51b1c0bdde8a - x-merge-expands-to: User - group: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Group' - nullable: true - description: The group that is granted this permission. This will only be - populated if the type is `GROUP`. - x-merge-expands-to: Group - type: - oneOf: - - $ref: '#/components/schemas/TypeEnum' - - type: string - nullable: true - description: |- - Denotes what type of people have access to the file. - - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - example: USER - roles: - type: array - items: - oneOf: - - $ref: '#/components/schemas/RolesEnum' - - type: string - nullable: true - description: |- - The permissions that the user or group has for the File or Folder. - - * `READ` - READ - * `WRITE` - WRITE - * `OWNER` - OWNER - nullable: true - description: 'The permissions that the user or group has for the File or - Folder. It is possible for a user or group to have multiple roles, such - as viewing & uploading. Possible values include: `READ`, `WRITE`, `OWNER`. - In cases where there is no clear mapping, the original value passed through - will be returned.' - example: - - OWNER - x-merge-nested-write-allowed: true - x-merge-expands: '{"group": "Group", "primary_file": "File", "primary_folder": - "Folder", "user": "User"}' - x-merge-category: filestorage - PermissionRequest: - type: object - description: |- - # The Permission Object - ### Description - The Permission object is used to represent a user's or group's access to a File or Folder. Permissions are unexpanded by default. - - ### Usage Example - Fetch from the `GET Files` or `GET Folders` endpoint. Permissions are unexpanded by default. Use the query param `expand=permissions` to see more details. - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '340' - user: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The user that is granted this permission. This will only be - populated if the type is `USER`. - example: 755e0a8e-1c04-444b-980f-51b1c0bdde8a - x-merge-expands-to: User - group: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Group' - nullable: true - description: The group that is granted this permission. This will only be - populated if the type is `GROUP`. - x-merge-expands-to: Group - type: - oneOf: - - $ref: '#/components/schemas/TypeEnum' - - type: string - nullable: true - description: |- - Denotes what type of people have access to the file. - - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - example: USER - roles: - type: array - items: - oneOf: - - $ref: '#/components/schemas/RolesEnum' - - type: string - nullable: true - description: |- - The permissions that the user or group has for the File or Folder. - - * `READ` - READ - * `WRITE` - WRITE - * `OWNER` - OWNER - nullable: true - description: 'The permissions that the user or group has for the File or - Folder. It is possible for a user or group to have multiple roles, such - as viewing & uploading. Possible values include: `READ`, `WRITE`, `OWNER`. - In cases where there is no clear mapping, the original value passed through - will be returned.' - example: - - OWNER - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"group": "Group", "primary_file": "File", "primary_folder": - "Folder", "user": "User"}' - x-merge-category: filestorage - RemoteData: - type: object - description: |- - # 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 - description: The third-party API path that is being called. - example: /platform-endpoint - data: - readOnly: true - description: The data returned from the third-party for this object in its - original, unnormalized format. - example: - - Varies by platform - required: - - path - x-merge-category: filestorage - RemoteEndpointInfo: - type: object - properties: - method: - type: string - example: GET - url_path: - type: string - example: /example-url-path - field_traversal_path: - type: array - items: {} - example: - - example_key_name - required: - - field_traversal_path - - method - - url_path - x-merge-category: filestorage - RemoteFieldAPI: - type: object - properties: - schema: - type: object - additionalProperties: {} - example: - type: string - remote_key_name: - type: string - example: example_remote_key_name - remote_endpoint_info: - $ref: '#/components/schemas/RemoteEndpointInfo' - example: - method: GET - url_path: /example-url-path - field_traversal_path: - - example_key_name - example_values: - type: array - items: {} - nullable: true - example: - - example - advanced_metadata: - allOf: - - $ref: '#/components/schemas/AdvancedMetadata' - nullable: true - coverage: - oneOf: - - type: integer - - type: number - format: double - nullable: true - readOnly: true - example: 0.33 - required: - - advanced_metadata - - remote_endpoint_info - - remote_key_name - - schema - x-merge-category: filestorage - RemoteFieldAPIResponse: - type: object - properties: - File: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Folder: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Drive: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Group: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - User: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - x-merge-category: filestorage - RemoteKey: - type: object - description: |- - # 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: - type: string - example: Remote Deployment Key 1 - key: - type: string - example: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA - required: - - key - - name - x-merge-category: filestorage - RemoteKeyForRegenerationRequest: - type: object - description: |- - # The RemoteKeyForRegeneration Object - ### Description - The `RemoteKeyForRegeneration` object is used to exchange an old remote key for a new one - - ### Usage Example - Post a `RemoteKeyForRegeneration` to swap out an old remote key for a new one - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: filestorage - RemoteResponse: - type: object - description: |- - # 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: - type: string - example: GET - path: - type: string - example: /scooters - status: - type: integer - example: 200 - response: - example: - scooters: - - company: Lime - model: Gen 2.5 - - company: Bird - model: Bird Zero - response_headers: - type: object - additionalProperties: {} - example: - X-Page-Token: value - response_type: - oneOf: - - $ref: '#/components/schemas/ResponseTypeEnum' - - type: string - example: JSON - headers: - type: object - additionalProperties: {} - example: - EXTRA-HEADER: value - Authorization: - required: - - method - - path - - response - - status - x-merge-category: filestorage - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - type: string - description: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - x-merge-category: filestorage - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - type: string - description: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - x-merge-category: filestorage - RoleEnum: - enum: - - ADMIN - - DEVELOPER - - MEMBER - - API - - SYSTEM - - MERGE_TEAM - type: string - description: |- - * `ADMIN` - ADMIN - * `DEVELOPER` - DEVELOPER - * `MEMBER` - MEMBER - * `API` - API - * `SYSTEM` - SYSTEM - * `MERGE_TEAM` - MERGE_TEAM - x-merge-category: filestorage - RolesEnum: - enum: - - READ - - WRITE - - OWNER - type: string - description: |- - * `READ` - READ - * `WRITE` - WRITE - * `OWNER` - OWNER - x-merge-category: filestorage - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - type: string - description: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - x-merge-category: filestorage - StatusFd5Enum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: filestorage - SyncStatus: - type: object - description: |- - # 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: - type: string - example: File - model_id: - type: string - example: filestorage.FileStorageFile - last_sync_start: - type: string - format: date-time - example: '2021-03-30T19:44:18.695973Z' - next_sync_start: - type: string - format: date-time - example: '2021-03-30T20:44:18.662942Z' - last_sync_result: - oneOf: - - $ref: '#/components/schemas/LastSyncResultEnum' - - type: string - example: DONE - last_sync_finished: - type: string - format: date-time - example: '2021-03-30T19:55:18.695973Z' - status: - oneOf: - - $ref: '#/components/schemas/StatusFd5Enum' - - type: string - example: SYNCING - is_initial_sync: - type: boolean - example: true - selective_sync_configurations_usage: - $ref: '#/components/schemas/SelectiveSyncConfigurationsUsageEnum' - required: - - is_initial_sync - - model_id - - model_name - - status - x-merge-sample-json: '{"model_name": "Candidate", "model_id": "ats.Candidate", - "last_sync_start": "2021-03-30T19:44:18.695973Z", "next_sync_start": "2021-03-30T20:44:18.662942Z", - "status": "SYNCING", "is_initial_sync": true}' - x-merge-category: filestorage - TypeEnum: - enum: - - USER - - GROUP - - COMPANY - - ANYONE - type: string - description: |- - * `USER` - USER - * `GROUP` - GROUP - * `COMPANY` - COMPANY - * `ANYONE` - ANYONE - x-merge-category: filestorage - User: - type: object - description: |- - # The User Object - ### Description - The `User` object is used to represent a user within the File Storage account. - ### Usage Example - Fetch from the `GET /api/filestorage/v1/users` endpoint and view their users. - properties: - id: - type: string - format: uuid - readOnly: true - example: 83902e75-4362-4803-b76c-a7d6be292cbd - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '2039349' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The user's name. - maxLength: 254 - example: Gil Feig - email_address: - type: string - nullable: true - description: The user's email address. This is typically used to identify - a user across linked accounts. - maxLength: 2000 - example: hello@merge.dev - is_me: - type: boolean - description: Whether the user is the one who linked this account. - example: true - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /users - data: - - Varies by platform - x-merge-expands: '{"roles": "Role", "teams": "Team"}' - x-merge-category: filestorage - ValidationProblemSource: - type: object - properties: - pointer: - type: string - required: - - pointer - x-merge-category: filestorage - WarningValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /age - title: - type: string - example: Unrecognized Field - detail: - type: string - example: An unrecognized field, age, was passed in with request data. - problem_type: - type: string - example: UNRECOGNIZED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: filestorage - WebhookReceiver: - type: object - properties: - event: - type: string - is_active: - type: boolean - key: - type: string - required: - - event - - is_active - x-merge-category: filestorage - WebhookReceiverRequest: - type: object - properties: - event: - type: string - minLength: 1 - is_active: - type: boolean - key: - type: string - minLength: 1 - required: - - event - - is_active - x-merge-category: filestorage - securitySchemes: - tokenAuth: - type: http - scheme: bearer - description: Token-based authentication with required prefix "Bearer" - x-fern-token-variable-name: api_key -servers: -- url: https://api.merge.dev/api/filestorage/v1 - description: Production - x-fern-server-name: Production -- url: https://api-sandbox.merge.dev/api/filestorage/v1 - description: Sandbox - x-fern-server-name: Sandbox -- url: https://api-eu.merge.dev/api/filestorage/v1 - description: Production EU - x-fern-server-name: ProductionEU -- url: https://api-ap.merge.dev/api/filestorage/v1 - description: Production APSE1 - x-fern-server-name: ProductionAPSE1 diff --git a/.mock/hris_v3.yml b/.mock/hris_v3.yml deleted file mode 100644 index 0efa7fe6f..000000000 --- a/.mock/hris_v3.yml +++ /dev/null @@ -1,12079 +0,0 @@ -openapi: 3.0.3 -info: - title: Merge HRIS API - version: '1.0' - description: The unified API for building rich integrations with multiple HR Information - System platforms. - contact: - name: Merge Team - url: https://www.merge.dev/ - email: hello@merge.dev -paths: - /hris/v1/account-details: - get: - operationId: account_details_retrieve - description: Get details for a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - account-details - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountDetails' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/account-token/{public_token}: - get: - operationId: account_token_retrieve - description: Returns the account token for the end user with the provided public - token. - parameters: - - in: path - name: public_token - schema: - type: string - required: true - tags: - - account-token - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/async-passthrough: - post: - operationId: async_passthrough_create - description: Asynchronously pull data from an endpoint not currently supported - by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - async-passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncPassthroughReciept' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/async-passthrough/{async_passthrough_receipt_id}: - get: - operationId: async_passthrough_retrieve - description: Retrieves data from earlier async-passthrough POST request - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: async_passthrough_receipt_id - schema: - type: string - format: uuid - required: true - tags: - - async-passthrough - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/RemoteResponse' - - type: string - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/audit-trail: - get: - operationId: audit_trail_list - description: Gets a list of audit trail events. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include audit trail events that occurred - before this time - - in: query - name: event_type - schema: - type: string - description: '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`, - `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`' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include audit trail events that occurred - after this time - - in: query - name: user_email - schema: - type: string - description: 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. - tags: - - audit-trail - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAuditLogEventList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/available-actions: - get: - operationId: available_actions_retrieve - description: Returns a list of models and actions available for an account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - available-actions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AvailableActions' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/bank-info: - get: - operationId: bank_info_list - description: Returns a list of `BankInfo` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: account_type - schema: - type: string - nullable: true - enum: - - CHECKING - - SAVINGS - description: |- - If provided, will only return BankInfo's with this account type. Options: ('SAVINGS', 'CHECKING') - - * `SAVINGS` - SAVINGS - * `CHECKING` - CHECKING - - in: query - name: bank_name - schema: - type: string - nullable: true - description: If provided, will only return BankInfo's with this bank name. - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: employee_id - schema: - type: string - description: If provided, will only return bank accounts for this employee. - examples: - EmployeeId: - summary: employee_id - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: order_by - schema: - type: string - enum: - - -remote_created_at - - remote_created_at - x-fern-enum: - -remote_created_at: - name: RemoteCreatedAtDescending - remote_created_at: - name: RemoteCreatedAtAscending - description: 'Overrides the default ordering for this endpoint. Possible values - include: remote_created_at, -remote_created_at.' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - account_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesAccountType: - value: account_type - summary: Original Enum Values Account_type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - account_type - description: 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) - examples: - OriginalEnumValuesAccountType: - value: account_type - summary: Original Enum Values Account_type - tags: - - bank-info - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedBankInfoList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/bank-info/{id}: - get: - operationId: bank_info_retrieve - description: Returns a `BankInfo` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - account_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesAccountType: - value: account_type - summary: Original Enum Values Account_type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - account_type - description: 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) - examples: - OriginalEnumValuesAccountType: - value: account_type - summary: Original Enum Values Account_type - tags: - - bank-info - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BankInfo' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/benefits: - get: - operationId: benefits_list - description: Returns a list of `Benefit` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: employee_id - schema: - type: string - description: If provided, will return the benefits associated with the employee. - examples: - EmployeeId: - summary: employee_id - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - benefits - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedBenefitList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/benefits/{id}: - get: - operationId: benefits_retrieve - description: Returns a `Benefit` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - benefits - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Benefit' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/companies: - get: - operationId: companies_list - description: Returns a list of `Company` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - companies - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCompanyList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/companies/{id}: - get: - operationId: companies_retrieve - description: Returns a `Company` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - companies - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Company' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/default-scopes: - get: - operationId: default_scopes_retrieve - description: 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). - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/delete-account: - post: - operationId: delete_account_delete - description: Delete a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - delete-account - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/dependents: - get: - operationId: dependents_list - description: Returns a list of `Dependent` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_sensitive_fields - schema: - type: boolean - description: Whether to include sensitive fields (such as social security - numbers) in the response. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - dependents - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDependentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/dependents/{id}: - get: - operationId: dependents_retrieve - description: Returns a `Dependent` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_sensitive_fields - schema: - type: boolean - description: Whether to include sensitive fields (such as social security - numbers) in the response. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - dependents - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Dependent' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/employee-payroll-runs: - get: - operationId: employee_payroll_runs_list - description: Returns a list of `EmployeePayrollRun` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: employee_id - schema: - type: string - description: If provided, will only return employee payroll runs for this - employee. - examples: - EmployeeId: - summary: employee_id - - in: query - name: ended_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employee payroll runs ended after - this datetime. - - in: query - name: ended_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employee payroll runs ended before - this datetime. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - - payroll_run - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee,PayrollRun: - value: employee,payroll_run - summary: Expand Employee, Payroll_run - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: payroll_run_id - schema: - type: string - description: If provided, will only return employee payroll runs for this - employee. - examples: - PayrollRunId: - summary: payroll_run_id - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: started_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employee payroll runs started after - this datetime. - - in: query - name: started_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employee payroll runs started before - this datetime. - tags: - - employee-payroll-runs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEmployeePayrollRunList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/employee-payroll-runs/{id}: - get: - operationId: employee_payroll_runs_retrieve - description: Returns an `EmployeePayrollRun` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - - payroll_run - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee,PayrollRun: - value: employee,payroll_run - summary: Expand Employee, Payroll_run - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - employee-payroll-runs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EmployeePayrollRun' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/employees: - get: - operationId: employees_list - description: Returns a list of `Employee` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: company_id - schema: - type: string - description: If provided, will only return employees for this company. - examples: - CompanyId: - summary: company_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: display_full_name - schema: - type: string - nullable: true - description: If provided, will only return employees with this display name. - - in: query - name: employment_status - schema: - type: string - nullable: true - enum: - - ACTIVE - - INACTIVE - - PENDING - description: |- - If provided, will only return employees with this employment status. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - - in: query - name: employment_type - schema: - type: string - description: If provided, will only return employees that have an employment - of the specified employment_type. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - - employments - - groups - - home_location - - manager - - pay_group - - team - - work_location - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployments,Groups,HomeLocation,WorkLocation,Manager,Team,Company,PayGroup: - value: employments,groups,home_location,work_location,manager,team,company,pay_group - summary: Expand Employments, Groups, Home_location, Work_location, Manager, - Team, Company, Pay_group - explode: false - - in: query - name: first_name - schema: - type: string - nullable: true - description: If provided, will only return employees with this first name. - - in: query - name: groups - schema: - type: string - description: If provided, will only return employees matching the group ids; - multiple groups can be separated by commas. - - in: query - name: home_location_id - schema: - type: string - description: If provided, will only return employees for this home location. - examples: - HomeLocationId: - summary: home_location_id - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_sensitive_fields - schema: - type: boolean - description: Whether to include sensitive fields (such as social security - numbers) in the response. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: job_title - schema: - type: string - description: If provided, will only return employees that have an employment - of the specified job_title. - - in: query - name: last_name - schema: - type: string - nullable: true - description: If provided, will only return employees with this last name. - - in: query - name: manager_id - schema: - type: string - description: If provided, will only return employees for this manager. - examples: - ManagerId: - summary: manager_id - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: pay_group_id - schema: - type: string - description: If provided, will only return employees for this pay group - examples: - PayGroupId: - summary: pay_group_id - - in: query - name: personal_email - schema: - type: string - format: email - nullable: true - description: If provided, will only return Employees with this personal email - - in: query - name: remote_fields - schema: - type: string - enum: - - employment_status - - employment_status,ethnicity - - employment_status,ethnicity,gender - - employment_status,ethnicity,gender,marital_status - - employment_status,ethnicity,marital_status - - employment_status,gender - - employment_status,gender,marital_status - - employment_status,marital_status - - ethnicity - - ethnicity,gender - - ethnicity,gender,marital_status - - ethnicity,marital_status - - gender - - gender,marital_status - - marital_status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesEmploymentStatus,Ethnicity,Gender,MaritalStatus: - value: employment_status,ethnicity,gender,marital_status - summary: Original Enum Values Employment_status, Ethnicity, Gender, Marital_status - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - employment_status - - employment_status,ethnicity - - employment_status,ethnicity,gender - - employment_status,ethnicity,gender,marital_status - - employment_status,ethnicity,marital_status - - employment_status,gender - - employment_status,gender,marital_status - - employment_status,marital_status - - ethnicity - - ethnicity,gender - - ethnicity,gender,marital_status - - ethnicity,marital_status - - gender - - gender,marital_status - - marital_status - description: 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) - examples: - OriginalEnumValuesEmploymentStatus,Ethnicity,Gender,MaritalStatus: - value: employment_status,ethnicity,gender,marital_status - summary: Original Enum Values Employment_status, Ethnicity, Gender, Marital_status - - in: query - name: started_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employees that started after this - datetime. - - in: query - name: started_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employees that started before this - datetime. - - in: query - name: team_id - schema: - type: string - description: If provided, will only return employees for this team. - examples: - TeamId: - summary: team_id - - in: query - name: terminated_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employees that were terminated - after this datetime. - - in: query - name: terminated_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employees that were terminated - before this datetime. - - in: query - name: work_email - schema: - type: string - format: email - nullable: true - description: If provided, will only return Employees with this work email - - in: query - name: work_location_id - schema: - type: string - description: If provided, will only return employees for this location. - examples: - WorkLocationId: - summary: work_location_id - tags: - - employees - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEmployeeList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: employees_create - description: Creates an `Employee` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - employees - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EmployeeEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EmployeeEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EmployeeEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/EmployeeResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/employees/{id}: - get: - operationId: employees_retrieve - description: Returns an `Employee` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - company - - employments - - groups - - home_location - - manager - - pay_group - - team - - work_location - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployments,Groups,HomeLocation,WorkLocation,Manager,Team,Company,PayGroup: - value: employments,groups,home_location,work_location,manager,team,company,pay_group - summary: Expand Employments, Groups, Home_location, Work_location, Manager, - Team, Company, Pay_group - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_sensitive_fields - schema: - type: boolean - description: Whether to include sensitive fields (such as social security - numbers) in the response. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - employment_status - - employment_status,ethnicity - - employment_status,ethnicity,gender - - employment_status,ethnicity,gender,marital_status - - employment_status,ethnicity,marital_status - - employment_status,gender - - employment_status,gender,marital_status - - employment_status,marital_status - - ethnicity - - ethnicity,gender - - ethnicity,gender,marital_status - - ethnicity,marital_status - - gender - - gender,marital_status - - marital_status - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesEmploymentStatus,Ethnicity,Gender,MaritalStatus: - value: employment_status,ethnicity,gender,marital_status - summary: Original Enum Values Employment_status, Ethnicity, Gender, Marital_status - - in: query - name: show_enum_origins - schema: - type: string - enum: - - employment_status - - employment_status,ethnicity - - employment_status,ethnicity,gender - - employment_status,ethnicity,gender,marital_status - - employment_status,ethnicity,marital_status - - employment_status,gender - - employment_status,gender,marital_status - - employment_status,marital_status - - ethnicity - - ethnicity,gender - - ethnicity,gender,marital_status - - ethnicity,marital_status - - gender - - gender,marital_status - - marital_status - description: 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) - examples: - OriginalEnumValuesEmploymentStatus,Ethnicity,Gender,MaritalStatus: - value: employment_status,ethnicity,gender,marital_status - summary: Original Enum Values Employment_status, Ethnicity, Gender, Marital_status - tags: - - employees - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Employee' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/employees/ignore/{model_id}: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: model_id - schema: - type: string - format: uuid - required: true - tags: - - employees - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/IgnoreCommonModelRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-extra-tags: - - ignore-model - /hris/v1/employees/meta/post: - get: - operationId: employees_meta_post_retrieve - description: Returns metadata for `Employee` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - employees - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/employer-benefits: - get: - operationId: employer_benefits_list - description: Returns a list of `EmployerBenefit` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - employer-benefits - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEmployerBenefitList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/employer-benefits/{id}: - get: - operationId: employer_benefits_retrieve - description: Returns an `EmployerBenefit` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - employer-benefits - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EmployerBenefit' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/employments: - get: - operationId: employments_list - description: Returns a list of `Employment` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: employee_id - schema: - type: string - description: If provided, will only return employments for this employee. - examples: - EmployeeId: - summary: employee_id - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - - pay_group - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee,PayGroup: - value: employee,pay_group - summary: Expand Employee, Pay_group - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: order_by - schema: - type: string - enum: - - -effective_date - - effective_date - x-fern-enum: - -effective_date: - name: EffectiveDateDescending - effective_date: - name: EffectiveDateAscending - description: 'Overrides the default ordering for this endpoint. Possible values - include: effective_date, -effective_date.' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - employment_type - - employment_type,flsa_status - - employment_type,flsa_status,pay_frequency - - employment_type,flsa_status,pay_frequency,pay_period - - employment_type,flsa_status,pay_period - - employment_type,pay_frequency - - employment_type,pay_frequency,pay_period - - employment_type,pay_period - - flsa_status - - flsa_status,pay_frequency - - flsa_status,pay_frequency,pay_period - - flsa_status,pay_period - - pay_frequency - - pay_frequency,pay_period - - pay_period - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesEmploymentType,FlsaStatus,PayFrequency,PayPeriod: - value: employment_type,flsa_status,pay_frequency,pay_period - summary: Original Enum Values Employment_type, Flsa_status, Pay_frequency, - Pay_period - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - employment_type - - employment_type,flsa_status - - employment_type,flsa_status,pay_frequency - - employment_type,flsa_status,pay_frequency,pay_period - - employment_type,flsa_status,pay_period - - employment_type,pay_frequency - - employment_type,pay_frequency,pay_period - - employment_type,pay_period - - flsa_status - - flsa_status,pay_frequency - - flsa_status,pay_frequency,pay_period - - flsa_status,pay_period - - pay_frequency - - pay_frequency,pay_period - - pay_period - description: 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) - examples: - OriginalEnumValuesEmploymentType,FlsaStatus,PayFrequency,PayPeriod: - value: employment_type,flsa_status,pay_frequency,pay_period - summary: Original Enum Values Employment_type, Flsa_status, Pay_frequency, - Pay_period - tags: - - employments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedEmploymentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/employments/{id}: - get: - operationId: employments_retrieve - description: Returns an `Employment` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - - pay_group - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee,PayGroup: - value: employee,pay_group - summary: Expand Employee, Pay_group - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - employment_type - - employment_type,flsa_status - - employment_type,flsa_status,pay_frequency - - employment_type,flsa_status,pay_frequency,pay_period - - employment_type,flsa_status,pay_period - - employment_type,pay_frequency - - employment_type,pay_frequency,pay_period - - employment_type,pay_period - - flsa_status - - flsa_status,pay_frequency - - flsa_status,pay_frequency,pay_period - - flsa_status,pay_period - - pay_frequency - - pay_frequency,pay_period - - pay_period - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesEmploymentType,FlsaStatus,PayFrequency,PayPeriod: - value: employment_type,flsa_status,pay_frequency,pay_period - summary: Original Enum Values Employment_type, Flsa_status, Pay_frequency, - Pay_period - - in: query - name: show_enum_origins - schema: - type: string - enum: - - employment_type - - employment_type,flsa_status - - employment_type,flsa_status,pay_frequency - - employment_type,flsa_status,pay_frequency,pay_period - - employment_type,flsa_status,pay_period - - employment_type,pay_frequency - - employment_type,pay_frequency,pay_period - - employment_type,pay_period - - flsa_status - - flsa_status,pay_frequency - - flsa_status,pay_frequency,pay_period - - flsa_status,pay_period - - pay_frequency - - pay_frequency,pay_period - - pay_period - description: 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) - examples: - OriginalEnumValuesEmploymentType,FlsaStatus,PayFrequency,PayPeriod: - value: employment_type,flsa_status,pay_frequency,pay_period - summary: Original Enum Values Employment_type, Flsa_status, Pay_frequency, - Pay_period - tags: - - employments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Employment' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/field-mappings: - get: - operationId: field_mappings_retrieve - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingApiInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: field_mappings_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/field-mappings/{field_mapping_id}: - patch: - operationId: field_mappings_partial_update - 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - delete: - operationId: field_mappings_destroy - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '204': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/generate-key: - post: - operationId: generate_key_create - description: Create a remote key. - tags: - - generate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/groups: - get: - operationId: groups_list - description: Returns a list of `Group` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_commonly_used_as_team - schema: - type: string - description: 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. - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: names - schema: - type: string - description: If provided, will only return groups with these names. Multiple - values can be separated by commas. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - type - description: 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) - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - - in: query - name: types - schema: - type: string - description: If provided, will only return groups of these types. Multiple - values can be separated by commas. - tags: - - groups - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedGroupList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/groups/{id}: - get: - operationId: groups_retrieve - description: Returns a `Group` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - type - description: 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) - examples: - OriginalEnumValuesType: - value: type - summary: Original Enum Values Type - tags: - - groups - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Group' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/issues: - get: - operationId: issues_list - description: Gets all issues for Organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: account_token - schema: - type: string - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred before this time - - in: query - name: end_user_organization_name - schema: - type: string - - in: query - name: first_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was after this datetime. - - in: query - name: first_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was before this datetime. - - in: query - name: include_muted - schema: - type: string - description: If true, will include muted issues - - in: query - name: integration_name - schema: - type: string - - in: query - name: last_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was after this datetime. - - in: query - name: last_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was before this datetime. - - in: query - name: linked_account_id - schema: - type: string - description: If provided, will only include issues pertaining to the linked - account passed in. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred after this time - - in: query - name: status - schema: - type: string - enum: - - ONGOING - - RESOLVED - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedIssueList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/issues/{id}: - get: - operationId: issues_retrieve - description: Get a specific issue. - parameters: - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Issue' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/link-token: - post: - operationId: link_token_create - description: Creates a link token to be used when linking a new end user. - tags: - - link-token - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LinkToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/linked-account-scopes: - get: - operationId: linked_account_scopes_retrieve - 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). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: linked_account_scopes_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/linked-accounts: - get: - operationId: linked_accounts_list - description: List linked accounts for your organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: category - schema: - type: string - nullable: true - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - description: |- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` - - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_user_email_address - schema: - type: string - description: If provided, will only return linked accounts associated with - the given email address. - - in: query - name: end_user_organization_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given organization name. - - in: query - name: end_user_origin_id - schema: - type: string - description: If provided, will only return linked accounts associated with - the given origin ID. - - in: query - name: end_user_origin_ids - schema: - type: string - description: Comma-separated list of EndUser origin IDs, making it possible - to specify multiple EndUsers at once. - - in: query - name: id - schema: - type: string - format: uuid - - in: query - name: ids - schema: - type: string - description: Comma-separated list of LinkedAccount IDs, making it possible - to specify multiple LinkedAccounts at once. - - in: query - name: include_duplicates - schema: - type: boolean - description: 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. - - in: query - name: integration_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given integration name. - - in: query - name: is_test_account - schema: - type: string - description: If included, will only include test linked accounts. If not included, - will only include non-test linked accounts. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: status - schema: - type: string - description: 'Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, - `RELINK_NEEDED`' - tags: - - linked-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountDetailsAndActionsList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/locations: - get: - operationId: locations_list - description: Returns a list of `Location` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: location_type - schema: - type: string - nullable: true - enum: - - HOME - - WORK - description: |- - If provided, will only return locations with this location_type - - * `HOME` - HOME - * `WORK` - WORK - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - country - - country,location_type - - location_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesCountry,LocationType: - value: country,location_type - summary: Original Enum Values Country, Location_type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - country - - country,location_type - - location_type - description: 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) - examples: - OriginalEnumValuesCountry,LocationType: - value: country,location_type - summary: Original Enum Values Country, Location_type - tags: - - locations - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedLocationList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/locations/{id}: - get: - operationId: locations_retrieve - description: Returns a `Location` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - country - - country,location_type - - location_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesCountry,LocationType: - value: country,location_type - summary: Original Enum Values Country, Location_type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - country - - country,location_type - - location_type - description: 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) - examples: - OriginalEnumValuesCountry,LocationType: - value: country,location_type - summary: Original Enum Values Country, Location_type - tags: - - locations - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Location' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/passthrough: - post: - operationId: passthrough_create - description: Pull data from an endpoint not currently supported by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/pay-groups: - get: - operationId: pay_groups_list - description: Returns a list of `PayGroup` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - pay-groups - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedPayGroupList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/pay-groups/{id}: - get: - operationId: pay_groups_retrieve - description: Returns a `PayGroup` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - pay-groups - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PayGroup' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/payroll-runs: - get: - operationId: payroll_runs_list - description: Returns a list of `PayrollRun` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: ended_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return payroll runs ended after this datetime. - - in: query - name: ended_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return payroll runs ended before this - datetime. - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - run_state - - run_state,run_type - - run_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesRunState,RunType: - value: run_state,run_type - summary: Original Enum Values Run_state, Run_type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: run_type - schema: - type: string - nullable: true - enum: - - CORRECTION - - OFF_CYCLE - - REGULAR - - SIGN_ON_BONUS - - TERMINATION - description: |- - If provided, will only return PayrollRun's with this status. Options: ('REGULAR', 'OFF_CYCLE', 'CORRECTION', 'TERMINATION', 'SIGN_ON_BONUS') - - * `REGULAR` - REGULAR - * `OFF_CYCLE` - OFF_CYCLE - * `CORRECTION` - CORRECTION - * `TERMINATION` - TERMINATION - * `SIGN_ON_BONUS` - SIGN_ON_BONUS - - in: query - name: show_enum_origins - schema: - type: string - enum: - - run_state - - run_state,run_type - - run_type - description: 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) - examples: - OriginalEnumValuesRunState,RunType: - value: run_state,run_type - summary: Original Enum Values Run_state, Run_type - - in: query - name: started_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return payroll runs started after this - datetime. - - in: query - name: started_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return payroll runs started before this - datetime. - tags: - - payroll-runs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedPayrollRunList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/payroll-runs/{id}: - get: - operationId: payroll_runs_retrieve - description: Returns a `PayrollRun` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - run_state - - run_state,run_type - - run_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesRunState,RunType: - value: run_state,run_type - summary: Original Enum Values Run_state, Run_type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - run_state - - run_state,run_type - - run_type - description: 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) - examples: - OriginalEnumValuesRunState,RunType: - value: run_state,run_type - summary: Original Enum Values Run_state, Run_type - tags: - - payroll-runs - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PayrollRun' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/regenerate-key: - post: - operationId: regenerate_key_create - description: Exchange remote keys. - tags: - - regenerate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/remote-fields: - get: - operationId: 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: common_models - schema: - type: string - description: A comma seperated list of Common Model names. If included, will - only return Remote Fields for those Common Models. - - in: query - name: include_example_values - schema: - type: string - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/sync-status: - get: - operationId: 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). - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - sync-status - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedSyncStatusList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/sync-status/resync: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - force-resync - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/target-fields: - get: - operationId: target_fields_retrieve - 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalTargetFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/teams: - get: - operationId: teams_list - description: Returns a list of `Team` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - parent_team - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandParentTeam: - value: parent_team - summary: Expand Parent_team - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: parent_team_id - schema: - type: string - description: If provided, will only return teams with this parent team. - examples: - ParentTeamId: - summary: parent_team_id - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - teams - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTeamList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/teams/{id}: - get: - operationId: teams_retrieve - description: Returns a `Team` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - parent_team - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandParentTeam: - value: parent_team - summary: Expand Parent_team - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - teams - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Team' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/time-off: - get: - operationId: time_off_list - description: Returns a list of `TimeOff` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: approver_id - schema: - type: string - description: If provided, will only return time off for this approver. - examples: - ApproverId: - summary: approver_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: employee_id - schema: - type: string - description: If provided, will only return time off for this employee. - examples: - EmployeeId: - summary: employee_id - - in: query - name: ended_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return employees that ended after this - datetime. - - in: query - name: ended_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return time-offs that ended before this - datetime. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - approver - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee,Approver: - value: employee,approver - summary: Expand Employee, Approver - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_fields - schema: - type: string - enum: - - request_type - - request_type,status - - request_type,status,units - - request_type,units - - status - - status,units - - units - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesRequestType,Status,Units: - value: request_type,status,units - summary: Original Enum Values Request_type, Status, Units - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: request_type - schema: - type: string - nullable: true - enum: - - BEREAVEMENT - - JURY_DUTY - - PERSONAL - - SICK - - VACATION - - VOLUNTEER - description: |- - 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 - - in: query - name: show_enum_origins - schema: - type: string - enum: - - request_type - - request_type,status - - request_type,status,units - - request_type,units - - status - - status,units - - units - description: 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) - examples: - OriginalEnumValuesRequestType,Status,Units: - value: request_type,status,units - summary: Original Enum Values Request_type, Status, Units - - in: query - name: started_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return time-offs that started after this - datetime. - - in: query - name: started_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return time-offs that started before this - datetime. - - in: query - name: status - schema: - type: string - nullable: true - enum: - - APPROVED - - CANCELLED - - DECLINED - - DELETED - - REQUESTED - description: |- - 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 - tags: - - time-off - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTimeOffList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: time_off_create - description: Creates a `TimeOff` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - time-off - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TimeOffEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TimeOffEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/TimeOffEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TimeOffResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /hris/v1/time-off-balances: - get: - operationId: time_off_balances_list - description: Returns a list of `TimeOffBalance` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: employee_id - schema: - type: string - description: If provided, will only return time off balances for this employee. - examples: - EmployeeId: - summary: employee_id - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: policy_type - schema: - type: string - nullable: true - enum: - - BEREAVEMENT - - JURY_DUTY - - PERSONAL - - SICK - - VACATION - - VOLUNTEER - description: |- - 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 - - in: query - name: remote_fields - schema: - type: string - enum: - - policy_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesPolicyType: - value: policy_type - summary: Original Enum Values Policy_type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - policy_type - description: 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) - examples: - OriginalEnumValuesPolicyType: - value: policy_type - summary: Original Enum Values Policy_type - tags: - - time-off-balances - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTimeOffBalanceList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/time-off-balances/{id}: - get: - operationId: time_off_balances_retrieve - description: Returns a `TimeOffBalance` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - policy_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesPolicyType: - value: policy_type - summary: Original Enum Values Policy_type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - policy_type - description: 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) - examples: - OriginalEnumValuesPolicyType: - value: policy_type - summary: Original Enum Values Policy_type - tags: - - time-off-balances - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TimeOffBalance' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/time-off/{id}: - get: - operationId: time_off_retrieve - description: Returns a `TimeOff` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - approver - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee,Approver: - value: employee,approver - summary: Expand Employee, Approver - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - request_type - - request_type,status - - request_type,status,units - - request_type,units - - status - - status,units - - units - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesRequestType,Status,Units: - value: request_type,status,units - summary: Original Enum Values Request_type, Status, Units - - in: query - name: show_enum_origins - schema: - type: string - enum: - - request_type - - request_type,status - - request_type,status,units - - request_type,units - - status - - status,units - - units - description: 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) - examples: - OriginalEnumValuesRequestType,Status,Units: - value: request_type,status,units - summary: Original Enum Values Request_type, Status, Units - tags: - - time-off - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TimeOff' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/time-off/meta/post: - get: - operationId: time_off_meta_post_retrieve - description: Returns metadata for `TimeOff` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - time-off - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/timesheet-entries: - get: - operationId: timesheet_entries_list - description: Returns a list of `TimesheetEntry` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: employee_id - schema: - type: string - description: If provided, will only return timesheet entries for this employee. - examples: - EmployeeId: - summary: employee_id - - in: query - name: ended_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return timesheet entries ended after this - datetime. - - in: query - name: ended_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return timesheet entries ended before - this datetime. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: order_by - schema: - type: string - enum: - - -start_time - - start_time - x-fern-enum: - -start_time: - name: StartTimeDescending - start_time: - name: StartTimeAscending - description: 'Overrides the default ordering for this endpoint. Possible values - include: start_time, -start_time.' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: started_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return timesheet entries started after - this datetime. - - in: query - name: started_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return timesheet entries started before - this datetime. - tags: - - timesheet-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTimesheetEntryList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: timesheet_entries_create - description: Creates a `TimesheetEntry` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - timesheet-entries - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TimesheetEntryEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TimesheetEntryEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/TimesheetEntryEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TimesheetEntryResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/timesheet-entries/{id}: - get: - operationId: timesheet_entries_retrieve - description: Returns a `TimesheetEntry` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - employee - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandEmployee: - value: employee - summary: Expand Employee - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - timesheet-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TimesheetEntry' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/timesheet-entries/meta/post: - get: - operationId: timesheet_entries_meta_post_retrieve - description: Returns metadata for `TimesheetEntry` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - timesheet-entries - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /hris/v1/webhook-receivers: - get: - operationId: webhook_receivers_list - description: Returns a list of `WebhookReceiver` objects. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: webhook_receivers_create - description: Creates a `WebhookReceiver` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC -components: - schemas: - AccountDetails: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - integration: - type: string - readOnly: true - example: BambooHR - integration_slug: - type: string - readOnly: true - example: bamboohr - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - nullable: true - example: hris - end_user_origin_id: - type: string - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - end_user_organization_name: - type: string - readOnly: true - example: Waystar Royco - end_user_email_address: - type: string - format: email - readOnly: true - example: kendall.roy@waystar-royco.com - status: - type: string - readOnly: true - example: COMPLETE - webhook_listener_url: - type: string - format: uri - readOnly: true - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - readOnly: true - description: 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. - example: true - account_type: - type: string - readOnly: true - example: PRODUCTION - completed_at: - type: string - format: date-time - nullable: true - description: The time at which account completes the linking flow. - example: '2024-08-26T20:11:19.277118Z' - x-merge-category: hris - AccountDetailsAndActions: - type: object - description: |- - # 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: - type: string - example: e59b1821-f85c-4e28-a6b3-1804156f3563 - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - example: hris - status: - oneOf: - - $ref: '#/components/schemas/AccountDetailsAndActionsStatusEnum' - - type: string - example: INCOMPLETE - status_detail: - type: string - example: Invalid login credentials - end_user_origin_id: - type: string - example: 3ac95cde-6c7f-4eef-afec-be710b42308d - end_user_organization_name: - type: string - example: Foo Bar, LLC - end_user_email_address: - type: string - example: hradmin@foobar.dev - subdomain: - type: string - description: The tenant or domain the customer has provided access to. - example: foobar - webhook_listener_url: - type: string - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - description: 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. - example: true - integration: - $ref: '#/components/schemas/AccountDetailsAndActionsIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - 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: - type: string - example: PRODUCTION - completed_at: - type: string - format: date-time - example: '2024-08-26T20:11:19.277118Z' - required: - - account_type - - completed_at - - end_user_email_address - - end_user_organization_name - - id - - status - - webhook_listener_url - x-merge-sample-json: '{"id": "e59b1821-f85c-4e28-a6b3-1804156f3563", "category": - "hris", "status": "INCOMPLETE", "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", "webhook_listener_url": - "https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4", - "is_duplicate": true, "integration": {"name": "SAP SuccessFactors", "categories": - ["hris", "ats"], "image": "https://cdn.merge.dev/SuccessFactors_Logo.png", - "square_image": "https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg", "color": - "#F6A704", "slug": "sap-successfactors", "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"]}]}}' - x-merge-category: hris - AccountDetailsAndActionsIntegration: - type: object - properties: - name: - type: string - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - image: - type: string - square_image: - type: string - color: - type: string - slug: - type: string - passthrough_available: - type: boolean - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - required: - - categories - - color - - name - - passthrough_available - - slug - x-merge-category: hris - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - type: string - description: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - x-merge-category: hris - AccountIntegration: - type: object - properties: - name: - type: string - description: Company name. - abbreviated_name: - type: string - nullable: true - description: "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: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: Category or categories this integration belongs to. Multiple - categories should be comma separated, i.e. [ats, hris]. - readOnly: true - image: - type: string - format: uri - nullable: true - description: Company logo in rectangular shape. - square_image: - type: string - format: uri - nullable: true - description: Company logo in square shape. - color: - type: string - description: The color of this integration used for buttons and text throughout - the app and landing pages. Choose a darker, saturated color. - pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ - maxLength: 18 - slug: - type: string - readOnly: true - api_endpoints_to_documentation_urls: - type: object - additionalProperties: {} - description: "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: string - nullable: true - description: Setup guide URL for third party webhook creation. Exposed in - Merge Docs. - category_beta_status: - type: object - description: Category or categories this integration is in beta status for. - readOnly: true - required: - - name - x-merge-category: hris - AccountToken: - type: object - properties: - account_token: - type: string - example: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB - integration: - $ref: '#/components/schemas/AccountIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - id: - type: string - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - required: - - account_token - - id - - integration - x-merge-category: hris - AccountTypeEnum: - enum: - - SAVINGS - - CHECKING - type: string - description: |- - * `SAVINGS` - SAVINGS - * `CHECKING` - CHECKING - x-merge-category: hris - AdvancedMetadata: - type: object - properties: - id: - type: string - format: uuid - display_name: - type: string - description: - type: string - is_required: - type: boolean - is_custom: - type: boolean - field_choices: - type: array - items: {} - required: - - id - x-merge-category: hris - AsyncPassthroughReciept: - type: object - properties: - async_passthrough_receipt_id: - type: string - format: uuid - example: fd29020f-2695-445e-922e-dcd5e81903fd - required: - - async_passthrough_receipt_id - x-merge-category: hris - AuditLogEvent: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: b5ceea2a-7171-47ce-8090-165cfce5572c - user_name: - type: string - nullable: true - description: The User's full name at the time of this Event occurring. - maxLength: 200 - example: Gil Feig - user_email: - type: string - format: email - nullable: true - description: The User's email at the time of this Event occurring. - maxLength: 254 - example: hello@merge.dev - role: - oneOf: - - $ref: '#/components/schemas/RoleEnum' - - type: string - description: |- - 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 - example: ADMIN - ip_address: - type: string - maxLength: 45 - example: 192.0.2.123 - event_type: - oneOf: - - $ref: '#/components/schemas/EventTypeEnum' - - type: string - description: |- - 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 - example: CHANGED_SCOPES - event_description: - type: string - example: Organization-wide Scopes for model hris.Employee updated from Read - to Read+Write - created_at: - type: string - format: date-time - readOnly: true - required: - - event_description - - event_type - - ip_address - - role - x-merge-category: hris - AvailableActions: - type: object - description: |- - # 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: - $ref: '#/components/schemas/AccountIntegration' - example: - name: Lever - categories: - - ats - image: https://merge-api-production.s3.amazonaws.com/media/Lever_Logo.png - square_image: https://merge-api-production.s3.amazonaws.com/media/Lever_Square_Logo.png - color: '#262A34' - is_in_beta: 'true' - api_endpoints_to_documentation_urls: "{'GET': [('/common-model-scopes', - 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve')], - 'POST': []}" - passthrough_available: - type: boolean - example: true - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - example: - - model_name: Candidate - available_operations: - - FETCH - - CREATE - required_post_parameters: - - remote_user_id - supported_fields: - - first_name - - last_name - - company - - title - required: - - integration - - passthrough_available - x-merge-category: hris - BankInfo: - type: object - description: |- - # The BankInfo Object - ### Description - The `BankInfo` object is used to represent the Bank Account information for an Employee. - - ### Usage Example - Fetch from the `LIST BankInfo` endpoint and filter by `ID` to show all bank information. - properties: - id: - type: string - format: uuid - readOnly: true - example: fd1e0fb5-8f92-4ec9-9f32-179cf732867d - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '123234' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee with this bank account. - example: a3617eb4-dfe3-426f-921e-a65fc1661e10 - x-merge-expands-to: Employee - account_number: - type: string - nullable: true - description: The account number. - maxLength: 100 - example: '439291590' - routing_number: - type: string - nullable: true - description: The routing number. - example: '089690059' - bank_name: - type: string - nullable: true - description: The bank name. - example: Chase - account_type: - oneOf: - - $ref: '#/components/schemas/AccountTypeEnum' - - type: string - nullable: true - description: |- - The bank account type - - * `SAVINGS` - SAVINGS - * `CHECKING` - CHECKING - example: CHECKING - remote_created_at: - type: string - format: date-time - nullable: true - description: When the matching bank object was created in the third party - system. - example: '2021-12-06T10:11:26Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /bank-info - data: - - Varies by platform - x-merge-expands: '{"employee": "Employee"}' - x-merge-category: hris - Benefit: - type: object - description: |- - # The Benefit Object - ### Description - The `Benefit` object is used to represent a benefit that an employee has enrolled in. - - ### Usage Example - Fetch from the `LIST Benefits` endpoint and filter by `ID` to show all benefits. - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fe5ae7a-f1ba-4529-b7af-84e86dc6d232 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee on the plan. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Employee - provider_name: - type: string - nullable: true - description: The name of the benefit provider. - example: Blue Shield of California - benefit_plan_type: - type: string - nullable: true - description: The type of benefit plan - deprecated: true - employee_contribution: - type: number - format: double - nullable: true - description: The employee's contribution. - example: 23.65 - company_contribution: - type: number - format: double - nullable: true - description: The company's contribution. - example: 150 - start_date: - type: string - format: date-time - nullable: true - description: The day and time the benefit started. - example: '2020-11-15 00:59:25.309761+00:00' - end_date: - type: string - format: date-time - nullable: true - description: The day and time the benefit ended. - example: '2021-10-15 00:23:25.309761+00:00' - remote_was_deleted: - type: boolean - readOnly: true - description: 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/). - employer_benefit: - type: string - format: uuid - nullable: true - description: The employer benefit plan the employee is enrolled in. - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - field_mappings: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /benefits - data: - - Varies by platform - x-merge-expands: '{"employee": "Employee"}' - x-merge-category: hris - BenefitPlanTypeEnum: - enum: - - MEDICAL - - HEALTH_SAVINGS - - INSURANCE - - RETIREMENT - - OTHER - type: string - description: |- - * `MEDICAL` - MEDICAL - * `HEALTH_SAVINGS` - HEALTH_SAVINGS - * `INSURANCE` - INSURANCE - * `RETIREMENT` - RETIREMENT - * `OTHER` - OTHER - x-merge-category: hris - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: hris - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: hris - CommonModelScopeAPI: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializer' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: hris - CommonModelScopesBodyRequest: - type: object - properties: - model_id: - type: string - minLength: 1 - example: hris.Employee - enabled_actions: - type: array - items: - $ref: '#/components/schemas/EnabledActionsEnum' - example: - - READ - - WRITE - disabled_fields: - type: array - items: - type: string - minLength: 1 - example: - - first_name - required: - - disabled_fields - - enabled_actions - - model_id - x-merge-category: hris - Company: - type: object - description: |- - # The Company Object - ### Description - The `Company` object is used to represent a company within the HRIS / Payroll system. - - ### Usage Example - Fetch from the `LIST Companies` endpoint and filter by `ID` to show all companies. - properties: - id: - type: string - format: uuid - readOnly: true - example: 1b998423-db0a-4037-a4cf-f79c60cb67b3 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - legal_name: - type: string - nullable: true - description: The company's legal name. - example: Waystar Royco, Inc. - display_name: - type: string - nullable: true - description: The company's display name. - example: Waystar Royco - eins: - type: array - items: - type: string - nullable: true - nullable: true - description: The company's Employer Identification Numbers. - example: - - 12-3456789 - - 12-3451111 - - 11-0011000 - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /companies - data: - - Varies by platform - x-merge-category: hris - CountryEnum: - enum: - - AF - - AX - - AL - - DZ - - AS - - AD - - AO - - AI - - AQ - - AG - - AR - - AM - - AW - - AU - - AT - - AZ - - BS - - BH - - BD - - BB - - BY - - BE - - BZ - - BJ - - BM - - BT - - BO - - BQ - - BA - - BW - - BV - - BR - - IO - - BN - - BG - - BF - - BI - - CV - - KH - - CM - - CA - - KY - - CF - - TD - - CL - - CN - - CX - - CC - - CO - - KM - - CG - - CD - - CK - - CR - - CI - - HR - - CU - - CW - - CY - - CZ - - DK - - DJ - - DM - - DO - - EC - - EG - - SV - - GQ - - ER - - EE - - SZ - - ET - - FK - - FO - - FJ - - FI - - FR - - GF - - PF - - TF - - GA - - GM - - GE - - DE - - GH - - GI - - GR - - GL - - GD - - GP - - GU - - GT - - GG - - GN - - GW - - GY - - HT - - HM - - VA - - HN - - HK - - HU - - IS - - IN - - ID - - IR - - IQ - - IE - - IM - - IL - - IT - - JM - - JP - - JE - - JO - - KZ - - KE - - KI - - KW - - KG - - LA - - LV - - LB - - LS - - LR - - LY - - LI - - LT - - LU - - MO - - MG - - MW - - MY - - MV - - ML - - MT - - MH - - MQ - - MR - - MU - - YT - - MX - - FM - - MD - - MC - - MN - - ME - - MS - - MA - - MZ - - MM - - NA - - NR - - NP - - NL - - NC - - NZ - - NI - - NE - - NG - - NU - - NF - - KP - - MK - - MP - - NO - - OM - - PK - - PW - - PS - - PA - - PG - - PY - - PE - - PH - - PN - - PL - - PT - - PR - - QA - - RE - - RO - - RU - - RW - - BL - - SH - - KN - - LC - - MF - - PM - - VC - - WS - - SM - - ST - - SA - - SN - - RS - - SC - - SL - - SG - - SX - - SK - - SI - - SB - - SO - - ZA - - GS - - KR - - SS - - ES - - LK - - SD - - SR - - SJ - - SE - - CH - - SY - - TW - - TJ - - TZ - - TH - - TL - - TG - - TK - - TO - - TT - - TN - - TR - - TM - - TC - - TV - - UG - - UA - - AE - - GB - - UM - - US - - UY - - UZ - - VU - - VE - - VN - - VG - - VI - - WF - - EH - - YE - - ZM - - ZW - type: string - description: |- - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - x-merge-category: hris - CreateFieldMappingRequest: - type: object - properties: - target_field_name: - type: string - minLength: 1 - description: The name of the target field you want this remote field to - map to. - example: example_target_field_name - target_field_description: - type: string - minLength: 1 - description: The description of the target field you want this remote field - to map to. - example: this is a example description of the target field - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - common_model_name: - type: string - minLength: 1 - description: The name of the Common Model that the remote field corresponds - to in a given category. - example: ExampleCommonModel - required: - - common_model_name - - remote_field_traversal_path - - remote_method - - remote_url_path - - target_field_description - - target_field_name - x-merge-category: hris - DataPassthroughRequest: - type: object - description: |- - # 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: - allOf: - - $ref: '#/components/schemas/MethodEnum' - example: POST - path: - type: string - minLength: 1 - description: The path of the request in the third party's platform. - example: /scooters - base_url_override: - type: string - nullable: true - minLength: 1 - description: An optional override of the third party's base url for the - request. - example: https://api.example.com - data: - type: string - nullable: true - minLength: 1 - description: The data with the request. You must include a `request_format` - parameter matching the data's format - example: '{"company": "Lime", "model": "Gen 2.5"}' - multipart_form_data: - type: array - items: - $ref: '#/components/schemas/MultipartFormFieldRequest' - nullable: true - description: Pass an array of `MultipartFormField` objects in here instead - of using the `data` param if `request_format` is set to `MULTIPART`. - headers: - type: object - additionalProperties: {} - nullable: true - description: 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. - example: - EXTRA-HEADER: value - request_format: - allOf: - - $ref: '#/components/schemas/RequestFormatEnum' - nullable: true - example: JSON - normalize_response: - type: boolean - description: '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`.' - required: - - method - - path - x-merge-category: hris - DebugModeLog: - type: object - properties: - log_id: - type: string - example: 99433219-8017-4acd-bb3c-ceb23d663832 - dashboard_view: - type: string - example: https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 - log_summary: - $ref: '#/components/schemas/DebugModelLogSummary' - example: - url: www.exampleintegration.com/api/v1/exampleapi - method: POST - status_code: 200 - required: - - dashboard_view - - log_id - - log_summary - x-merge-sample-json: '{"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}}' - x-merge-category: hris - DebugModelLogSummary: - type: object - properties: - url: - type: string - example: www.exampleintegration.com/api/v1/exampleapi - method: - type: string - example: POST - status_code: - type: integer - example: 200 - required: - - method - - status_code - - url - x-merge-sample-json: '{"url": "www.exampleintegration.com/api/v1/exampleapi", - "method": "POST", "status_code": 200}' - x-merge-category: hris - Deduction: - type: object - description: |- - # The Deduction Object - ### Description - The `Deduction` object is used to represent an array of the wages withheld from total earnings for the purpose of paying taxes. - - ### Usage Example - Fetch from the `LIST Deductions` endpoint and filter by `ID` to show all deductions. - properties: - id: - type: string - format: uuid - readOnly: true - example: 5fd439fc-1b64-4755-b275-64918936c365 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '93478612' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee_payroll_run: - type: string - format: uuid - nullable: true - example: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: - type: string - nullable: true - description: The deduction's name. - example: Social Security - employee_deduction: - type: number - format: double - nullable: true - description: The amount of money that is withheld from an employee's gross - pay by the employee. - example: 34.54 - company_deduction: - type: number - format: double - nullable: true - description: The amount of money that is withheld on behalf of an employee - by the company. - example: 78.78 - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /payroll-deduction - data: - - Varies by platform - x-merge-nested-write-allowed: true - x-merge-category: hris - Dependent: - type: object - description: |- - # The Dependent Object - ### Description - The `Dependent` object is used to represent a dependent (e.g. child, spouse, domestic partner, etc) of an `Employee` - - ### Usage Example - Fetch from the `LIST Dependents` endpoint and filter by `ID` to show all dependents. - properties: - id: - type: string - format: uuid - readOnly: true - example: 025fjlc6-6000-430a-848e-aafacbadf4fe - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202940' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - first_name: - type: string - nullable: true - description: The dependents's first name. - maxLength: 60 - example: Greg - middle_name: - type: string - nullable: true - description: The dependents's middle name. - maxLength: 60 - example: A - last_name: - type: string - nullable: true - description: The dependents's last name. - maxLength: 60 - example: Hirsch - relationship: - oneOf: - - $ref: '#/components/schemas/RelationshipEnum' - - type: string - nullable: true - description: |- - The dependent's relationship to the employee. - - * `CHILD` - CHILD - * `SPOUSE` - SPOUSE - * `DOMESTIC_PARTNER` - DOMESTIC_PARTNER - example: CHILD - employee: - type: string - format: uuid - nullable: true - description: The employee this person is a dependent of. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - date_of_birth: - type: string - format: date-time - nullable: true - description: The dependent's date of birth. - example: '1990-11-10T00:00:00Z' - gender: - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - type: string - nullable: true - description: |- - The dependent's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - example: MALE - phone_number: - type: string - nullable: true - description: The dependent's phone number. - maxLength: 50 - example: '+1234567890' - home_location: - type: string - format: uuid - nullable: true - description: The dependents's home address. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - is_student: - type: boolean - nullable: true - description: Whether or not the dependent is a student - ssn: - type: string - nullable: true - description: The dependents's social security number. - maxLength: 50 - example: '1234567890' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /dependent - data: - - Varies by platform - x-merge-category: hris - Earning: - type: object - description: |- - # The Earning Object - ### Description - The `Earning` object is used to represent an array of different compensations that an employee receives within specific wage categories. - - ### Usage Example - Fetch from the `LIST Earnings` endpoint and filter by `ID` to show all earnings. - properties: - id: - type: string - format: uuid - readOnly: true - example: babbced6-3a81-4775-8da2-490dc6385259 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '52802' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee_payroll_run: - type: string - format: uuid - nullable: true - example: 35347df1-95e7-46e2-93cc-66f1191edca5 - amount: - type: number - format: double - nullable: true - description: The amount earned. - example: 1002.34 - type: - oneOf: - - $ref: '#/components/schemas/EarningTypeEnum' - - type: string - nullable: true - description: |- - The type of earning. - - * `SALARY` - SALARY - * `REIMBURSEMENT` - REIMBURSEMENT - * `OVERTIME` - OVERTIME - * `BONUS` - BONUS - example: SALARY - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-nested-write-allowed: true - x-merge-category: hris - EarningTypeEnum: - enum: - - SALARY - - REIMBURSEMENT - - OVERTIME - - BONUS - type: string - description: |- - * `SALARY` - SALARY - * `REIMBURSEMENT` - REIMBURSEMENT - * `OVERTIME` - OVERTIME - * `BONUS` - BONUS - x-merge-category: hris - Employee: - type: object - description: |- - # The Employee Object - ### Description - The `Employee` object is used to represent any person who has been employed by a company. By default, it returns all employees. To filter for only active employees, set the `employment_status` query parameter to `ACTIVE`. - - ### Usage Example - Fetch from the `LIST Employee` endpoint and filter by `ID` to show all employees. - properties: - id: - type: string - format: uuid - readOnly: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee_number: - type: string - nullable: true - description: The employee's number that appears in the third-party integration's - UI. - example: '2' - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Company' - nullable: true - description: The ID of the employee's company. - example: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - x-merge-expands-to: Company - first_name: - type: string - nullable: true - description: The employee's first name. - example: Greg - last_name: - type: string - nullable: true - description: The employee's last name. - example: Hirsch - preferred_name: - type: string - nullable: true - description: The employee's preferred first name. - example: Greg the egg - display_full_name: - type: string - nullable: true - description: The employee's full name, to use for display purposes. If a - preferred first name is available, the full name will include the preferred - first name. - example: Cousin Greg Hirsch - username: - type: string - nullable: true - description: The employee's username that appears in the remote UI. - example: cousingreg - groups: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Group' - nullable: true - example: - - 21a54124-397f-494d-985e-3c5b330b8a68 - x-merge-expands-to: Group - work_email: - type: string - format: email - nullable: true - description: The employee's work email. - maxLength: 254 - example: greg@merge.dev - personal_email: - type: string - format: email - nullable: true - description: The employee's personal email. - maxLength: 254 - example: greg@gmail.com - mobile_phone_number: - type: string - nullable: true - description: The employee's mobile phone number. - example: '+1234567890' - employments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employment' - nullable: true - example: - - 17a54124-287f-494d-965e-3c5b330c9a68 - description: Array of `Employment` IDs for this Employee. - x-merge-expands-to: Employment - home_location: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Location' - nullable: true - description: The employee's home address. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Location - work_location: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Location' - nullable: true - description: The employee's work address. - example: 9efbc633-3387-4306-aa55-e2c635e6bb4f - x-merge-expands-to: Location - manager: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee ID of the employee's manager. - example: 0048ea5b-911e-4dff-9364-92070dea62ff - x-merge-expands-to: Employee - team: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Team' - nullable: true - description: The employee's team. - deprecated: true - x-merge-expands-to: Team - pay_group: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PayGroup' - nullable: true - description: The employee's pay group - example: ad1264e2-39be-4787-b749-f1aade9e3405 - x-merge-expands-to: PayGroup - ssn: - type: string - nullable: true - description: The employee's social security number. - maxLength: 100 - example: '1234567890' - gender: - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - type: string - nullable: true - description: |- - The employee's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - example: MALE - ethnicity: - oneOf: - - $ref: '#/components/schemas/EthnicityEnum' - - type: string - nullable: true - description: |- - The employee's ethnicity. - - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - * `WHITE` - WHITE - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - example: WHITE - marital_status: - oneOf: - - $ref: '#/components/schemas/MaritalStatusEnum' - - type: string - nullable: true - description: |- - The employee's filing status as related to marital status. - - * `SINGLE` - SINGLE - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - example: SINGLE - date_of_birth: - type: string - format: date-time - nullable: true - description: The employee's date of birth. - example: '1990-11-10T00:00:00Z' - hire_date: - type: string - format: date-time - nullable: true - description: "The date that the employee was hired, usually the day that - an offer letter is signed. If an employee has multiple hire dates from - previous employments, this represents the most recent hire date. Note: - If you're looking for the employee's start date, refer to the start_date - field." - deprecated: true - example: '2020-10-10T00:00:00Z' - start_date: - type: string - format: date-time - nullable: true - description: The date that the employee started working. If an employee - was rehired, the most recent start date will be returned. - example: '2020-10-11T00:00:00Z' - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's employee was created. - example: '2020-10-11T00:00:00Z' - employment_status: - oneOf: - - $ref: '#/components/schemas/EmploymentStatusEnum' - - type: string - nullable: true - description: |- - The employment status of the employee. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - example: INACTIVE - termination_date: - type: string - format: date-time - nullable: true - description: The employee's termination date. - example: '2021-10-12T00:00:00Z' - avatar: - type: string - format: uri - nullable: true - maxLength: 2000 - example: http://alturl.com/h2h8m - description: The URL of the employee's avatar image. - custom_fields: - type: object - additionalProperties: {} - nullable: true - description: Custom fields configured for a given model. - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /people - data: - - Varies by platform - x-merge-expands: '{"company": "Company", "employments": "Employment", "groups": - "Group", "home_location": "Location", "manager": "Employee", "pay_group": - "PayGroup", "team": "Team", "work_location": "Location"}' - x-merge-category: hris - EmployeeEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/EmployeeRequest' - required: - - model - x-merge-category: hris - EmployeePayrollRun: - type: object - description: |- - # The EmployeePayrollRun Object - ### Description - The `EmployeePayrollRun` object is used to represent an employee's pay statement for a specific payroll run. - - ### Usage Example - Fetch from the `LIST EmployeePayrollRun` endpoint and filter by `ID` to show all employee payroll runs. - properties: - id: - type: string - format: uuid - readOnly: true - example: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee whose payroll is being run. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Employee - payroll_run: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PayrollRun' - nullable: true - description: The payroll being run. - example: 35347df1-95e7-46e2-93cc-66f1191edca5 - x-merge-expands-to: PayrollRun - gross_pay: - type: number - format: double - nullable: true - description: The total earnings throughout a given period for an employee - before any deductions are made. - example: 1342.67 - net_pay: - type: number - format: double - nullable: true - description: The take-home pay throughout a given period for an employee - after deductions are made. - example: 865.78 - start_date: - type: string - format: date-time - nullable: true - description: The day and time the payroll run started. - example: '2020-11-08T00:00:00Z' - end_date: - type: string - format: date-time - nullable: true - description: The day and time the payroll run ended. - example: '2020-11-09T00:00:00Z' - check_date: - type: string - format: date-time - nullable: true - description: The day and time the payroll run was checked. - example: '2020-11-10T00:00:00Z' - earnings: - type: array - items: - $ref: '#/components/schemas/Earning' - readOnly: true - example: - - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - amount: 1002.34 - type: SALARY - - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - amount: 8342.34 - type: OVERTIME - deductions: - type: array - items: - $ref: '#/components/schemas/Deduction' - readOnly: true - example: - - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: Social Security - employee_deduction: 34.54 - company_deduction: 78.78 - taxes: - type: array - items: - $ref: '#/components/schemas/Tax' - readOnly: true - example: - - employee_payroll_run: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: California State Income Tax - amount: 100.25 - employer_tax: 'False' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /employee-payroll - data: - - Varies by platform - x-merge-expands: '{"employee": "Employee", "payroll_run": "PayrollRun"}' - x-merge-category: hris - EmployeeRequest: - type: object - description: |- - # The Employee Object - ### Description - The `Employee` object is used to represent any person who has been employed by a company. By default, it returns all employees. To filter for only active employees, set the `employment_status` query parameter to `ACTIVE`. - - ### Usage Example - Fetch from the `LIST Employee` endpoint and filter by `ID` to show all employees. - properties: - employee_number: - type: string - nullable: true - description: The employee's number that appears in the third-party integration's - UI. - example: '2' - company: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Company' - nullable: true - description: The ID of the employee's company. - example: 8d9fd929-436c-4fd4-a48b-0c61f68d6178 - x-merge-expands-to: Company - first_name: - type: string - nullable: true - description: The employee's first name. - example: Greg - last_name: - type: string - nullable: true - description: The employee's last name. - example: Hirsch - preferred_name: - type: string - nullable: true - description: The employee's preferred first name. - example: Greg the egg - display_full_name: - type: string - nullable: true - description: The employee's full name, to use for display purposes. If a - preferred first name is available, the full name will include the preferred - first name. - example: Cousin Greg Hirsch - username: - type: string - nullable: true - description: The employee's username that appears in the remote UI. - example: cousingreg - groups: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Group' - nullable: true - example: - - 21a54124-397f-494d-985e-3c5b330b8a68 - x-merge-expands-to: Group - work_email: - type: string - format: email - nullable: true - description: The employee's work email. - maxLength: 254 - example: greg@merge.dev - personal_email: - type: string - format: email - nullable: true - description: The employee's personal email. - maxLength: 254 - example: greg@gmail.com - mobile_phone_number: - type: string - nullable: true - description: The employee's mobile phone number. - example: '+1234567890' - employments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employment' - nullable: true - example: - - 17a54124-287f-494d-965e-3c5b330c9a68 - description: Array of `Employment` IDs for this Employee. - x-merge-expands-to: Employment - home_location: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Location' - nullable: true - description: The employee's home address. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Location - work_location: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Location' - nullable: true - description: The employee's work address. - example: 9efbc633-3387-4306-aa55-e2c635e6bb4f - x-merge-expands-to: Location - manager: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee ID of the employee's manager. - example: 0048ea5b-911e-4dff-9364-92070dea62ff - x-merge-expands-to: Employee - team: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Team' - nullable: true - description: The employee's team. - deprecated: true - x-merge-expands-to: Team - pay_group: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PayGroup' - nullable: true - description: The employee's pay group - example: ad1264e2-39be-4787-b749-f1aade9e3405 - x-merge-expands-to: PayGroup - ssn: - type: string - nullable: true - description: The employee's social security number. - maxLength: 100 - example: '1234567890' - gender: - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - type: string - nullable: true - description: |- - The employee's gender. - - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - example: MALE - ethnicity: - oneOf: - - $ref: '#/components/schemas/EthnicityEnum' - - type: string - nullable: true - description: |- - The employee's ethnicity. - - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - * `WHITE` - WHITE - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - example: WHITE - marital_status: - oneOf: - - $ref: '#/components/schemas/MaritalStatusEnum' - - type: string - nullable: true - description: |- - The employee's filing status as related to marital status. - - * `SINGLE` - SINGLE - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - example: SINGLE - date_of_birth: - type: string - format: date-time - nullable: true - description: The employee's date of birth. - example: '1990-11-10T00:00:00Z' - hire_date: - type: string - format: date-time - nullable: true - description: "The date that the employee was hired, usually the day that - an offer letter is signed. If an employee has multiple hire dates from - previous employments, this represents the most recent hire date. Note: - If you're looking for the employee's start date, refer to the start_date - field." - deprecated: true - example: '2020-10-10T00:00:00Z' - start_date: - type: string - format: date-time - nullable: true - description: The date that the employee started working. If an employee - was rehired, the most recent start date will be returned. - example: '2020-10-11T00:00:00Z' - employment_status: - oneOf: - - $ref: '#/components/schemas/EmploymentStatusEnum' - - type: string - nullable: true - description: |- - The employment status of the employee. - - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - example: INACTIVE - termination_date: - type: string - format: date-time - nullable: true - description: The employee's termination date. - example: '2021-10-12T00:00:00Z' - avatar: - type: string - format: uri - nullable: true - maxLength: 2000 - example: http://alturl.com/h2h8m - description: The URL of the employee's avatar image. - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"company": "Company", "employments": "Employment", "groups": - "Group", "home_location": "Location", "manager": "Employee", "pay_group": - "PayGroup", "team": "Team", "work_location": "Location"}' - x-merge-category: hris - EmployeeResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Employee' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: hris - EmployerBenefit: - type: object - description: |- - # The EmployerBenefit Object - ### Description - The `Employer Benefit` object is used to represent a benefit plan offered by a company. - - ### Usage Example - Fetch from the `LIST EmployerBenefits` endpoint and filter by `ID` to show all EmployerBenefits. - properties: - id: - type: string - format: uuid - readOnly: true - example: 025fjlc6-6000-430a-848e-aafacbadf4fele - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202939' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - benefit_plan_type: - oneOf: - - $ref: '#/components/schemas/BenefitPlanTypeEnum' - - type: string - nullable: true - description: |- - The type of benefit plan. - - * `MEDICAL` - MEDICAL - * `HEALTH_SAVINGS` - HEALTH_SAVINGS - * `INSURANCE` - INSURANCE - * `RETIREMENT` - RETIREMENT - * `OTHER` - OTHER - example: MEDICAL - name: - type: string - nullable: true - description: The employer benefit's name - typically the carrier or network - name. - maxLength: 200 - example: Kaiser Permanente Medical Plan - description: - type: string - nullable: true - description: The employer benefit's description. - maxLength: 2000 - example: HDHP Silver Plan - deduction_code: - type: string - nullable: true - description: The employer benefit's deduction code. - maxLength: 60 - example: COL - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-category: hris - Employment: - type: object - description: |- - # The Employment Object - ### Description - The `Employment` object is used to represent a job position at a company. - - If an integration supports historical tracking of employments, it will be reflected in the data. If not, a new `Employment` object will be created whenever there is a change in job title or pay. The `effective_date` field should be used to order `Employment` objects, with the most recent date corresponding to the latest employment record for an employee. - - ### Usage Example - Fetch from the `LIST Employments` endpoint and filter by `ID` to show all employees. - properties: - id: - type: string - format: uuid - readOnly: true - example: 65d8ffd0-211b-4ba4-b85a-fbe2ce220982 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee holding this position. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Employee - job_title: - type: string - nullable: true - description: The position's title. - example: Executive Assistant to Tom Wambsgans - pay_rate: - type: number - format: double - nullable: true - description: The position's pay rate. - example: '50000.00' - pay_period: - oneOf: - - $ref: '#/components/schemas/PayPeriodEnum' - - type: string - nullable: true - description: |- - The time period this pay rate encompasses. - - * `HOUR` - HOUR - * `DAY` - DAY - * `WEEK` - WEEK - * `EVERY_TWO_WEEKS` - EVERY_TWO_WEEKS - * `SEMIMONTHLY` - SEMIMONTHLY - * `MONTH` - MONTH - * `QUARTER` - QUARTER - * `EVERY_SIX_MONTHS` - EVERY_SIX_MONTHS - * `YEAR` - YEAR - example: YEAR - pay_frequency: - oneOf: - - $ref: '#/components/schemas/PayFrequencyEnum' - - type: string - nullable: true - description: |- - The position's pay frequency. - - * `WEEKLY` - WEEKLY - * `BIWEEKLY` - BIWEEKLY - * `MONTHLY` - MONTHLY - * `QUARTERLY` - QUARTERLY - * `SEMIANNUALLY` - SEMIANNUALLY - * `ANNUALLY` - ANNUALLY - * `THIRTEEN-MONTHLY` - THIRTEEN-MONTHLY - * `PRO_RATA` - PRO_RATA - * `SEMIMONTHLY` - SEMIMONTHLY - example: BIWEEKLY - pay_currency: - oneOf: - - $ref: '#/components/schemas/PayCurrencyEnum' - - type: string - nullable: true - description: |- - The position's currency code. - - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - example: USD - pay_group: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/PayGroup' - nullable: true - description: The employment's pay group - example: d4e4837f-9900-484c-ac40-528365bb08ef - x-merge-expands-to: PayGroup - flsa_status: - oneOf: - - $ref: '#/components/schemas/FlsaStatusEnum' - - type: string - nullable: true - description: |- - The position's FLSA status. - - * `EXEMPT` - EXEMPT - * `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT - * `NONEXEMPT` - NONEXEMPT - * `OWNER` - OWNER - example: EXEMPT - effective_date: - type: string - format: date-time - nullable: true - description: The position's effective date. - example: '2023-10-06T18:42:34Z' - employment_type: - oneOf: - - $ref: '#/components/schemas/EmploymentTypeEnum' - - type: string - nullable: true - description: |- - The position's type of employment. - - * `FULL_TIME` - FULL_TIME - * `PART_TIME` - PART_TIME - * `INTERN` - INTERN - * `CONTRACTOR` - CONTRACTOR - * `FREELANCE` - FREELANCE - example: FULL TIME - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /jobs - data: - - Varies by platform - x-merge-nested-write-allowed: true - x-merge-expands: '{"employee": "Employee", "pay_group": "PayGroup"}' - x-merge-category: hris - EmploymentStatusEnum: - enum: - - ACTIVE - - PENDING - - INACTIVE - type: string - description: |- - * `ACTIVE` - ACTIVE - * `PENDING` - PENDING - * `INACTIVE` - INACTIVE - x-merge-category: hris - EmploymentTypeEnum: - enum: - - FULL_TIME - - PART_TIME - - INTERN - - CONTRACTOR - - FREELANCE - type: string - description: |- - * `FULL_TIME` - FULL_TIME - * `PART_TIME` - PART_TIME - * `INTERN` - INTERN - * `CONTRACTOR` - CONTRACTOR - * `FREELANCE` - FREELANCE - x-merge-category: hris - EnabledActionsEnum: - enum: - - READ - - WRITE - type: string - description: |- - * `READ` - READ - * `WRITE` - WRITE - x-merge-category: hris - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - type: string - description: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - x-merge-category: hris - EndUserDetailsRequest: - type: object - properties: - end_user_email_address: - type: string - minLength: 1 - description: Your end user's email address. This is purely for identification - purposes - setting this value will not cause any emails to be sent. - maxLength: 100 - example: example@gmail.com - end_user_organization_name: - type: string - minLength: 1 - description: Your end user's organization. - maxLength: 100 - example: Test Organization - end_user_origin_id: - type: string - minLength: 1 - description: 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. - maxLength: 100 - example: '12345' - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: The integration categories to show in Merge Link. - example: - - hris - - ats - integration: - type: string - nullable: true - minLength: 1 - description: 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/. - example: bamboohr - link_expiry_mins: - type: integer - maximum: 10080 - minimum: 30 - default: 30 - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: array - items: - $ref: '#/components/schemas/CommonModelScopesBodyRequest' - nullable: true - description: 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: object - additionalProperties: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - nullable: true - description: 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. - example: - hris: - - model_name: Employee - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - first_name - - last_name - - personal_email - disabled_fields: - - preferred_name - - model_name: Employment - model_permissions: - READ: - is_enabled: false - WRITE: - is_enabled: false - field_permissions: - enabled_fields: - - effective_date - ats: - - model_name: Job - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - name - disabled_fields: - - description - - model_name: Department - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - language: - oneOf: - - $ref: '#/components/schemas/LanguageEnum' - - type: string - nullable: true - description: |- - The following subset of IETF language tags can be used to configure localization. - - * `en` - en - * `de` - de - example: en - are_syncs_disabled: - type: boolean - nullable: true - default: false - description: The boolean that indicates whether initial, periodic, and force - syncs will be disabled. - integration_specific_config: - type: object - additionalProperties: {} - nullable: true - description: A JSON object containing integration-specific configuration - options. - example: - rippling: - oauth_code: 3h1jj8ssdf31dfji3o1jjdfjasd - required: - - categories - - end_user_email_address - - end_user_organization_name - - end_user_origin_id - x-merge-category: hris - ErrorValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /model/custom_fields - title: - type: string - example: Missing Required Field - detail: - type: string - example: custom_fields is a required field on model. - problem_type: - type: string - example: MISSING_REQUIRED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: hris - EthnicityEnum: - enum: - - AMERICAN_INDIAN_OR_ALASKA_NATIVE - - ASIAN_OR_INDIAN_SUBCONTINENT - - BLACK_OR_AFRICAN_AMERICAN - - HISPANIC_OR_LATINO - - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - - TWO_OR_MORE_RACES - - WHITE - - PREFER_NOT_TO_DISCLOSE - type: string - description: |- - * `AMERICAN_INDIAN_OR_ALASKA_NATIVE` - AMERICAN_INDIAN_OR_ALASKA_NATIVE - * `ASIAN_OR_INDIAN_SUBCONTINENT` - ASIAN_OR_INDIAN_SUBCONTINENT - * `BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN - * `HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO - * `NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` - NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER - * `TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES - * `WHITE` - WHITE - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - x-merge-category: hris - 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 - type: string - description: |- - * `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 - x-merge-category: hris - ExternalTargetFieldAPI: - type: object - properties: - name: - type: string - nullable: true - readOnly: true - example: example_target_field_name - description: - type: string - nullable: true - readOnly: true - example: this is a example description of a target field - is_mapped: - type: string - nullable: true - readOnly: true - example: true - x-merge-category: hris - ExternalTargetFieldAPIResponse: - type: object - properties: - Benefit: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - EmployerBenefit: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Company: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - EmployeePayrollRun: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Employee: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Employment: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Location: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - PayrollRun: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Team: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - TimeOff: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - TimeOffBalance: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - BankInfo: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - PayGroup: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Group: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Dependent: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - TimesheetEntry: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - x-merge-category: hris - FieldMappingApiInstance: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - is_integration_wide: - type: boolean - readOnly: true - target_field: - type: object - properties: - name: - type: string - description: - type: string - is_organization_wide: - type: boolean - required: - - description - - is_organization_wide - - name - nullable: true - readOnly: true - example: - name: example_target_field_name - description: this is a example description of a target field - is_organization_wide: true - remote_field: - type: object - properties: - remote_key_name: - type: string - nullable: true - schema: - type: object - additionalProperties: {} - nullable: true - remote_endpoint_info: - type: object - properties: - method: - type: string - nullable: true - url_path: - type: string - nullable: true - field_traversal_path: - type: array - items: - type: string - nullable: true - required: - - field_traversal_path - - method - - url_path - required: - - remote_endpoint_info - - remote_key_name - - schema - nullable: true - readOnly: true - example: - 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 - x-merge-category: hris - FieldMappingApiInstanceResponse: - type: object - properties: - Benefit: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - EmployerBenefit: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Company: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - EmployeePayrollRun: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Employee: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Employment: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Location: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - PayrollRun: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Team: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - TimeOff: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - TimeOffBalance: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - BankInfo: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - PayGroup: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Group: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Dependent: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - TimesheetEntry: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - x-merge-category: hris - FieldMappingInstanceResponse: - type: object - properties: - model: - $ref: '#/components/schemas/FieldMappingApiInstance' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: hris - FieldPermissionDeserializer: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: hris - FieldPermissionDeserializerRequest: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: hris - FlsaStatusEnum: - enum: - - EXEMPT - - SALARIED_NONEXEMPT - - NONEXEMPT - - OWNER - type: string - description: |- - * `EXEMPT` - EXEMPT - * `SALARIED_NONEXEMPT` - SALARIED_NONEXEMPT - * `NONEXEMPT` - NONEXEMPT - * `OWNER` - OWNER - x-merge-category: hris - GenderEnum: - enum: - - MALE - - FEMALE - - NON-BINARY - - OTHER - - PREFER_NOT_TO_DISCLOSE - type: string - description: |- - * `MALE` - MALE - * `FEMALE` - FEMALE - * `NON-BINARY` - NON-BINARY - * `OTHER` - OTHER - * `PREFER_NOT_TO_DISCLOSE` - PREFER_NOT_TO_DISCLOSE - x-merge-category: hris - GenerateRemoteKeyRequest: - type: object - description: |- - # The GenerateRemoteKey Object - ### Description - The `GenerateRemoteKey` object is used to represent a request for a new remote key. - - ### Usage Example - Post a `GenerateRemoteKey` to create a new remote key. - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: hris - Group: - type: object - description: |- - # The Group Object - ### Description - The `Group` object is used to represent any subset of employees across, for example, `DEPARTMENT` or `TEAM`. Employees can be in multiple Groups. - - ### Usage Example - Fetch from the `LIST Employee` endpoint and expand groups to view an employee's groups. - properties: - id: - type: string - format: uuid - readOnly: true - example: 134e0111-0f67-44f6-98f0-597000290bb3 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '800293' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - parent_group: - type: string - format: uuid - nullable: true - description: The parent group for this group. - example: 2ef51b11-2c4e-4b02-8d1d-50592d9e96ef - name: - type: string - nullable: true - description: The group name. - example: COST_CENTER_US - type: - oneOf: - - $ref: '#/components/schemas/GroupTypeEnum' - - type: string - nullable: true - description: |- - The Group type returned directly from the third-party. - - * `TEAM` - TEAM - * `DEPARTMENT` - DEPARTMENT - * `COST_CENTER` - COST_CENTER - * `BUSINESS_UNIT` - BUSINESS_UNIT - * `GROUP` - GROUP - example: COST_CENTER - is_commonly_used_as_team: - type: boolean - nullable: true - description: Indicates whether the Group refers to a team in the third party - platform. Note that this is an opinionated view based on how Merge observes - most organizations representing teams in each third party platform. If - your customer uses a platform different from most, there is a chance this - will not be correct. - example: true - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /group - data: - - Varies by platform - x-merge-expands: '{"child_groups": "Group"}' - x-merge-category: hris - GroupTypeEnum: - enum: - - TEAM - - DEPARTMENT - - COST_CENTER - - BUSINESS_UNIT - - GROUP - type: string - description: |- - * `TEAM` - TEAM - * `DEPARTMENT` - DEPARTMENT - * `COST_CENTER` - COST_CENTER - * `BUSINESS_UNIT` - BUSINESS_UNIT - * `GROUP` - GROUP - x-merge-category: hris - IgnoreCommonModelRequest: - type: object - properties: - reason: - oneOf: - - $ref: '#/components/schemas/ReasonEnum' - - type: string - example: GENERAL_CUSTOMER_REQUEST - message: - type: string - minLength: 1 - maxLength: 256 - example: deletion request by user id 51903790-7dfe-4053-8d63-5a10cc4ffd39 - required: - - reason - x-merge-category: hris - IndividualCommonModelScopeDeserializer: - type: object - properties: - model_name: - type: string - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializer' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializer' - required: - - model_name - x-merge-category: hris - IndividualCommonModelScopeDeserializerRequest: - type: object - properties: - model_name: - type: string - minLength: 1 - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializerRequest' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializerRequest' - required: - - model_name - x-merge-category: hris - Issue: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - status: - oneOf: - - $ref: '#/components/schemas/IssueStatusEnum' - - type: string - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - example: ONGOING - error_description: - type: string - example: Missing Permissions - end_user: - type: object - additionalProperties: {} - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - first_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - last_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - is_muted: - type: boolean - readOnly: true - example: true - error_details: - type: array - items: - type: string - readOnly: true - example: - - Missing employee permissions. - - Missing time off permissions. - required: - - error_description - x-merge-category: hris - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - type: string - description: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - x-merge-category: hris - LanguageEnum: - enum: - - en - - de - type: string - description: |- - * `en` - en - * `de` - de - x-merge-category: hris - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: hris - LinkToken: - type: object - properties: - link_token: - type: string - example: necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0 - integration_name: - type: string - example: Lever - magic_link_url: - type: string - example: https://link.merge.dev/asdfjkl12345jsndfgi2i83n - required: - - link_token - x-merge-category: hris - LinkedAccountCommonModelScopeDeserializerRequest: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: hris - LinkedAccountStatus: - type: object - properties: - linked_account_status: - type: string - can_make_request: - type: boolean - required: - - can_make_request - - linked_account_status - x-merge-category: hris - Location: - type: object - description: |- - # The Location Object - ### Description - The `Location` object is used to represent an address that can be associated with an employee. - - ### Usage Example - Fetch from the `LIST Locations` endpoint and filter by `ID` to show all office locations. - properties: - id: - type: string - format: uuid - readOnly: true - example: f5e6a151-f44e-449a-afb1-8fd781905958 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '93018402' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The location's name. - example: NYC Office - phone_number: - type: string - nullable: true - description: The location's phone number. - example: '+1111111111' - street_1: - type: string - nullable: true - description: Line 1 of the location's street address. - example: 2920 Broadway - street_2: - type: string - nullable: true - description: Line 2 of the location's street address. - example: 2nd Floor - city: - type: string - nullable: true - description: The location's city. - example: 'New York ' - state: - type: string - nullable: true - description: The location's state. Represents a region if outside of the - US. - example: NY - zip_code: - type: string - nullable: true - description: The location's zip code or postal code. - example: '10027' - country: - oneOf: - - $ref: '#/components/schemas/CountryEnum' - - type: string - nullable: true - description: |- - The location's country. - - * `AF` - Afghanistan - * `AX` - Åland Islands - * `AL` - Albania - * `DZ` - Algeria - * `AS` - American Samoa - * `AD` - Andorra - * `AO` - Angola - * `AI` - Anguilla - * `AQ` - Antarctica - * `AG` - Antigua and Barbuda - * `AR` - Argentina - * `AM` - Armenia - * `AW` - Aruba - * `AU` - Australia - * `AT` - Austria - * `AZ` - Azerbaijan - * `BS` - Bahamas - * `BH` - Bahrain - * `BD` - Bangladesh - * `BB` - Barbados - * `BY` - Belarus - * `BE` - Belgium - * `BZ` - Belize - * `BJ` - Benin - * `BM` - Bermuda - * `BT` - Bhutan - * `BO` - Bolivia - * `BQ` - Bonaire, Sint Eustatius and Saba - * `BA` - Bosnia and Herzegovina - * `BW` - Botswana - * `BV` - Bouvet Island - * `BR` - Brazil - * `IO` - British Indian Ocean Territory - * `BN` - Brunei - * `BG` - Bulgaria - * `BF` - Burkina Faso - * `BI` - Burundi - * `CV` - Cabo Verde - * `KH` - Cambodia - * `CM` - Cameroon - * `CA` - Canada - * `KY` - Cayman Islands - * `CF` - Central African Republic - * `TD` - Chad - * `CL` - Chile - * `CN` - China - * `CX` - Christmas Island - * `CC` - Cocos (Keeling) Islands - * `CO` - Colombia - * `KM` - Comoros - * `CG` - Congo - * `CD` - Congo (the Democratic Republic of the) - * `CK` - Cook Islands - * `CR` - Costa Rica - * `CI` - Côte d'Ivoire - * `HR` - Croatia - * `CU` - Cuba - * `CW` - Curaçao - * `CY` - Cyprus - * `CZ` - Czechia - * `DK` - Denmark - * `DJ` - Djibouti - * `DM` - Dominica - * `DO` - Dominican Republic - * `EC` - Ecuador - * `EG` - Egypt - * `SV` - El Salvador - * `GQ` - Equatorial Guinea - * `ER` - Eritrea - * `EE` - Estonia - * `SZ` - Eswatini - * `ET` - Ethiopia - * `FK` - Falkland Islands (Malvinas) - * `FO` - Faroe Islands - * `FJ` - Fiji - * `FI` - Finland - * `FR` - France - * `GF` - French Guiana - * `PF` - French Polynesia - * `TF` - French Southern Territories - * `GA` - Gabon - * `GM` - Gambia - * `GE` - Georgia - * `DE` - Germany - * `GH` - Ghana - * `GI` - Gibraltar - * `GR` - Greece - * `GL` - Greenland - * `GD` - Grenada - * `GP` - Guadeloupe - * `GU` - Guam - * `GT` - Guatemala - * `GG` - Guernsey - * `GN` - Guinea - * `GW` - Guinea-Bissau - * `GY` - Guyana - * `HT` - Haiti - * `HM` - Heard Island and McDonald Islands - * `VA` - Holy See - * `HN` - Honduras - * `HK` - Hong Kong - * `HU` - Hungary - * `IS` - Iceland - * `IN` - India - * `ID` - Indonesia - * `IR` - Iran - * `IQ` - Iraq - * `IE` - Ireland - * `IM` - Isle of Man - * `IL` - Israel - * `IT` - Italy - * `JM` - Jamaica - * `JP` - Japan - * `JE` - Jersey - * `JO` - Jordan - * `KZ` - Kazakhstan - * `KE` - Kenya - * `KI` - Kiribati - * `KW` - Kuwait - * `KG` - Kyrgyzstan - * `LA` - Laos - * `LV` - Latvia - * `LB` - Lebanon - * `LS` - Lesotho - * `LR` - Liberia - * `LY` - Libya - * `LI` - Liechtenstein - * `LT` - Lithuania - * `LU` - Luxembourg - * `MO` - Macao - * `MG` - Madagascar - * `MW` - Malawi - * `MY` - Malaysia - * `MV` - Maldives - * `ML` - Mali - * `MT` - Malta - * `MH` - Marshall Islands - * `MQ` - Martinique - * `MR` - Mauritania - * `MU` - Mauritius - * `YT` - Mayotte - * `MX` - Mexico - * `FM` - Micronesia (Federated States of) - * `MD` - Moldova - * `MC` - Monaco - * `MN` - Mongolia - * `ME` - Montenegro - * `MS` - Montserrat - * `MA` - Morocco - * `MZ` - Mozambique - * `MM` - Myanmar - * `NA` - Namibia - * `NR` - Nauru - * `NP` - Nepal - * `NL` - Netherlands - * `NC` - New Caledonia - * `NZ` - New Zealand - * `NI` - Nicaragua - * `NE` - Niger - * `NG` - Nigeria - * `NU` - Niue - * `NF` - Norfolk Island - * `KP` - North Korea - * `MK` - North Macedonia - * `MP` - Northern Mariana Islands - * `NO` - Norway - * `OM` - Oman - * `PK` - Pakistan - * `PW` - Palau - * `PS` - Palestine, State of - * `PA` - Panama - * `PG` - Papua New Guinea - * `PY` - Paraguay - * `PE` - Peru - * `PH` - Philippines - * `PN` - Pitcairn - * `PL` - Poland - * `PT` - Portugal - * `PR` - Puerto Rico - * `QA` - Qatar - * `RE` - Réunion - * `RO` - Romania - * `RU` - Russia - * `RW` - Rwanda - * `BL` - Saint Barthélemy - * `SH` - Saint Helena, Ascension and Tristan da Cunha - * `KN` - Saint Kitts and Nevis - * `LC` - Saint Lucia - * `MF` - Saint Martin (French part) - * `PM` - Saint Pierre and Miquelon - * `VC` - Saint Vincent and the Grenadines - * `WS` - Samoa - * `SM` - San Marino - * `ST` - Sao Tome and Principe - * `SA` - Saudi Arabia - * `SN` - Senegal - * `RS` - Serbia - * `SC` - Seychelles - * `SL` - Sierra Leone - * `SG` - Singapore - * `SX` - Sint Maarten (Dutch part) - * `SK` - Slovakia - * `SI` - Slovenia - * `SB` - Solomon Islands - * `SO` - Somalia - * `ZA` - South Africa - * `GS` - South Georgia and the South Sandwich Islands - * `KR` - South Korea - * `SS` - South Sudan - * `ES` - Spain - * `LK` - Sri Lanka - * `SD` - Sudan - * `SR` - Suriname - * `SJ` - Svalbard and Jan Mayen - * `SE` - Sweden - * `CH` - Switzerland - * `SY` - Syria - * `TW` - Taiwan - * `TJ` - Tajikistan - * `TZ` - Tanzania - * `TH` - Thailand - * `TL` - Timor-Leste - * `TG` - Togo - * `TK` - Tokelau - * `TO` - Tonga - * `TT` - Trinidad and Tobago - * `TN` - Tunisia - * `TR` - Turkey - * `TM` - Turkmenistan - * `TC` - Turks and Caicos Islands - * `TV` - Tuvalu - * `UG` - Uganda - * `UA` - Ukraine - * `AE` - United Arab Emirates - * `GB` - United Kingdom - * `UM` - United States Minor Outlying Islands - * `US` - United States of America - * `UY` - Uruguay - * `UZ` - Uzbekistan - * `VU` - Vanuatu - * `VE` - Venezuela - * `VN` - Vietnam - * `VG` - Virgin Islands (British) - * `VI` - Virgin Islands (U.S.) - * `WF` - Wallis and Futuna - * `EH` - Western Sahara - * `YE` - Yemen - * `ZM` - Zambia - * `ZW` - Zimbabwe - example: US - location_type: - oneOf: - - $ref: '#/components/schemas/LocationTypeEnum' - - type: string - nullable: true - description: |- - The location's type. Can be either WORK or HOME - - * `HOME` - HOME - * `WORK` - WORK - example: WORK - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /locations - data: - - Varies by platform - x-merge-category: hris - LocationTypeEnum: - enum: - - HOME - - WORK - type: string - description: |- - * `HOME` - HOME - * `WORK` - WORK - x-merge-category: hris - MaritalStatusEnum: - enum: - - SINGLE - - MARRIED_FILING_JOINTLY - - MARRIED_FILING_SEPARATELY - - HEAD_OF_HOUSEHOLD - - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - type: string - description: |- - * `SINGLE` - SINGLE - * `MARRIED_FILING_JOINTLY` - MARRIED_FILING_JOINTLY - * `MARRIED_FILING_SEPARATELY` - MARRIED_FILING_SEPARATELY - * `HEAD_OF_HOUSEHOLD` - HEAD_OF_HOUSEHOLD - * `QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD` - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - x-merge-category: hris - MetaResponse: - type: object - properties: - request_schema: - type: object - additionalProperties: {} - example: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - type: object - additionalProperties: {} - status: - $ref: '#/components/schemas/LinkedAccountStatus' - example: - linked_account_status: COMPLETE - can_make_request: true - has_conditional_params: - type: boolean - has_required_linked_account_params: - type: boolean - required: - - has_conditional_params - - has_required_linked_account_params - - request_schema - x-merge-category: hris - MethodEnum: - enum: - - GET - - OPTIONS - - HEAD - - POST - - PUT - - PATCH - - DELETE - type: string - description: |- - * `GET` - GET - * `OPTIONS` - OPTIONS - * `HEAD` - HEAD - * `POST` - POST - * `PUT` - PUT - * `PATCH` - PATCH - * `DELETE` - DELETE - x-merge-category: hris - ModelOperation: - type: object - description: |- - # 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: - type: string - example: Candidate - available_operations: - type: array - items: - type: string - example: - - FETCH - - CREATE - required_post_parameters: - type: array - items: - type: string - example: - - remote_user_id - supported_fields: - type: array - items: - type: string - example: - - first_name - - last_name - - company - - title - required: - - available_operations - - model_name - - required_post_parameters - - supported_fields - x-merge-category: hris - ModelPermissionDeserializer: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: hris - ModelPermissionDeserializerRequest: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: hris - MultipartFormFieldRequest: - type: object - description: |- - # 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 - minLength: 1 - description: The name of the form field - example: resume - data: - type: string - minLength: 1 - description: The data for the form field. - example: SW50ZWdyYXRlIGZhc3QKSW50ZWdyYXRlIG9uY2U= - encoding: - oneOf: - - $ref: '#/components/schemas/EncodingEnum' - - type: string - nullable: true - default: RAW - description: |- - The encoding of the value of `data`. Defaults to `RAW` if not defined. - - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - example: BASE64 - $ref: '#/components/schemas/EncodingEnum' - file_name: - type: string - nullable: true - minLength: 1 - description: The file name of the form field, if the field is for a file. - example: resume.pdf - content_type: - type: string - nullable: true - minLength: 1 - description: The MIME type of the file, if the field is for a file. - example: application/pdf - required: - - data - - name - x-merge-category: hris - PaginatedAccountDetailsAndActionsList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountDetailsAndActions' - x-merge-category: hris - PaginatedAuditLogEventList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AuditLogEvent' - x-merge-category: hris - PaginatedBankInfoList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/BankInfo' - x-merge-category: hris - PaginatedBenefitList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Benefit' - x-merge-category: hris - PaginatedCompanyList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Company' - x-merge-category: hris - PaginatedDependentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Dependent' - x-merge-category: hris - PaginatedEmployeeList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Employee' - x-merge-category: hris - PaginatedEmployeePayrollRunList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/EmployeePayrollRun' - x-merge-category: hris - PaginatedEmployerBenefitList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/EmployerBenefit' - x-merge-category: hris - PaginatedEmploymentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Employment' - x-merge-category: hris - PaginatedGroupList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Group' - x-merge-category: hris - PaginatedIssueList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Issue' - x-merge-category: hris - PaginatedLocationList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Location' - x-merge-category: hris - PaginatedPayGroupList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/PayGroup' - x-merge-category: hris - PaginatedPayrollRunList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/PayrollRun' - x-merge-category: hris - PaginatedSyncStatusList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - x-merge-category: hris - PaginatedTeamList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Team' - x-merge-category: hris - PaginatedTimeOffBalanceList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/TimeOffBalance' - x-merge-category: hris - PaginatedTimeOffList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/TimeOff' - x-merge-category: hris - PaginatedTimesheetEntryList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/TimesheetEntry' - x-merge-category: hris - PatchedEditFieldMappingRequest: - type: object - properties: - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field_name - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - x-merge-category: hris - PayCurrencyEnum: - enum: - - XUA - - AFN - - AFA - - ALL - - ALK - - DZD - - ADP - - AOA - - AOK - - AON - - AOR - - ARA - - ARS - - ARM - - ARP - - ARL - - AMD - - AWG - - AUD - - ATS - - AZN - - AZM - - BSD - - BHD - - BDT - - BBD - - BYN - - BYB - - BYR - - BEF - - BEC - - BEL - - BZD - - BMD - - BTN - - BOB - - BOL - - BOV - - BOP - - BAM - - BAD - - BAN - - BWP - - BRC - - BRZ - - BRE - - BRR - - BRN - - BRB - - BRL - - GBP - - BND - - BGL - - BGN - - BGO - - BGM - - BUK - - BIF - - XPF - - KHR - - CAD - - CVE - - KYD - - XAF - - CLE - - CLP - - CLF - - CNX - - CNY - - CNH - - COP - - COU - - KMF - - CDF - - CRC - - HRD - - HRK - - CUC - - CUP - - CYP - - CZK - - CSK - - DKK - - DJF - - DOP - - NLG - - XCD - - DDM - - ECS - - ECV - - EGP - - GQE - - ERN - - EEK - - ETB - - EUR - - XBA - - XEU - - XBB - - XBC - - XBD - - FKP - - FJD - - FIM - - FRF - - XFO - - XFU - - GMD - - GEK - - GEL - - DEM - - GHS - - GHC - - GIP - - XAU - - GRD - - GTQ - - GWP - - GNF - - GNS - - GYD - - HTG - - HNL - - HKD - - HUF - - IMP - - ISK - - ISJ - - INR - - IDR - - IRR - - IQD - - IEP - - ILS - - ILP - - ILR - - ITL - - JMD - - JPY - - JOD - - KZT - - KES - - KWD - - KGS - - LAK - - LVL - - LVR - - LBP - - LSL - - LRD - - LYD - - LTL - - LTT - - LUL - - LUC - - LUF - - MOP - - MKD - - MKN - - MGA - - MGF - - MWK - - MYR - - MVR - - MVP - - MLF - - MTL - - MTP - - MRU - - MRO - - MUR - - MXV - - MXN - - MXP - - MDC - - MDL - - MCF - - MNT - - MAD - - MAF - - MZE - - MZN - - MZM - - MMK - - NAD - - NPR - - ANG - - TWD - - NZD - - NIO - - NIC - - NGN - - KPW - - NOK - - OMR - - PKR - - XPD - - PAB - - PGK - - PYG - - PEI - - PEN - - PES - - PHP - - XPT - - PLN - - PLZ - - PTE - - GWE - - QAR - - XRE - - RHD - - RON - - ROL - - RUB - - RUR - - RWF - - SVC - - WST - - SAR - - RSD - - CSD - - SCR - - SLL - - XAG - - SGD - - SKK - - SIT - - SBD - - SOS - - ZAR - - ZAL - - KRH - - KRW - - KRO - - SSP - - SUR - - ESP - - ESA - - ESB - - XDR - - LKR - - SHP - - XSU - - SDD - - SDG - - SDP - - SRD - - SRG - - SZL - - SEK - - CHF - - SYP - - STN - - STD - - TVD - - TJR - - TJS - - TZS - - XTS - - THB - - XXX - - TPE - - TOP - - TTD - - TND - - TRY - - TRL - - TMT - - TMM - - USD - - USN - - USS - - UGX - - UGS - - UAH - - UAK - - AED - - UYW - - UYU - - UYP - - UYI - - UZS - - VUV - - VES - - VEB - - VEF - - VND - - VNN - - CHE - - CHW - - XOF - - YDD - - YER - - YUN - - YUD - - YUM - - YUR - - ZWN - - ZRN - - ZRZ - - ZMW - - ZMK - - ZWD - - ZWR - - ZWL - type: string - description: |- - * `XUA` - ADB Unit of Account - * `AFN` - Afghan Afghani - * `AFA` - Afghan Afghani (1927–2002) - * `ALL` - Albanian Lek - * `ALK` - Albanian Lek (1946–1965) - * `DZD` - Algerian Dinar - * `ADP` - Andorran Peseta - * `AOA` - Angolan Kwanza - * `AOK` - Angolan Kwanza (1977–1991) - * `AON` - Angolan New Kwanza (1990–2000) - * `AOR` - Angolan Readjusted Kwanza (1995–1999) - * `ARA` - Argentine Austral - * `ARS` - Argentine Peso - * `ARM` - Argentine Peso (1881–1970) - * `ARP` - Argentine Peso (1983–1985) - * `ARL` - Argentine Peso Ley (1970–1983) - * `AMD` - Armenian Dram - * `AWG` - Aruban Florin - * `AUD` - Australian Dollar - * `ATS` - Austrian Schilling - * `AZN` - Azerbaijani Manat - * `AZM` - Azerbaijani Manat (1993–2006) - * `BSD` - Bahamian Dollar - * `BHD` - Bahraini Dinar - * `BDT` - Bangladeshi Taka - * `BBD` - Barbadian Dollar - * `BYN` - Belarusian Ruble - * `BYB` - Belarusian Ruble (1994–1999) - * `BYR` - Belarusian Ruble (2000–2016) - * `BEF` - Belgian Franc - * `BEC` - Belgian Franc (convertible) - * `BEL` - Belgian Franc (financial) - * `BZD` - Belize Dollar - * `BMD` - Bermudan Dollar - * `BTN` - Bhutanese Ngultrum - * `BOB` - Bolivian Boliviano - * `BOL` - Bolivian Boliviano (1863–1963) - * `BOV` - Bolivian Mvdol - * `BOP` - Bolivian Peso - * `BAM` - Bosnia-Herzegovina Convertible Mark - * `BAD` - Bosnia-Herzegovina Dinar (1992–1994) - * `BAN` - Bosnia-Herzegovina New Dinar (1994–1997) - * `BWP` - Botswanan Pula - * `BRC` - Brazilian Cruzado (1986–1989) - * `BRZ` - Brazilian Cruzeiro (1942–1967) - * `BRE` - Brazilian Cruzeiro (1990–1993) - * `BRR` - Brazilian Cruzeiro (1993–1994) - * `BRN` - Brazilian New Cruzado (1989–1990) - * `BRB` - Brazilian New Cruzeiro (1967–1986) - * `BRL` - Brazilian Real - * `GBP` - British Pound - * `BND` - Brunei Dollar - * `BGL` - Bulgarian Hard Lev - * `BGN` - Bulgarian Lev - * `BGO` - Bulgarian Lev (1879–1952) - * `BGM` - Bulgarian Socialist Lev - * `BUK` - Burmese Kyat - * `BIF` - Burundian Franc - * `XPF` - CFP Franc - * `KHR` - Cambodian Riel - * `CAD` - Canadian Dollar - * `CVE` - Cape Verdean Escudo - * `KYD` - Cayman Islands Dollar - * `XAF` - Central African CFA Franc - * `CLE` - Chilean Escudo - * `CLP` - Chilean Peso - * `CLF` - Chilean Unit of Account (UF) - * `CNX` - Chinese People’s Bank Dollar - * `CNY` - Chinese Yuan - * `CNH` - Chinese Yuan (offshore) - * `COP` - Colombian Peso - * `COU` - Colombian Real Value Unit - * `KMF` - Comorian Franc - * `CDF` - Congolese Franc - * `CRC` - Costa Rican Colón - * `HRD` - Croatian Dinar - * `HRK` - Croatian Kuna - * `CUC` - Cuban Convertible Peso - * `CUP` - Cuban Peso - * `CYP` - Cypriot Pound - * `CZK` - Czech Koruna - * `CSK` - Czechoslovak Hard Koruna - * `DKK` - Danish Krone - * `DJF` - Djiboutian Franc - * `DOP` - Dominican Peso - * `NLG` - Dutch Guilder - * `XCD` - East Caribbean Dollar - * `DDM` - East German Mark - * `ECS` - Ecuadorian Sucre - * `ECV` - Ecuadorian Unit of Constant Value - * `EGP` - Egyptian Pound - * `GQE` - Equatorial Guinean Ekwele - * `ERN` - Eritrean Nakfa - * `EEK` - Estonian Kroon - * `ETB` - Ethiopian Birr - * `EUR` - Euro - * `XBA` - European Composite Unit - * `XEU` - European Currency Unit - * `XBB` - European Monetary Unit - * `XBC` - European Unit of Account (XBC) - * `XBD` - European Unit of Account (XBD) - * `FKP` - Falkland Islands Pound - * `FJD` - Fijian Dollar - * `FIM` - Finnish Markka - * `FRF` - French Franc - * `XFO` - French Gold Franc - * `XFU` - French UIC-Franc - * `GMD` - Gambian Dalasi - * `GEK` - Georgian Kupon Larit - * `GEL` - Georgian Lari - * `DEM` - German Mark - * `GHS` - Ghanaian Cedi - * `GHC` - Ghanaian Cedi (1979–2007) - * `GIP` - Gibraltar Pound - * `XAU` - Gold - * `GRD` - Greek Drachma - * `GTQ` - Guatemalan Quetzal - * `GWP` - Guinea-Bissau Peso - * `GNF` - Guinean Franc - * `GNS` - Guinean Syli - * `GYD` - Guyanaese Dollar - * `HTG` - Haitian Gourde - * `HNL` - Honduran Lempira - * `HKD` - Hong Kong Dollar - * `HUF` - Hungarian Forint - * `IMP` - IMP - * `ISK` - Icelandic Króna - * `ISJ` - Icelandic Króna (1918–1981) - * `INR` - Indian Rupee - * `IDR` - Indonesian Rupiah - * `IRR` - Iranian Rial - * `IQD` - Iraqi Dinar - * `IEP` - Irish Pound - * `ILS` - Israeli New Shekel - * `ILP` - Israeli Pound - * `ILR` - Israeli Shekel (1980–1985) - * `ITL` - Italian Lira - * `JMD` - Jamaican Dollar - * `JPY` - Japanese Yen - * `JOD` - Jordanian Dinar - * `KZT` - Kazakhstani Tenge - * `KES` - Kenyan Shilling - * `KWD` - Kuwaiti Dinar - * `KGS` - Kyrgystani Som - * `LAK` - Laotian Kip - * `LVL` - Latvian Lats - * `LVR` - Latvian Ruble - * `LBP` - Lebanese Pound - * `LSL` - Lesotho Loti - * `LRD` - Liberian Dollar - * `LYD` - Libyan Dinar - * `LTL` - Lithuanian Litas - * `LTT` - Lithuanian Talonas - * `LUL` - Luxembourg Financial Franc - * `LUC` - Luxembourgian Convertible Franc - * `LUF` - Luxembourgian Franc - * `MOP` - Macanese Pataca - * `MKD` - Macedonian Denar - * `MKN` - Macedonian Denar (1992–1993) - * `MGA` - Malagasy Ariary - * `MGF` - Malagasy Franc - * `MWK` - Malawian Kwacha - * `MYR` - Malaysian Ringgit - * `MVR` - Maldivian Rufiyaa - * `MVP` - Maldivian Rupee (1947–1981) - * `MLF` - Malian Franc - * `MTL` - Maltese Lira - * `MTP` - Maltese Pound - * `MRU` - Mauritanian Ouguiya - * `MRO` - Mauritanian Ouguiya (1973–2017) - * `MUR` - Mauritian Rupee - * `MXV` - Mexican Investment Unit - * `MXN` - Mexican Peso - * `MXP` - Mexican Silver Peso (1861–1992) - * `MDC` - Moldovan Cupon - * `MDL` - Moldovan Leu - * `MCF` - Monegasque Franc - * `MNT` - Mongolian Tugrik - * `MAD` - Moroccan Dirham - * `MAF` - Moroccan Franc - * `MZE` - Mozambican Escudo - * `MZN` - Mozambican Metical - * `MZM` - Mozambican Metical (1980–2006) - * `MMK` - Myanmar Kyat - * `NAD` - Namibian Dollar - * `NPR` - Nepalese Rupee - * `ANG` - Netherlands Antillean Guilder - * `TWD` - New Taiwan Dollar - * `NZD` - New Zealand Dollar - * `NIO` - Nicaraguan Córdoba - * `NIC` - Nicaraguan Córdoba (1988–1991) - * `NGN` - Nigerian Naira - * `KPW` - North Korean Won - * `NOK` - Norwegian Krone - * `OMR` - Omani Rial - * `PKR` - Pakistani Rupee - * `XPD` - Palladium - * `PAB` - Panamanian Balboa - * `PGK` - Papua New Guinean Kina - * `PYG` - Paraguayan Guarani - * `PEI` - Peruvian Inti - * `PEN` - Peruvian Sol - * `PES` - Peruvian Sol (1863–1965) - * `PHP` - Philippine Peso - * `XPT` - Platinum - * `PLN` - Polish Zloty - * `PLZ` - Polish Zloty (1950–1995) - * `PTE` - Portuguese Escudo - * `GWE` - Portuguese Guinea Escudo - * `QAR` - Qatari Rial - * `XRE` - RINET Funds - * `RHD` - Rhodesian Dollar - * `RON` - Romanian Leu - * `ROL` - Romanian Leu (1952–2006) - * `RUB` - Russian Ruble - * `RUR` - Russian Ruble (1991–1998) - * `RWF` - Rwandan Franc - * `SVC` - Salvadoran Colón - * `WST` - Samoan Tala - * `SAR` - Saudi Riyal - * `RSD` - Serbian Dinar - * `CSD` - Serbian Dinar (2002–2006) - * `SCR` - Seychellois Rupee - * `SLL` - Sierra Leonean Leone - * `XAG` - Silver - * `SGD` - Singapore Dollar - * `SKK` - Slovak Koruna - * `SIT` - Slovenian Tolar - * `SBD` - Solomon Islands Dollar - * `SOS` - Somali Shilling - * `ZAR` - South African Rand - * `ZAL` - South African Rand (financial) - * `KRH` - South Korean Hwan (1953–1962) - * `KRW` - South Korean Won - * `KRO` - South Korean Won (1945–1953) - * `SSP` - South Sudanese Pound - * `SUR` - Soviet Rouble - * `ESP` - Spanish Peseta - * `ESA` - Spanish Peseta (A account) - * `ESB` - Spanish Peseta (convertible account) - * `XDR` - Special Drawing Rights - * `LKR` - Sri Lankan Rupee - * `SHP` - St. Helena Pound - * `XSU` - Sucre - * `SDD` - Sudanese Dinar (1992–2007) - * `SDG` - Sudanese Pound - * `SDP` - Sudanese Pound (1957–1998) - * `SRD` - Surinamese Dollar - * `SRG` - Surinamese Guilder - * `SZL` - Swazi Lilangeni - * `SEK` - Swedish Krona - * `CHF` - Swiss Franc - * `SYP` - Syrian Pound - * `STN` - São Tomé & Príncipe Dobra - * `STD` - São Tomé & Príncipe Dobra (1977–2017) - * `TVD` - TVD - * `TJR` - Tajikistani Ruble - * `TJS` - Tajikistani Somoni - * `TZS` - Tanzanian Shilling - * `XTS` - Testing Currency Code - * `THB` - Thai Baht - * `XXX` - The codes assigned for transactions where no currency is involved - * `TPE` - Timorese Escudo - * `TOP` - Tongan Paʻanga - * `TTD` - Trinidad & Tobago Dollar - * `TND` - Tunisian Dinar - * `TRY` - Turkish Lira - * `TRL` - Turkish Lira (1922–2005) - * `TMT` - Turkmenistani Manat - * `TMM` - Turkmenistani Manat (1993–2009) - * `USD` - US Dollar - * `USN` - US Dollar (Next day) - * `USS` - US Dollar (Same day) - * `UGX` - Ugandan Shilling - * `UGS` - Ugandan Shilling (1966–1987) - * `UAH` - Ukrainian Hryvnia - * `UAK` - Ukrainian Karbovanets - * `AED` - United Arab Emirates Dirham - * `UYW` - Uruguayan Nominal Wage Index Unit - * `UYU` - Uruguayan Peso - * `UYP` - Uruguayan Peso (1975–1993) - * `UYI` - Uruguayan Peso (Indexed Units) - * `UZS` - Uzbekistani Som - * `VUV` - Vanuatu Vatu - * `VES` - Venezuelan Bolívar - * `VEB` - Venezuelan Bolívar (1871–2008) - * `VEF` - Venezuelan Bolívar (2008–2018) - * `VND` - Vietnamese Dong - * `VNN` - Vietnamese Dong (1978–1985) - * `CHE` - WIR Euro - * `CHW` - WIR Franc - * `XOF` - West African CFA Franc - * `YDD` - Yemeni Dinar - * `YER` - Yemeni Rial - * `YUN` - Yugoslavian Convertible Dinar (1990–1992) - * `YUD` - Yugoslavian Hard Dinar (1966–1990) - * `YUM` - Yugoslavian New Dinar (1994–2002) - * `YUR` - Yugoslavian Reformed Dinar (1992–1993) - * `ZWN` - ZWN - * `ZRN` - Zairean New Zaire (1993–1998) - * `ZRZ` - Zairean Zaire (1971–1993) - * `ZMW` - Zambian Kwacha - * `ZMK` - Zambian Kwacha (1968–2012) - * `ZWD` - Zimbabwean Dollar (1980–2008) - * `ZWR` - Zimbabwean Dollar (2008) - * `ZWL` - Zimbabwean Dollar (2009) - x-merge-category: hris - PayFrequencyEnum: - enum: - - WEEKLY - - BIWEEKLY - - MONTHLY - - QUARTERLY - - SEMIANNUALLY - - ANNUALLY - - THIRTEEN-MONTHLY - - PRO_RATA - - SEMIMONTHLY - type: string - description: |- - * `WEEKLY` - WEEKLY - * `BIWEEKLY` - BIWEEKLY - * `MONTHLY` - MONTHLY - * `QUARTERLY` - QUARTERLY - * `SEMIANNUALLY` - SEMIANNUALLY - * `ANNUALLY` - ANNUALLY - * `THIRTEEN-MONTHLY` - THIRTEEN-MONTHLY - * `PRO_RATA` - PRO_RATA - * `SEMIMONTHLY` - SEMIMONTHLY - x-merge-category: hris - PayGroup: - type: object - description: |- - # The PayGroup Object - ### Description - The `PayGroup` object is used to represent a subset of employees that are put together for payroll processing purposes. - - ### Usage Example - Fetch from the `LIST PayGroup` endpoint and filter by `ID` to show all pay group information. - properties: - id: - type: string - format: uuid - readOnly: true - example: fd1e0fb5-8f92-4ec9-9f32-179cf732867d - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '800293' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - pay_group_name: - type: string - nullable: true - description: The pay group name. - example: contractor - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /pay-group - data: - - Varies by platform - x-merge-category: hris - PayPeriodEnum: - enum: - - HOUR - - DAY - - WEEK - - EVERY_TWO_WEEKS - - SEMIMONTHLY - - MONTH - - QUARTER - - EVERY_SIX_MONTHS - - YEAR - type: string - description: |- - * `HOUR` - HOUR - * `DAY` - DAY - * `WEEK` - WEEK - * `EVERY_TWO_WEEKS` - EVERY_TWO_WEEKS - * `SEMIMONTHLY` - SEMIMONTHLY - * `MONTH` - MONTH - * `QUARTER` - QUARTER - * `EVERY_SIX_MONTHS` - EVERY_SIX_MONTHS - * `YEAR` - YEAR - x-merge-category: hris - PayrollRun: - type: object - description: |- - # The PayrollRun Object - ### Description - The `PayrollRun` object is used to represent a group of pay statements for a specific pay schedule. - - ### Usage Example - Fetch from the `LIST PayrollRuns` endpoint and filter by `ID` to show all payroll runs. - properties: - id: - type: string - format: uuid - readOnly: true - example: 37336947-b3d4-4a4c-a310-ab6ab510e079 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - run_state: - oneOf: - - $ref: '#/components/schemas/RunStateEnum' - - type: string - nullable: true - description: |- - The state of the payroll run - - * `PAID` - PAID - * `DRAFT` - DRAFT - * `APPROVED` - APPROVED - * `FAILED` - FAILED - * `CLOSED` - CLOSED - example: PAID - run_type: - oneOf: - - $ref: '#/components/schemas/RunTypeEnum' - - type: string - nullable: true - description: |- - The type of the payroll run - - * `REGULAR` - REGULAR - * `OFF_CYCLE` - OFF_CYCLE - * `CORRECTION` - CORRECTION - * `TERMINATION` - TERMINATION - * `SIGN_ON_BONUS` - SIGN_ON_BONUS - example: REGULAR - start_date: - type: string - format: date-time - nullable: true - description: The day and time the payroll run started. - example: '2020-11-08T00:00:00Z' - end_date: - type: string - format: date-time - nullable: true - description: The day and time the payroll run ended. - example: '2020-11-15T00:00:00Z' - check_date: - type: string - format: date-time - nullable: true - description: The day and time the payroll run was checked. - example: '2020-11-15T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /payroll - data: - - Varies by platform - x-merge-category: hris - PolicyTypeEnum: - enum: - - VACATION - - SICK - - PERSONAL - - JURY_DUTY - - VOLUNTEER - - BEREAVEMENT - type: string - description: |- - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - x-merge-category: hris - ReasonEnum: - enum: - - GENERAL_CUSTOMER_REQUEST - - GDPR - - OTHER - type: string - description: |- - * `GENERAL_CUSTOMER_REQUEST` - GENERAL_CUSTOMER_REQUEST - * `GDPR` - GDPR - * `OTHER` - OTHER - x-merge-category: hris - RelationshipEnum: - enum: - - CHILD - - SPOUSE - - DOMESTIC_PARTNER - type: string - description: |- - * `CHILD` - CHILD - * `SPOUSE` - SPOUSE - * `DOMESTIC_PARTNER` - DOMESTIC_PARTNER - x-merge-category: hris - RemoteData: - type: object - description: |- - # 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 - description: The third-party API path that is being called. - example: /platform-endpoint - data: - readOnly: true - description: The data returned from the third-party for this object in its - original, unnormalized format. - example: - - Varies by platform - required: - - path - x-merge-category: hris - RemoteEndpointInfo: - type: object - properties: - method: - type: string - example: GET - url_path: - type: string - example: /example-url-path - field_traversal_path: - type: array - items: {} - example: - - example_key_name - required: - - field_traversal_path - - method - - url_path - x-merge-category: hris - RemoteFieldAPI: - type: object - properties: - schema: - type: object - additionalProperties: {} - example: - type: string - remote_key_name: - type: string - example: example_remote_key_name - remote_endpoint_info: - $ref: '#/components/schemas/RemoteEndpointInfo' - example: - method: GET - url_path: /example-url-path - field_traversal_path: - - example_key_name - example_values: - type: array - items: {} - nullable: true - example: - - example - advanced_metadata: - allOf: - - $ref: '#/components/schemas/AdvancedMetadata' - nullable: true - coverage: - oneOf: - - type: integer - - type: number - format: double - nullable: true - readOnly: true - example: 0.33 - required: - - advanced_metadata - - remote_endpoint_info - - remote_key_name - - schema - x-merge-category: hris - RemoteFieldAPIResponse: - type: object - properties: - Benefit: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - EmployerBenefit: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Company: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - EmployeePayrollRun: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Employee: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Employment: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Location: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - PayrollRun: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Team: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - TimeOff: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - TimeOffBalance: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - BankInfo: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - PayGroup: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Group: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Dependent: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - TimesheetEntry: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - x-merge-category: hris - RemoteKey: - type: object - description: |- - # 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: - type: string - example: Remote Deployment Key 1 - key: - type: string - example: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA - required: - - key - - name - x-merge-category: hris - RemoteKeyForRegenerationRequest: - type: object - description: |- - # The RemoteKeyForRegeneration Object - ### Description - The `RemoteKeyForRegeneration` object is used to exchange an old remote key for a new one - - ### Usage Example - Post a `RemoteKeyForRegeneration` to swap out an old remote key for a new one - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: hris - RemoteResponse: - type: object - description: |- - # 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: - type: string - example: GET - path: - type: string - example: /scooters - status: - type: integer - example: 200 - response: - example: - scooters: - - company: Lime - model: Gen 2.5 - - company: Bird - model: Bird Zero - response_headers: - type: object - additionalProperties: {} - example: - X-Page-Token: value - response_type: - oneOf: - - $ref: '#/components/schemas/ResponseTypeEnum' - - type: string - example: JSON - headers: - type: object - additionalProperties: {} - example: - EXTRA-HEADER: value - Authorization: - required: - - method - - path - - response - - status - x-merge-category: hris - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - type: string - description: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - x-merge-category: hris - RequestTypeEnum: - enum: - - VACATION - - SICK - - PERSONAL - - JURY_DUTY - - VOLUNTEER - - BEREAVEMENT - type: string - description: |- - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - x-merge-category: hris - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - type: string - description: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - x-merge-category: hris - RoleEnum: - enum: - - ADMIN - - DEVELOPER - - MEMBER - - API - - SYSTEM - - MERGE_TEAM - type: string - description: |- - * `ADMIN` - ADMIN - * `DEVELOPER` - DEVELOPER - * `MEMBER` - MEMBER - * `API` - API - * `SYSTEM` - SYSTEM - * `MERGE_TEAM` - MERGE_TEAM - x-merge-category: hris - RunStateEnum: - enum: - - PAID - - DRAFT - - APPROVED - - FAILED - - CLOSED - type: string - description: |- - * `PAID` - PAID - * `DRAFT` - DRAFT - * `APPROVED` - APPROVED - * `FAILED` - FAILED - * `CLOSED` - CLOSED - x-merge-category: hris - RunTypeEnum: - enum: - - REGULAR - - OFF_CYCLE - - CORRECTION - - TERMINATION - - SIGN_ON_BONUS - type: string - description: |- - * `REGULAR` - REGULAR - * `OFF_CYCLE` - OFF_CYCLE - * `CORRECTION` - CORRECTION - * `TERMINATION` - TERMINATION - * `SIGN_ON_BONUS` - SIGN_ON_BONUS - x-merge-category: hris - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - type: string - description: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - x-merge-category: hris - StatusFd5Enum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: hris - SyncStatus: - type: object - description: |- - # 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: - type: string - example: Employee - model_id: - type: string - example: hris.Employee - last_sync_start: - type: string - format: date-time - example: '2021-03-30T19:44:18.695973Z' - next_sync_start: - type: string - format: date-time - example: '2021-03-30T20:44:18.662942Z' - last_sync_result: - oneOf: - - $ref: '#/components/schemas/LastSyncResultEnum' - - type: string - example: DONE - last_sync_finished: - type: string - format: date-time - example: '2021-03-30T19:55:18.695973Z' - status: - oneOf: - - $ref: '#/components/schemas/StatusFd5Enum' - - type: string - example: SYNCING - is_initial_sync: - type: boolean - example: true - selective_sync_configurations_usage: - $ref: '#/components/schemas/SelectiveSyncConfigurationsUsageEnum' - required: - - is_initial_sync - - model_id - - model_name - - status - x-merge-sample-json: '{"model_name": "Candidate", "model_id": "ats.Candidate", - "last_sync_start": "2021-03-30T19:44:18.695973Z", "next_sync_start": "2021-03-30T20:44:18.662942Z", - "status": "SYNCING", "is_initial_sync": true}' - x-merge-category: hris - Tax: - type: object - description: |- - # The Tax Object - ### Description - The `Tax` object is used to represent an array of the tax deductions for a given employee's payroll run. - - ### Usage Example - Fetch from the `LIST Taxes` endpoint and filter by `ID` to show all taxes. - properties: - id: - type: string - format: uuid - readOnly: true - example: e3a825fd-c38d-4095-a717-df98c4cb9ebc - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '26806834' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee_payroll_run: - type: string - format: uuid - nullable: true - example: 35347df1-95e7-46e2-93cc-66f1191edca5 - name: - type: string - nullable: true - description: The tax's name. - example: California State Income Tax - amount: - type: number - format: double - nullable: true - description: The tax amount. - example: 100.25 - employer_tax: - type: boolean - nullable: true - description: Whether or not the employer is responsible for paying the tax. - example: 'False' - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-nested-write-allowed: true - x-merge-category: hris - Team: - type: object - description: |- - # The Team Object - ### Description - The `Team` object is used to represent a subdivision of the company, usually a department. Each employee will be grouped into one specific Team. - - ### Usage Example - If you're building a way to filter by `Team`, you'd hit the `GET Teams` endpoint to fetch the `Teams`, and then use the `ID` of the team your user selects to filter the `GET Employees` endpoint. - properties: - id: - type: string - format: uuid - readOnly: true - example: 13a72919-9fae-4f54-81ca-ddfd8712a1ba - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The team's name. - example: Engineering - parent_team: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Team' - nullable: true - description: The team's parent team. - example: 1b998423-db0a-4037-a4cf-f79c60cb67b3 - x-merge-expands-to: Team - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /teams - data: - - Varies by platform - x-merge-expands: '{"parent_team": "Team"}' - x-merge-category: hris - TimeOff: - type: object - description: |- - # The TimeOff Object - ### Description - The `TimeOff` object is used to represent all employees' Time Off entries. - - ### Usage Example - Fetch from the `LIST TimeOffs` endpoint and filter by `ID` to show all time off requests. - properties: - id: - type: string - format: uuid - readOnly: true - example: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee requesting time off. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Employee - approver: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The Merge ID of the employee with the ability to approve the - time off request. - example: 9efbc633-3387-4306-aa55-e2c635e6bb4f - x-merge-expands-to: Employee - status: - oneOf: - - $ref: '#/components/schemas/TimeOffStatusEnum' - - type: string - nullable: true - description: |- - The status of this time off request. - - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - example: APPROVED - employee_note: - type: string - nullable: true - description: The employee note for this time off request. - example: Moving into the new apartment Kendall Roy gave me! - units: - oneOf: - - $ref: '#/components/schemas/UnitsEnum' - - type: string - nullable: true - description: |- - The measurement that the third-party integration uses to count time requested. - - * `HOURS` - HOURS - * `DAYS` - DAYS - example: DAYS - amount: - type: number - format: double - nullable: true - description: The time off quantity measured by the prescribed “units”. - example: 3 - request_type: - oneOf: - - $ref: '#/components/schemas/RequestTypeEnum' - - type: string - nullable: true - description: |- - The type of time off request. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - example: VACATION - start_time: - type: string - format: date-time - nullable: true - description: The day and time of the start of the time requested off. - example: '2020-11-10T00:00:00Z' - end_time: - type: string - format: date-time - nullable: true - description: The day and time of the end of the time requested off. - example: '2020-11-17T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /leave - data: - - Varies by platform - x-merge-expands: '{"approver": "Employee", "employee": "Employee"}' - x-merge-category: hris - TimeOffBalance: - type: object - description: |- - # The TimeOffBalance Object - ### Description - The `TimeOffBalance` object is used to represent current balances for an employee's Time Off plan. - - ### Usage Example - Fetch from the `LIST TimeOffBalances` endpoint and filter by `ID` to show all time off balances. - properties: - id: - type: string - format: uuid - readOnly: true - example: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee the balance belongs to. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Employee - balance: - type: number - format: double - nullable: true - description: The current remaining PTO balance, measured in hours. For integrations - that return this value in days, Merge multiplies by 8 to calculate hours. - example: '60.0' - used: - type: number - format: double - nullable: true - description: The amount of PTO used in terms of hours. For integrations - that return this value in days, Merge multiplies by 8 to calculate hours. - example: '45.0' - policy_type: - oneOf: - - $ref: '#/components/schemas/PolicyTypeEnum' - - type: string - nullable: true - description: |- - The policy type of this time off balance. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - example: VACATION - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /leave - data: - - Varies by platform - x-merge-expands: '{"employee": "Employee"}' - x-merge-category: hris - TimeOffEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/TimeOffRequest' - required: - - model - x-merge-category: hris - TimeOffRequest: - type: object - description: |- - # The TimeOff Object - ### Description - The `TimeOff` object is used to represent all employees' Time Off entries. - - ### Usage Example - Fetch from the `LIST TimeOffs` endpoint and filter by `ID` to show all time off requests. - properties: - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee requesting time off. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Employee - approver: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The Merge ID of the employee with the ability to approve the - time off request. - example: 9efbc633-3387-4306-aa55-e2c635e6bb4f - x-merge-expands-to: Employee - status: - oneOf: - - $ref: '#/components/schemas/TimeOffStatusEnum' - - type: string - nullable: true - description: |- - The status of this time off request. - - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - example: APPROVED - employee_note: - type: string - nullable: true - description: The employee note for this time off request. - example: Moving into the new apartment Kendall Roy gave me! - units: - oneOf: - - $ref: '#/components/schemas/UnitsEnum' - - type: string - nullable: true - description: |- - The measurement that the third-party integration uses to count time requested. - - * `HOURS` - HOURS - * `DAYS` - DAYS - example: DAYS - amount: - type: number - format: double - nullable: true - description: The time off quantity measured by the prescribed “units”. - example: 3 - request_type: - oneOf: - - $ref: '#/components/schemas/RequestTypeEnum' - - type: string - nullable: true - description: |- - The type of time off request. - - * `VACATION` - VACATION - * `SICK` - SICK - * `PERSONAL` - PERSONAL - * `JURY_DUTY` - JURY_DUTY - * `VOLUNTEER` - VOLUNTEER - * `BEREAVEMENT` - BEREAVEMENT - example: VACATION - start_time: - type: string - format: date-time - nullable: true - description: The day and time of the start of the time requested off. - example: '2020-11-10T00:00:00Z' - end_time: - type: string - format: date-time - nullable: true - description: The day and time of the end of the time requested off. - example: '2020-11-17T00:00:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"approver": "Employee", "employee": "Employee"}' - x-merge-category: hris - TimeOffResponse: - type: object - properties: - model: - $ref: '#/components/schemas/TimeOff' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: hris - TimeOffStatusEnum: - enum: - - REQUESTED - - APPROVED - - DECLINED - - CANCELLED - - DELETED - type: string - description: |- - * `REQUESTED` - REQUESTED - * `APPROVED` - APPROVED - * `DECLINED` - DECLINED - * `CANCELLED` - CANCELLED - * `DELETED` - DELETED - x-merge-category: hris - TimesheetEntry: - type: object - description: |- - # The Timesheet Entry Object - ### Description - The `Timesheet Entry` object is used to track coverage for hours worked by an 'Employee'. - - - ### Usage Example - GET and POST Timesheet Entries - properties: - id: - type: string - format: uuid - readOnly: true - example: 91b2b905-e866-40c8-8be2-efe53827a0aa - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee the timesheet entry is for. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Employee - hours_worked: - type: number - format: double - nullable: true - description: The number of hours logged by the employee. - example: 10 - start_time: - type: string - format: date-time - nullable: true - description: The time at which the employee started work. - example: '2020-11-10T00:00:00Z' - end_time: - type: string - format: date-time - nullable: true - description: The time at which the employee ended work. - example: '2020-11-10T00:10:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /dependent - data: - - Varies by platform - x-merge-expands: '{"employee": "Employee"}' - x-merge-category: hris - TimesheetEntryEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/TimesheetEntryRequest' - required: - - model - x-merge-category: hris - TimesheetEntryRequest: - type: object - description: |- - # The Timesheet Entry Object - ### Description - The `Timesheet Entry` object is used to track coverage for hours worked by an 'Employee'. - - - ### Usage Example - GET and POST Timesheet Entries - properties: - employee: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Employee' - nullable: true - description: The employee the timesheet entry is for. - example: d2f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Employee - hours_worked: - type: number - format: double - nullable: true - description: The number of hours logged by the employee. - example: 10 - start_time: - type: string - format: date-time - nullable: true - description: The time at which the employee started work. - example: '2020-11-10T00:00:00Z' - end_time: - type: string - format: date-time - nullable: true - description: The time at which the employee ended work. - example: '2020-11-10T00:10:00Z' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"employee": "Employee"}' - x-merge-category: hris - TimesheetEntryResponse: - type: object - properties: - model: - $ref: '#/components/schemas/TimesheetEntry' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: hris - UnitsEnum: - enum: - - HOURS - - DAYS - type: string - description: |- - * `HOURS` - HOURS - * `DAYS` - DAYS - x-merge-category: hris - ValidationProblemSource: - type: object - properties: - pointer: - type: string - required: - - pointer - x-merge-category: hris - WarningValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /age - title: - type: string - example: Unrecognized Field - detail: - type: string - example: An unrecognized field, age, was passed in with request data. - problem_type: - type: string - example: UNRECOGNIZED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: hris - WebhookReceiver: - type: object - properties: - event: - type: string - is_active: - type: boolean - key: - type: string - required: - - event - - is_active - x-merge-category: hris - WebhookReceiverRequest: - type: object - properties: - event: - type: string - minLength: 1 - is_active: - type: boolean - key: - type: string - minLength: 1 - required: - - event - - is_active - x-merge-category: hris - securitySchemes: - tokenAuth: - type: http - scheme: bearer - description: Token-based authentication with required prefix "Bearer" - x-fern-token-variable-name: api_key -servers: -- url: https://api.merge.dev/api/hris/v1 - description: Production - x-fern-server-name: Production -- url: https://api-sandbox.merge.dev/api/hris/v1 - description: Sandbox - x-fern-server-name: Sandbox -- url: https://api-eu.merge.dev/api/hris/v1 - description: Production EU - x-fern-server-name: ProductionEU -- url: https://api-ap.merge.dev/api/hris/v1 - description: Production APSE1 - x-fern-server-name: ProductionAPSE1 diff --git a/.mock/ticketing_v3.yml b/.mock/ticketing_v3.yml deleted file mode 100644 index a493d5ea1..000000000 --- a/.mock/ticketing_v3.yml +++ /dev/null @@ -1,8427 +0,0 @@ -openapi: 3.0.3 -info: - title: Merge Ticketing API - version: '1.0' - description: The unified API for building rich integrations with multiple Ticketing - platforms. - contact: - name: Merge Team - url: https://www.merge.dev/ - email: hello@merge.dev -paths: - /ticketing/v1/account-details: - get: - operationId: account_details_retrieve - description: Get details for a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - account-details - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountDetails' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/account-token/{public_token}: - get: - operationId: account_token_retrieve - description: Returns the account token for the end user with the provided public - token. - parameters: - - in: path - name: public_token - schema: - type: string - required: true - tags: - - account-token - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AccountToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/accounts: - get: - operationId: accounts_list - description: Returns a list of `Account` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/accounts/{id}: - get: - operationId: accounts_retrieve - description: Returns an `Account` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Account' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/async-passthrough: - post: - operationId: async_passthrough_create - description: Asynchronously pull data from an endpoint not currently supported - by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - async-passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncPassthroughReciept' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/async-passthrough/{async_passthrough_receipt_id}: - get: - operationId: async_passthrough_retrieve - description: Retrieves data from earlier async-passthrough POST request - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: async_passthrough_receipt_id - schema: - type: string - format: uuid - required: true - tags: - - async-passthrough - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/RemoteResponse' - - type: string - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/attachments: - get: - operationId: attachments_list - description: Returns a list of `Attachment` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - ticket - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTicket: - value: ticket - summary: Expand Ticket - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_created_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return attachments created in the third - party platform after this datetime. - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: ticket_id - schema: - type: string - description: If provided, will only return comments for this ticket. - examples: - TicketId: - summary: ticket_id - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAttachmentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: attachments_create - description: Creates an `Attachment` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - attachments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TicketingAttachmentEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TicketingAttachmentEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/TicketingAttachmentEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TicketingAttachmentResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/attachments/{id}: - get: - operationId: attachments_retrieve - description: Returns an `Attachment` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - ticket - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTicket: - value: ticket - summary: Expand Ticket - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Attachment' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/attachments/{id}/download: - get: - operationId: attachments_download_retrieve - description: Returns the `File` content with the given `id` as a stream of bytes. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: mime_type - schema: - type: string - description: 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. - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/octet-stream: - schema: - type: string - format: binary - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/attachments/meta/post: - get: - operationId: attachments_meta_post_retrieve - description: Returns metadata for `TicketingAttachment` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - attachments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/audit-trail: - get: - operationId: audit_trail_list - description: Gets a list of audit trail events. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include audit trail events that occurred - before this time - - in: query - name: event_type - schema: - type: string - description: '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`' - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include audit trail events that occurred - after this time - - in: query - name: user_email - schema: - type: string - description: 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. - tags: - - audit-trail - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAuditLogEventList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/available-actions: - get: - operationId: available_actions_retrieve - description: Returns a list of models and actions available for an account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - available-actions - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AvailableActions' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/collections: - get: - operationId: collections_list - description: Returns a list of `Collection` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: collection_type - schema: - type: string - nullable: true - enum: - - '' - - LIST - - - - PROJECT - description: If provided, will only return collections of the given type. - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - parent_collection - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandParentCollection: - value: parent_collection - summary: Expand Parent_collection - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return collections with this name. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: parent_collection_id - schema: - type: string - description: If provided, will only return collections whose parent collection - matches the given id. - examples: - ParentCollectionId: - summary: parent_collection_id - - in: query - name: remote_fields - schema: - type: string - enum: - - collection_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesCollectionType: - value: collection_type - summary: Original Enum Values Collection_type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - collection_type - description: 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) - examples: - OriginalEnumValuesCollectionType: - value: collection_type - summary: Original Enum Values Collection_type - tags: - - collections - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCollectionList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/collections/{collection_id}/viewers: - get: - operationId: collections_viewers_list - 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) - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: collection_id - schema: - type: string - format: uuid - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - team - - user - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandUser,Team: - value: user,team - summary: Expand User, Team - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - collections - - viewers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedViewerList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ticketing/v1/collections/{id}: - get: - operationId: collections_retrieve - description: Returns a `Collection` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - parent_collection - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandParentCollection: - value: parent_collection - summary: Expand Parent_collection - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - collection_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesCollectionType: - value: collection_type - summary: Original Enum Values Collection_type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - collection_type - description: 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) - examples: - OriginalEnumValuesCollectionType: - value: collection_type - summary: Original Enum Values Collection_type - tags: - - collections - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Collection' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/comments: - get: - operationId: comments_list - description: Returns a list of `Comment` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - contact - - ticket - - user - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandUser,Contact,Ticket: - value: user,contact,ticket - summary: Expand User, Contact, Ticket - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_created_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return Comments created in the third party - platform after this datetime. - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: ticket_id - schema: - type: string - description: If provided, will only return comments for this ticket. - examples: - TicketId: - summary: ticket_id - tags: - - comments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCommentList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: comments_create - description: Creates a `Comment` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - comments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CommentEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CommentEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CommentEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CommentResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/comments/{id}: - get: - operationId: comments_retrieve - description: Returns a `Comment` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - contact - - ticket - - user - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandUser,Contact,Ticket: - value: user,contact,ticket - summary: Expand User, Contact, Ticket - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - comments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/comments/meta/post: - get: - operationId: comments_meta_post_retrieve - description: Returns metadata for `Comment` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - comments - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/contacts: - get: - operationId: contacts_list - description: Returns a list of `Contact` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email_address - schema: - type: string - nullable: true - description: If provided, will only return Contacts that match this email. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAccount: - value: account - summary: Expand Account - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedContactList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: contacts_create - description: Creates a `Contact` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - contacts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TicketingContactEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TicketingContactEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/TicketingContactEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TicketingContactResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/contacts/{id}: - get: - operationId: contacts_retrieve - description: Returns a `Contact` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAccount: - value: account - summary: Expand Account - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Contact' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/contacts/meta/post: - get: - operationId: contacts_meta_post_retrieve - description: Returns metadata for `TicketingContact` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - contacts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/default-scopes: - get: - operationId: default_scopes_retrieve - description: 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). - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/delete-account: - post: - operationId: delete_account_delete - description: Delete a linked account. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - delete-account - security: - - tokenAuth: [] - responses: - '200': - description: No response body - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/field-mappings: - get: - operationId: field_mappings_retrieve - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingApiInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: field_mappings_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: exclude_remote_field_metadata - schema: - type: boolean - description: 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. - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateFieldMappingRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/field-mappings/{field_mapping_id}: - patch: - operationId: field_mappings_partial_update - 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEditFieldMappingRequest' - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - delete: - operationId: field_mappings_destroy - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: field_mapping_id - schema: - type: string - format: uuid - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '204': - content: - application/json: - schema: - $ref: '#/components/schemas/FieldMappingInstanceResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/generate-key: - post: - operationId: generate_key_create - description: Create a remote key. - tags: - - generate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/GenerateRemoteKeyRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/issues: - get: - operationId: issues_list - description: Gets all issues for Organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: account_token - schema: - type: string - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred before this time - - in: query - name: end_user_organization_name - schema: - type: string - - in: query - name: first_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was after this datetime. - - in: query - name: first_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose first incident time - was before this datetime. - - in: query - name: include_muted - schema: - type: string - description: If true, will include muted issues - - in: query - name: integration_name - schema: - type: string - - in: query - name: last_incident_time_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was after this datetime. - - in: query - name: last_incident_time_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return issues whose last incident time - was before this datetime. - - in: query - name: linked_account_id - schema: - type: string - description: If provided, will only include issues pertaining to the linked - account passed in. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: start_date - schema: - type: string - description: If included, will only include issues whose most recent action - occurred after this time - - in: query - name: status - schema: - type: string - enum: - - ONGOING - - RESOLVED - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedIssueList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/issues/{id}: - get: - operationId: issues_retrieve - description: Get a specific issue. - parameters: - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - issues - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Issue' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/link-token: - post: - operationId: link_token_create - description: Creates a link token to be used when linking a new end user. - tags: - - link-token - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/EndUserDetailsRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LinkToken' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/linked-account-scopes: - get: - operationId: linked_account_scopes_retrieve - 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). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: linked_account_scopes_create - description: 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: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - scopes - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/LinkedAccountCommonModelScopeDeserializerRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CommonModelScopeAPI' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/linked-accounts: - get: - operationId: linked_accounts_list - description: List linked accounts for your organization. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: query - name: category - schema: - type: string - nullable: true - enum: - - accounting - - ats - - crm - - filestorage - - hris - - mktg - - ticketing - description: |- - Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` - - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: end_user_email_address - schema: - type: string - description: If provided, will only return linked accounts associated with - the given email address. - - in: query - name: end_user_organization_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given organization name. - - in: query - name: end_user_origin_id - schema: - type: string - description: If provided, will only return linked accounts associated with - the given origin ID. - - in: query - name: end_user_origin_ids - schema: - type: string - description: Comma-separated list of EndUser origin IDs, making it possible - to specify multiple EndUsers at once. - - in: query - name: id - schema: - type: string - format: uuid - - in: query - name: ids - schema: - type: string - description: Comma-separated list of LinkedAccount IDs, making it possible - to specify multiple LinkedAccounts at once. - - in: query - name: include_duplicates - schema: - type: boolean - description: 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. - - in: query - name: integration_name - schema: - type: string - description: If provided, will only return linked accounts associated with - the given integration name. - - in: query - name: is_test_account - schema: - type: string - description: If included, will only include test linked accounts. If not included, - will only include non-test linked accounts. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: status - schema: - type: string - description: 'Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, - `RELINK_NEEDED`' - tags: - - linked-accounts - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedAccountDetailsAndActionsList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/passthrough: - post: - operationId: passthrough_create - description: Pull data from an endpoint not currently supported by Merge. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - passthrough - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DataPassthroughRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/projects: - get: - operationId: projects_list - description: Returns a list of `Project` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - projects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProjectList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/projects/{id}: - get: - operationId: projects_retrieve - description: Returns a `Project` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - projects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Project' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/projects/{parent_id}/users: - get: - operationId: projects_users_list - description: Returns a list of `User` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - roles - - teams - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTeams,Roles: - value: teams,roles - summary: Expand Teams, Roles - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: path - name: parent_id - schema: - type: string - format: uuid - required: true - tags: - - projects - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/regenerate-key: - post: - operationId: regenerate_key_create - description: Exchange remote keys. - tags: - - regenerate-key - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/RemoteKeyForRegenerationRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteKey' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/remote-fields: - get: - operationId: 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: common_models - schema: - type: string - description: A comma seperated list of Common Model names. If included, will - only return Remote Fields for those Common Models. - - in: query - name: include_example_values - schema: - type: string - description: 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. - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/RemoteFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/roles: - get: - operationId: roles_list - description: Returns a list of `Role` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - roles - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRoleList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/roles/{id}: - get: - operationId: roles_retrieve - description: Returns a `Role` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - roles - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Role' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/sync-status: - get: - operationId: 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). - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - sync-status - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedSyncStatusList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/sync-status/resync: - post: - operationId: 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. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - force-resync - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/tags: - get: - operationId: tags_list - description: Returns a list of `Tag` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - tags - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTagList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/tags/{id}: - get: - operationId: tags_retrieve - description: Returns a `Tag` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - tags - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Tag' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/target-fields: - get: - operationId: target_fields_retrieve - 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/). - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - field-mapping - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalTargetFieldAPIResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/teams: - get: - operationId: teams_list - description: Returns a list of `Team` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - tags: - - teams - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTeamList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/teams/{id}: - get: - operationId: teams_retrieve - description: Returns a `Team` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - teams - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Team' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/tickets: - get: - operationId: tickets_list - description: Returns a list of `Ticket` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: account_id - schema: - type: string - description: If provided, will only return tickets for this account. - examples: - AccountId: - summary: account_id - - in: query - name: assignee_ids - schema: - type: string - description: If provided, will only return tickets assigned to the assignee_ids; - multiple assignee_ids can be separated by commas. - - in: query - name: collection_ids - schema: - type: string - description: If provided, will only return tickets assigned to the collection_ids; - multiple collection_ids can be separated by commas. - - in: query - name: completed_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets completed after this datetime. - - in: query - name: completed_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets completed before this datetime. - - in: query - name: contact_id - schema: - type: string - description: If provided, will only return tickets for this contact. - examples: - ContactId: - summary: contact_id - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: creator_id - schema: - type: string - description: If provided, will only return tickets created by this creator_id. - examples: - CreatorId: - summary: creator_id - - in: query - name: creator_ids - schema: - type: string - description: If provided, will only return tickets created by the creator_ids; - multiple creator_ids can be separated by commas. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: due_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets due after this datetime. - - in: query - name: due_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets due before this datetime. - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - assigned_teams - - assignees - - attachments - - collections - - contact - - creator - - parent_ticket - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAttachments,Assignees,Collections,AssignedTeams,Account,Contact,Creator,ParentTicket: - value: - attachments,assignees,collections,assigned_teams,account,contact,creator,parent_ticket - summary: Expand Attachments, Assignees, Collections, Assigned_teams, Account, - Contact, Creator, Parent_ticket - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - in: query - name: name - schema: - type: string - nullable: true - description: If provided, will only return tickets with this name. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: parent_ticket_id - schema: - type: string - description: If provided, will only return sub tickets of the parent_ticket_id. - examples: - ParentTicketId: - summary: parent_ticket_id - - in: query - name: priority - schema: - type: string - nullable: true - enum: - - HIGH - - LOW - - NORMAL - - URGENT - description: |- - If provided, will only return tickets of this priority. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - - in: query - name: remote_created_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets created in the third party - platform after this datetime. - - in: query - name: remote_created_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets created in the third party - platform before this datetime. - - in: query - name: remote_fields - schema: - type: string - enum: - - priority - - priority,status - - priority,status,ticket_type - - priority,ticket_type - - status - - status,ticket_type - - ticket_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesPriority,Status,TicketType: - value: priority,status,ticket_type - summary: Original Enum Values Priority, Status, Ticket_type - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: remote_updated_after - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets updated in the third party - platform after this datetime. - - in: query - name: remote_updated_before - schema: - type: string - format: date-time - nullable: true - description: If provided, will only return tickets updated in the third party - platform before this datetime. - - in: query - name: show_enum_origins - schema: - type: string - enum: - - priority - - priority,status - - priority,status,ticket_type - - priority,ticket_type - - status - - status,ticket_type - - ticket_type - description: 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) - examples: - OriginalEnumValuesPriority,Status,TicketType: - value: priority,status,ticket_type - summary: Original Enum Values Priority, Status, Ticket_type - - in: query - name: status - schema: - type: string - nullable: true - enum: - - '' - - CLOSED - - IN_PROGRESS - - - - ON_HOLD - - OPEN - description: If provided, will only return tickets of this status. - - in: query - name: tags - schema: - type: string - description: If provided, will only return tickets matching the tags; multiple - tags can be separated by commas. - - in: query - name: ticket_type - schema: - type: string - nullable: true - description: If provided, will only return tickets of this type. - - in: query - name: ticket_url - schema: - type: string - format: uri - nullable: true - description: If provided, will only return tickets where the URL matches or - contains the substring - tags: - - tickets - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedTicketList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: tickets_create - description: Creates a `Ticket` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - tickets - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TicketEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TicketEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/TicketEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/TicketResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/tickets/{id}: - get: - operationId: tickets_retrieve - description: Returns a `Ticket` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - account - - assigned_teams - - assignees - - attachments - - collections - - contact - - creator - - parent_ticket - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandAttachments,Assignees,Collections,AssignedTeams,Account,Contact,Creator,ParentTicket: - value: - attachments,assignees,collections,assigned_teams,account,contact,creator,parent_ticket - summary: Expand Attachments, Assignees, Collections, Assigned_teams, Account, - Contact, Creator, Parent_ticket - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_remote_fields - schema: - type: boolean - description: Whether to include all remote fields, including fields that Merge - did not map to common models, in a normalized format. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: remote_fields - schema: - type: string - enum: - - priority - - priority,status - - priority,status,ticket_type - - priority,ticket_type - - status - - status,ticket_type - - ticket_type - description: Deprecated. Use show_enum_origins. - examples: - OriginalEnumValuesPriority,Status,TicketType: - value: priority,status,ticket_type - summary: Original Enum Values Priority, Status, Ticket_type - - in: query - name: show_enum_origins - schema: - type: string - enum: - - priority - - priority,status - - priority,status,ticket_type - - priority,ticket_type - - status - - status,ticket_type - - ticket_type - description: 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) - examples: - OriginalEnumValuesPriority,Status,TicketType: - value: priority,status,ticket_type - summary: Original Enum Values Priority, Status, Ticket_type - tags: - - tickets - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Ticket' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - patch: - operationId: tickets_partial_update - description: Updates a `Ticket` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: is_debug_mode - schema: - type: boolean - description: Whether to include debug fields (such as log file links) in the - response. - - in: query - name: run_async - schema: - type: boolean - description: Whether or not third-party updates should be run asynchronously. - tags: - - tickets - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedTicketEndpointRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedTicketEndpointRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedTicketEndpointRequest' - required: true - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TicketResponse' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/tickets/{ticket_id}/viewers: - get: - operationId: tickets_viewers_list - 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 `Ticket` with the given id. [Learn - more.](https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls) - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - team - - user - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandUser,Team: - value: user,team - summary: Expand User, Team - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: path - name: ticket_id - schema: - type: string - format: uuid - required: true - tags: - - tickets - - viewers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedViewerList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ticketing/v1/tickets/meta/patch/{id}: - get: - operationId: tickets_meta_patch_retrieve - description: Returns metadata for `Ticket` PATCHs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: path - name: id - schema: - type: string - format: uuid - required: true - tags: - - tickets - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-patch: META_PATCH - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/tickets/meta/post: - get: - operationId: tickets_meta_post_retrieve - description: Returns metadata for `Ticket` POSTs. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: collection_id - schema: - type: string - description: If provided, will only return tickets for this collection. - - in: query - name: ticket_type - schema: - type: string - description: If provided, will only return tickets for this ticket type. - tags: - - tickets - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/MetaResponse' - description: '' - x-merge-meta-post: META_POST - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/tickets/remote-field-classes: - get: - operationId: tickets_remote_field_classes_list - description: Returns a list of `RemoteFieldClass` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: ids - schema: - type: string - description: If provided, will only return remote field classes with the `ids` - in this list - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: is_common_model_field - schema: - type: boolean - nullable: true - description: If provided, will only return remote field classes with this - is_common_model_field value - - in: query - name: is_custom - schema: - type: boolean - nullable: true - description: If provided, will only return remote fields classes with this - is_custom value - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - tickets - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedRemoteFieldClassList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC_BETA - /ticketing/v1/users: - get: - operationId: users_list - description: Returns a list of `User` objects. - x-fern-pagination: - cursor: $request.cursor - next_cursor: $response.next - results: $response.results - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: created_after - schema: - type: string - format: date-time - description: If provided, will only return objects created after this datetime. - - in: query - name: created_before - schema: - type: string - format: date-time - description: If provided, will only return objects created before this datetime. - - in: query - name: cursor - schema: - type: string - description: The pagination cursor value. - examples: - CursorExample: - value: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - summary: Cursor Example - - in: query - name: email_address - schema: - type: string - nullable: true - description: If provided, will only return users with emails equal to this - value (case insensitive). - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - roles - - teams - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTeams,Roles: - value: teams,roles - summary: Expand Teams, Roles - explode: false - - in: query - name: include_deleted_data - schema: - type: boolean - description: 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/). - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - - in: query - name: modified_after - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge after this date time - will be returned. - - in: query - name: modified_before - schema: - type: string - format: date-time - description: If provided, only objects synced by Merge before this date time - will be returned. - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: remote_id - schema: - type: string - nullable: true - description: The API provider's ID for the given object. - - in: query - name: team - schema: - type: string - description: If provided, will only return users matching in this team. - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserList' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/users/{id}: - get: - operationId: users_retrieve - description: Returns a `User` object with the given `id`. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - - in: query - name: expand - schema: - type: array - items: - type: string - enum: - - roles - - teams - description: Which relations should be returned in expanded form. Multiple - relation names should be comma separated without spaces. - examples: - ExpandTeams,Roles: - value: teams,roles - summary: Expand Teams, Roles - explode: false - - in: path - name: id - schema: - type: string - format: uuid - required: true - - in: query - name: include_remote_data - schema: - type: boolean - description: Whether to include the original data Merge fetched from the third-party - to produce these models. - - in: query - name: include_shell_data - schema: - type: boolean - description: Whether to include shell records. Shell records are empty records - (they may contain some metadata but all other fields are null). - tags: - - users - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - /ticketing/v1/webhook-receivers: - get: - operationId: webhook_receivers_list - description: Returns a list of `WebhookReceiver` objects. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - security: - - tokenAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC - post: - operationId: webhook_receivers_create - description: Creates a `WebhookReceiver` object with the given values. - parameters: - - in: header - name: X-Account-Token - schema: - type: string - description: Token identifying the end user. - required: true - tags: - - webhook-receivers - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/WebhookReceiverRequest' - required: true - security: - - tokenAuth: [] - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/WebhookReceiver' - description: '' - x-endpoint-availability: ENDPOINT_AVAILABILITY_PUBLIC -components: - schemas: - Account: - type: object - description: |- - # The Account Object - ### Description - The `Account` object is used to represent the account that a ticket is associated with. - - The account is a company that may be a customer. This does not represent the company that is receiving the ticket. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The account's name. - example: Waystar Royco - domains: - type: array - items: - type: string - nullable: true - nullable: true - description: The account's domain names. - example: - - waystar-royco.com - - royco.com - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - example: - - path: /actions - data: - - Varies by platform - x-merge-expands: '{"owner": "User"}' - x-merge-category: ticketing - AccountDetails: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - integration: - type: string - readOnly: true - example: BambooHR - integration_slug: - type: string - readOnly: true - example: bamboohr - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - nullable: true - example: hris - end_user_origin_id: - type: string - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - end_user_organization_name: - type: string - readOnly: true - example: Waystar Royco - end_user_email_address: - type: string - format: email - readOnly: true - example: kendall.roy@waystar-royco.com - status: - type: string - readOnly: true - example: COMPLETE - webhook_listener_url: - type: string - format: uri - readOnly: true - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - readOnly: true - description: 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. - example: true - account_type: - type: string - readOnly: true - example: PRODUCTION - completed_at: - type: string - format: date-time - nullable: true - description: The time at which account completes the linking flow. - example: '2024-08-26T20:11:19.277118Z' - x-merge-category: ticketing - AccountDetailsAndActions: - type: object - description: |- - # 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: - type: string - example: e59b1821-f85c-4e28-a6b3-1804156f3563 - category: - oneOf: - - $ref: '#/components/schemas/CategoryEnum' - - type: string - example: hris - status: - oneOf: - - $ref: '#/components/schemas/AccountDetailsAndActionsStatusEnum' - - type: string - example: INCOMPLETE - status_detail: - type: string - example: Invalid login credentials - end_user_origin_id: - type: string - example: 3ac95cde-6c7f-4eef-afec-be710b42308d - end_user_organization_name: - type: string - example: Foo Bar, LLC - end_user_email_address: - type: string - example: hradmin@foobar.dev - subdomain: - type: string - description: The tenant or domain the customer has provided access to. - example: foobar - webhook_listener_url: - type: string - example: https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 - is_duplicate: - type: boolean - nullable: true - description: 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. - example: true - integration: - $ref: '#/components/schemas/AccountDetailsAndActionsIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - 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: - type: string - example: PRODUCTION - completed_at: - type: string - format: date-time - example: '2024-08-26T20:11:19.277118Z' - required: - - account_type - - completed_at - - end_user_email_address - - end_user_organization_name - - id - - status - - webhook_listener_url - x-merge-sample-json: '{"id": "e59b1821-f85c-4e28-a6b3-1804156f3563", "category": - "hris", "status": "INCOMPLETE", "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", "webhook_listener_url": - "https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4", - "is_duplicate": true, "integration": {"name": "SAP SuccessFactors", "categories": - ["hris", "ats"], "image": "https://cdn.merge.dev/SuccessFactors_Logo.png", - "square_image": "https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg", "color": - "#F6A704", "slug": "sap-successfactors", "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"]}]}}' - x-merge-category: ticketing - AccountDetailsAndActionsIntegration: - type: object - properties: - name: - type: string - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - image: - type: string - square_image: - type: string - color: - type: string - slug: - type: string - passthrough_available: - type: boolean - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - required: - - categories - - color - - name - - passthrough_available - - slug - x-merge-category: ticketing - AccountDetailsAndActionsStatusEnum: - enum: - - COMPLETE - - INCOMPLETE - - RELINK_NEEDED - - IDLE - type: string - description: |- - * `COMPLETE` - COMPLETE - * `INCOMPLETE` - INCOMPLETE - * `RELINK_NEEDED` - RELINK_NEEDED - * `IDLE` - IDLE - x-merge-category: ticketing - AccountIntegration: - type: object - properties: - name: - type: string - description: Company name. - abbreviated_name: - type: string - nullable: true - description: "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: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: Category or categories this integration belongs to. Multiple - categories should be comma separated, i.e. [ats, hris]. - readOnly: true - image: - type: string - format: uri - nullable: true - description: Company logo in rectangular shape. - square_image: - type: string - format: uri - nullable: true - description: Company logo in square shape. - color: - type: string - description: The color of this integration used for buttons and text throughout - the app and landing pages. Choose a darker, saturated color. - pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ - maxLength: 18 - slug: - type: string - readOnly: true - api_endpoints_to_documentation_urls: - type: object - additionalProperties: {} - description: "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: string - nullable: true - description: Setup guide URL for third party webhook creation. Exposed in - Merge Docs. - category_beta_status: - type: object - description: Category or categories this integration is in beta status for. - readOnly: true - required: - - name - x-merge-category: ticketing - AccountToken: - type: object - properties: - account_token: - type: string - example: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB - integration: - $ref: '#/components/schemas/AccountIntegration' - example: - name: SAP SuccessFactors - categories: - - hris - - ats - image: https://cdn.merge.dev/SuccessFactors_Logo.png - square_image: https://cdn.merge.dev/SuccessFactors_Square_Logo.jpg - color: '#F6A704' - slug: sap-successfactors - id: - type: string - example: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd - required: - - account_token - - id - - integration - x-merge-category: ticketing - AdvancedMetadata: - type: object - properties: - id: - type: string - format: uuid - display_name: - type: string - description: - type: string - is_required: - type: boolean - is_custom: - type: boolean - field_choices: - type: array - items: {} - required: - - id - x-merge-category: ticketing - AsyncPassthroughReciept: - type: object - properties: - async_passthrough_receipt_id: - type: string - format: uuid - example: fd29020f-2695-445e-922e-dcd5e81903fd - required: - - async_passthrough_receipt_id - x-merge-category: ticketing - Attachment: - type: object - description: |- - # The Attachment Object - ### Description - The `Attachment` object is used to represent an attachment for a ticket. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - file_name: - type: string - nullable: true - description: The attachment's name. It is required to include the file extension - in the attachment's name. - example: Screenshot.png - ticket: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Ticket' - nullable: true - description: The ticket associated with the attachment. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Ticket - file_url: - type: string - nullable: true - example: http://alturl.com/p749b - description: The attachment's url. It is required to include the file extension - in the file's URL. - content_type: - type: string - nullable: true - description: The attachment's file format. - example: jpeg - uploaded_by: - type: string - format: uuid - nullable: true - description: The user who uploaded the attachment. - example: 28b54125-287f-494d-965e-3c5b330c9a68 - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's attachment was created. - example: '2022-11-10T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-nested-write-allowed: true - x-merge-expands: '{"ticket": "Ticket"}' - x-merge-category: ticketing - AttachmentRequest: - type: object - description: |- - # The Attachment Object - ### Description - The `Attachment` object is used to represent an attachment for a ticket. - - ### Usage Example - TODO - properties: - file_name: - type: string - nullable: true - description: The attachment's name. It is required to include the file extension - in the attachment's name. - example: Screenshot.png - ticket: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Ticket' - nullable: true - description: The ticket associated with the attachment. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Ticket - file_url: - type: string - nullable: true - example: http://alturl.com/p749b - description: The attachment's url. It is required to include the file extension - in the file's URL. - content_type: - type: string - nullable: true - description: The attachment's file format. - example: jpeg - uploaded_by: - type: string - format: uuid - nullable: true - description: The user who uploaded the attachment. - example: 28b54125-287f-494d-965e-3c5b330c9a68 - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"ticket": "Ticket"}' - x-merge-category: ticketing - AuditLogEvent: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: b5ceea2a-7171-47ce-8090-165cfce5572c - user_name: - type: string - nullable: true - description: The User's full name at the time of this Event occurring. - maxLength: 200 - example: Gil Feig - user_email: - type: string - format: email - nullable: true - description: The User's email at the time of this Event occurring. - maxLength: 254 - example: hello@merge.dev - role: - oneOf: - - $ref: '#/components/schemas/RoleEnum' - - type: string - description: |- - 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 - example: ADMIN - ip_address: - type: string - maxLength: 45 - example: 192.0.2.123 - event_type: - oneOf: - - $ref: '#/components/schemas/EventTypeEnum' - - type: string - description: |- - 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 - example: CHANGED_SCOPES - event_description: - type: string - example: Organization-wide Scopes for model hris.Employee updated from Read - to Read+Write - created_at: - type: string - format: date-time - readOnly: true - required: - - event_description - - event_type - - ip_address - - role - x-merge-category: ticketing - AvailableActions: - type: object - description: |- - # 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: - $ref: '#/components/schemas/AccountIntegration' - example: - name: Lever - categories: - - ats - image: https://merge-api-production.s3.amazonaws.com/media/Lever_Logo.png - square_image: https://merge-api-production.s3.amazonaws.com/media/Lever_Square_Logo.png - color: '#262A34' - is_in_beta: 'true' - api_endpoints_to_documentation_urls: "{'GET': [('/common-model-scopes', - 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve')], - 'POST': []}" - passthrough_available: - type: boolean - example: true - available_model_operations: - type: array - items: - $ref: '#/components/schemas/ModelOperation' - example: - - model_name: Candidate - available_operations: - - FETCH - - CREATE - required_post_parameters: - - remote_user_id - supported_fields: - - first_name - - last_name - - company - - title - required: - - integration - - passthrough_available - x-merge-category: ticketing - CategoriesEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: ticketing - CategoryEnum: - enum: - - hris - - ats - - accounting - - ticketing - - crm - - mktg - - filestorage - type: string - description: |- - * `hris` - hris - * `ats` - ats - * `accounting` - accounting - * `ticketing` - ticketing - * `crm` - crm - * `mktg` - mktg - * `filestorage` - filestorage - x-merge-category: ticketing - Collection: - type: object - description: |- - # The Collection Object - ### Description - The `Collection` object is used to represent one or more `Tickets`. There can be a hierarchy of `Collections`, in which a sub-collection belongs to a parent-collection. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The collection's name. - example: Q1 Platform - description: - type: string - nullable: true - description: The collection's description. - example: For tracking all tasks related to Platform for Q1 - access_level: - oneOf: - - $ref: '#/components/schemas/CollectionAccessLevelEnum' - - type: string - nullable: true - description: |- - The level of access a User has to the Collection and its sub-objects. - - * `PRIVATE` - PRIVATE - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PARENT_COLLECTION` - PARENT_COLLECTION - example: PUBLIC - collection_type: - oneOf: - - $ref: '#/components/schemas/CollectionTypeEnum' - - type: string - nullable: true - description: |- - The collection's type. - - * `LIST` - LIST - * `PROJECT` - PROJECT - example: LIST - $ref: '#/components/schemas/CollectionTypeEnum' - parent_collection: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Collection' - nullable: true - description: The parent collection for this collection. - example: 25782302-5be1-4d78-8f46-2a5db72204ef - x-merge-expands-to: Collection - collection_url: - type: string - format: uri - nullable: true - description: The 3rd party url of the Collection. - maxLength: 2000 - example: https://example.com - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's collection was created. - example: '2022-01-01T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's collection was updated. - example: '2022-01-01T00:00:00Z' - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"parent_collection": "Collection"}' - x-merge-category: ticketing - CollectionAccessLevelEnum: - enum: - - PRIVATE - - COMPANY - - PUBLIC - - PARENT_COLLECTION - type: string - description: |- - * `PRIVATE` - PRIVATE - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PARENT_COLLECTION` - PARENT_COLLECTION - x-merge-category: ticketing - CollectionTypeEnum: - enum: - - LIST - - PROJECT - type: string - description: |- - * `LIST` - LIST - * `PROJECT` - PROJECT - x-merge-category: ticketing - Comment: - type: object - description: |- - # The Comment Object - ### Description - The `Comment` object is used to represent a comment on a ticket. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - user: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The author of the Comment, if the author is a User. If the - third party does not support specifying an author, we will append "[Posted - on behalf of {name}]" to the comment. - example: 17a54124-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: User - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The author of the Comment, if the author is a Contact.If the - third party does not support specifying an author, we will append "[Posted - on behalf of {name}]" to the comment. - example: dde3fb16-b8eb-483d-81c4-b78100816f15 - x-merge-expands-to: Contact - body: - type: string - nullable: true - description: The comment's text body. - example: When will these integrations be done? You all should use Merge. - html_body: - type: string - nullable: true - description: The comment's text body formatted as html. - example: When will these integrations be done? You all should use Merge. - ticket: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Ticket' - nullable: true - description: 'The ticket associated with the comment. ' - example: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - x-merge-expands-to: Ticket - is_private: - type: boolean - nullable: true - description: Whether or not the comment is internal. - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's comment was created. - example: '1990-11-10T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"contact": "Contact", "ticket": "Ticket", "user": "User"}' - x-merge-category: ticketing - CommentEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/CommentRequest' - required: - - model - x-merge-category: ticketing - CommentRequest: - type: object - description: |- - # The Comment Object - ### Description - The `Comment` object is used to represent a comment on a ticket. - - ### Usage Example - TODO - properties: - user: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The author of the Comment, if the author is a User. If the - third party does not support specifying an author, we will append "[Posted - on behalf of {name}]" to the comment. - example: 17a54124-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: User - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The author of the Comment, if the author is a Contact.If the - third party does not support specifying an author, we will append "[Posted - on behalf of {name}]" to the comment. - example: dde3fb16-b8eb-483d-81c4-b78100816f15 - x-merge-expands-to: Contact - body: - type: string - nullable: true - description: The comment's text body. - example: When will these integrations be done? You all should use Merge. - html_body: - type: string - nullable: true - description: The comment's text body formatted as html. - example: When will these integrations be done? You all should use Merge. - ticket: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Ticket' - nullable: true - description: 'The ticket associated with the comment. ' - example: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - x-merge-expands-to: Ticket - is_private: - type: boolean - nullable: true - description: Whether or not the comment is internal. - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"contact": "Contact", "ticket": "Ticket", "user": "User"}' - x-merge-category: ticketing - CommentResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Comment' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ticketing - CommonModelScopeAPI: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializer' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: ticketing - CommonModelScopesBodyRequest: - type: object - properties: - model_id: - type: string - minLength: 1 - example: hris.Employee - enabled_actions: - type: array - items: - $ref: '#/components/schemas/EnabledActionsEnum' - example: - - READ - - WRITE - disabled_fields: - type: array - items: - type: string - minLength: 1 - example: - - first_name - required: - - disabled_fields - - enabled_actions - - model_id - x-merge-category: ticketing - Contact: - type: object - description: |- - # The Contact Object - ### Description - The `Contact` object is used to represent the customer, lead, or external user that a ticket is associated with. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The contact's name. - example: Cousin Greg - email_address: - type: string - nullable: true - description: The contact's email address. - example: greg@waystar-royco.com - phone_number: - type: string - nullable: true - description: The contact's phone number. - example: '5108890293' - details: - type: string - nullable: true - description: The contact's details. - example: Executive Assistant to Tom Wambsgans - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The contact's account. - example: 28b54125-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: Account - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"account": "Account"}' - x-merge-category: ticketing - ContactRequest: - type: object - description: |- - # The Contact Object - ### Description - The `Contact` object is used to represent the customer, lead, or external user that a ticket is associated with. - - ### Usage Example - TODO - properties: - name: - type: string - nullable: true - description: The contact's name. - example: Cousin Greg - email_address: - type: string - nullable: true - description: The contact's email address. - example: greg@waystar-royco.com - phone_number: - type: string - nullable: true - description: The contact's phone number. - example: '5108890293' - details: - type: string - nullable: true - description: The contact's details. - example: Executive Assistant to Tom Wambsgans - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The contact's account. - example: 28b54125-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: Account - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - x-merge-expands: '{"account": "Account"}' - x-merge-category: ticketing - CreateFieldMappingRequest: - type: object - properties: - target_field_name: - type: string - minLength: 1 - description: The name of the target field you want this remote field to - map to. - example: example_target_field_name - target_field_description: - type: string - minLength: 1 - description: The description of the target field you want this remote field - to map to. - example: this is a example description of the target field - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - common_model_name: - type: string - minLength: 1 - description: The name of the Common Model that the remote field corresponds - to in a given category. - example: ExampleCommonModel - required: - - common_model_name - - remote_field_traversal_path - - remote_method - - remote_url_path - - target_field_description - - target_field_name - x-merge-category: ticketing - DataPassthroughRequest: - type: object - description: |- - # 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: - allOf: - - $ref: '#/components/schemas/MethodEnum' - example: POST - path: - type: string - minLength: 1 - description: The path of the request in the third party's platform. - example: /scooters - base_url_override: - type: string - nullable: true - minLength: 1 - description: An optional override of the third party's base url for the - request. - example: https://api.example.com - data: - type: string - nullable: true - minLength: 1 - description: The data with the request. You must include a `request_format` - parameter matching the data's format - example: '{"company": "Lime", "model": "Gen 2.5"}' - multipart_form_data: - type: array - items: - $ref: '#/components/schemas/MultipartFormFieldRequest' - nullable: true - description: Pass an array of `MultipartFormField` objects in here instead - of using the `data` param if `request_format` is set to `MULTIPART`. - headers: - type: object - additionalProperties: {} - nullable: true - description: 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. - example: - EXTRA-HEADER: value - request_format: - allOf: - - $ref: '#/components/schemas/RequestFormatEnum' - nullable: true - example: JSON - normalize_response: - type: boolean - description: '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`.' - required: - - method - - path - x-merge-category: ticketing - DebugModeLog: - type: object - properties: - log_id: - type: string - example: 99433219-8017-4acd-bb3c-ceb23d663832 - dashboard_view: - type: string - example: https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 - log_summary: - $ref: '#/components/schemas/DebugModelLogSummary' - example: - url: www.exampleintegration.com/api/v1/exampleapi - method: POST - status_code: 200 - required: - - dashboard_view - - log_id - - log_summary - x-merge-sample-json: '{"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}}' - x-merge-category: ticketing - DebugModelLogSummary: - type: object - properties: - url: - type: string - example: www.exampleintegration.com/api/v1/exampleapi - method: - type: string - example: POST - status_code: - type: integer - example: 200 - required: - - method - - status_code - - url - x-merge-sample-json: '{"url": "www.exampleintegration.com/api/v1/exampleapi", - "method": "POST", "status_code": 200}' - x-merge-category: ticketing - EnabledActionsEnum: - enum: - - READ - - WRITE - type: string - description: |- - * `READ` - READ - * `WRITE` - WRITE - x-merge-category: ticketing - EncodingEnum: - enum: - - RAW - - BASE64 - - GZIP_BASE64 - type: string - description: |- - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - x-merge-category: ticketing - EndUserDetailsRequest: - type: object - properties: - end_user_email_address: - type: string - minLength: 1 - description: Your end user's email address. This is purely for identification - purposes - setting this value will not cause any emails to be sent. - maxLength: 100 - example: example@gmail.com - end_user_organization_name: - type: string - minLength: 1 - description: Your end user's organization. - maxLength: 100 - example: Test Organization - end_user_origin_id: - type: string - minLength: 1 - description: 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. - maxLength: 100 - example: '12345' - categories: - type: array - items: - $ref: '#/components/schemas/CategoriesEnum' - description: The integration categories to show in Merge Link. - example: - - hris - - ats - integration: - type: string - nullable: true - minLength: 1 - description: 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/. - example: bamboohr - link_expiry_mins: - type: integer - maximum: 10080 - minimum: 30 - default: 30 - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: boolean - nullable: true - default: false - description: 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: - type: array - items: - $ref: '#/components/schemas/CommonModelScopesBodyRequest' - nullable: true - description: 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: object - additionalProperties: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - nullable: true - description: 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. - example: - hris: - - model_name: Employee - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - first_name - - last_name - - personal_email - disabled_fields: - - preferred_name - - model_name: Employment - model_permissions: - READ: - is_enabled: false - WRITE: - is_enabled: false - field_permissions: - enabled_fields: - - effective_date - ats: - - model_name: Job - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - field_permissions: - enabled_fields: - - name - disabled_fields: - - description - - model_name: Department - model_permissions: - READ: - is_enabled: true - WRITE: - is_enabled: true - language: - oneOf: - - $ref: '#/components/schemas/LanguageEnum' - - type: string - nullable: true - description: |- - The following subset of IETF language tags can be used to configure localization. - - * `en` - en - * `de` - de - example: en - are_syncs_disabled: - type: boolean - nullable: true - default: false - description: The boolean that indicates whether initial, periodic, and force - syncs will be disabled. - integration_specific_config: - type: object - additionalProperties: {} - nullable: true - description: A JSON object containing integration-specific configuration - options. - example: - rippling: - oauth_code: 3h1jj8ssdf31dfji3o1jjdfjasd - required: - - categories - - end_user_email_address - - end_user_organization_name - - end_user_origin_id - x-merge-category: ticketing - ErrorValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /model/custom_fields - title: - type: string - example: Missing Required Field - detail: - type: string - example: custom_fields is a required field on model. - problem_type: - type: string - example: MISSING_REQUIRED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: ticketing - 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 - type: string - description: |- - * `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 - x-merge-category: ticketing - ExternalTargetFieldAPI: - type: object - properties: - name: - type: string - nullable: true - readOnly: true - example: example_target_field_name - description: - type: string - nullable: true - readOnly: true - example: this is a example description of a target field - is_mapped: - type: string - nullable: true - readOnly: true - example: true - x-merge-category: ticketing - ExternalTargetFieldAPIResponse: - type: object - properties: - Ticket: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Comment: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Project: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Collection: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - User: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Role: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Account: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Team: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Attachment: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Tag: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - Contact: - type: array - items: - $ref: '#/components/schemas/ExternalTargetFieldAPI' - x-merge-category: ticketing - FieldFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: ticketing - FieldMappingApiInstance: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - is_integration_wide: - type: boolean - readOnly: true - target_field: - type: object - properties: - name: - type: string - description: - type: string - is_organization_wide: - type: boolean - required: - - description - - is_organization_wide - - name - nullable: true - readOnly: true - example: - name: example_target_field_name - description: this is a example description of a target field - is_organization_wide: true - remote_field: - type: object - properties: - remote_key_name: - type: string - nullable: true - schema: - type: object - additionalProperties: {} - nullable: true - remote_endpoint_info: - type: object - properties: - method: - type: string - nullable: true - url_path: - type: string - nullable: true - field_traversal_path: - type: array - items: - type: string - nullable: true - required: - - field_traversal_path - - method - - url_path - required: - - remote_endpoint_info - - remote_key_name - - schema - nullable: true - readOnly: true - example: - 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 - x-merge-category: ticketing - FieldMappingApiInstanceResponse: - type: object - properties: - Ticket: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Comment: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Project: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Collection: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - User: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Role: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Account: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Team: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Attachment: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Tag: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - Contact: - type: array - items: - $ref: '#/components/schemas/FieldMappingApiInstance' - x-merge-category: ticketing - FieldMappingInstanceResponse: - type: object - properties: - model: - $ref: '#/components/schemas/FieldMappingApiInstance' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ticketing - FieldPermissionDeserializer: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: ticketing - FieldPermissionDeserializerRequest: - type: object - properties: - enabled_fields: - type: array - items: {} - disabled_fields: - type: array - items: {} - x-merge-category: ticketing - FieldTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: ticketing - GenerateRemoteKeyRequest: - type: object - description: |- - # The GenerateRemoteKey Object - ### Description - The `GenerateRemoteKey` object is used to represent a request for a new remote key. - - ### Usage Example - Post a `GenerateRemoteKey` to create a new remote key. - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: ticketing - IndividualCommonModelScopeDeserializer: - type: object - properties: - model_name: - type: string - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializer' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializer' - required: - - model_name - x-merge-category: ticketing - IndividualCommonModelScopeDeserializerRequest: - type: object - properties: - model_name: - type: string - minLength: 1 - model_permissions: - type: object - additionalProperties: - $ref: '#/components/schemas/ModelPermissionDeserializerRequest' - field_permissions: - $ref: '#/components/schemas/FieldPermissionDeserializerRequest' - required: - - model_name - x-merge-category: ticketing - Issue: - type: object - properties: - id: - type: string - format: uuid - readOnly: true - example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 - status: - oneOf: - - $ref: '#/components/schemas/IssueStatusEnum' - - type: string - description: |- - Status of the issue. Options: ('ONGOING', 'RESOLVED') - - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - example: ONGOING - error_description: - type: string - example: Missing Permissions - end_user: - type: object - additionalProperties: {} - readOnly: true - example: b82302de-852e-4e60-b050-edf9da3b7c02 - first_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - last_incident_time: - type: string - format: date-time - nullable: true - example: '2022-12-05T16:19:15.161Z' - is_muted: - type: boolean - readOnly: true - example: true - error_details: - type: array - items: - type: string - readOnly: true - example: - - Missing employee permissions. - - Missing time off permissions. - required: - - error_description - x-merge-category: ticketing - IssueStatusEnum: - enum: - - ONGOING - - RESOLVED - type: string - description: |- - * `ONGOING` - ONGOING - * `RESOLVED` - RESOLVED - x-merge-category: ticketing - ItemFormatEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - uuid - * `number` - url - * `date` - email - * `datetime` - phone - * `bool` - currency - * `list` - decimal - x-merge-category: ticketing - ItemSchema: - type: object - properties: - item_type: - $ref: '#/components/schemas/ItemTypeEnum' - item_format: - $ref: '#/components/schemas/ItemFormatEnum' - item_choices: - type: array - items: - type: string - x-merge-category: ticketing - ItemTypeEnum: - enum: - - string - - number - - date - - datetime - - bool - - list - type: string - description: |- - * `string` - string - * `number` - number - * `date` - date - * `datetime` - datetime - * `bool` - bool - * `list` - list - x-merge-category: ticketing - LanguageEnum: - enum: - - en - - de - type: string - description: |- - * `en` - en - * `de` - de - x-merge-category: ticketing - LastSyncResultEnum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: ticketing - LinkToken: - type: object - properties: - link_token: - type: string - example: necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0 - integration_name: - type: string - example: Lever - magic_link_url: - type: string - example: https://link.merge.dev/asdfjkl12345jsndfgi2i83n - required: - - link_token - x-merge-category: ticketing - LinkedAccountCommonModelScopeDeserializerRequest: - type: object - properties: - common_models: - type: array - items: - $ref: '#/components/schemas/IndividualCommonModelScopeDeserializerRequest' - description: The common models you want to update the scopes for - example: - - 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 - required: - - common_models - x-merge-category: ticketing - LinkedAccountStatus: - type: object - properties: - linked_account_status: - type: string - can_make_request: - type: boolean - required: - - can_make_request - - linked_account_status - x-merge-category: ticketing - MetaResponse: - type: object - properties: - request_schema: - type: object - additionalProperties: {} - example: - type: object - properties: - model: - type: object - required: - - last_name - - first_name - - merge_categories - - new_york_city_neighborhood - - favorite_tv_shows - - favorite_watch - properties: - email_addresses: - type: array - items: - type: object - properties: - value: - type: string - title: value - email_address_type: - type: string - title: email_address_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: email_addresses - description: Array of email_addresses objects - urls: - type: array - items: - type: object - properties: - value: - type: string - title: value - url_type: - type: string - title: url_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: urls - description: Array of urls objects - first_name: - type: string - title: first_name - description: The first name. - last_name: - type: string - title: last_name - description: The last name. - phone_numbers: - type: array - items: - type: object - properties: - value: - type: string - title: value - phone_number_type: - type: string - title: phone_number_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: phone_numbers - description: Array of phone_numbers objects - tags: - type: array - items: - type: string - format: uuid - title: tags - description: Array of tags names - attachments: - type: array - items: - type: object - properties: - id: - type: string - title: id - file_url: - type: string - title: file_url - file_name: - type: string - title: file_name - attachment_type: - type: string - title: attachment_type - integration_params: - type: object - title: integration_params - properties: {} - linked_account_params: - type: object - title: linked_account_params - properties: {} - title: attachments - description: 'Array of attachments objects ' - merge_categories: - type: array - categories: - type: string - enum: - - HRIS - - ATS - - Accounting - - Ticketing - - File Storage - - CRM - - Marketing Automation - enum_information: - - value: HRIS - description: Merge HRIS Category - - value: ATS - description: Merge ATS Category - - value: Accounting - description: Merge Accounting Category - - value: Ticketing - description: Merge Ticketing Category - - value: File Storage - description: Merge File Storage Category - - value: CRM - description: Merge CRM Category - - value: Marketing Automation - description: Merge Marketing Automation Category - title: Merge Categories - description: Array of Merge's Unified API Categories - new_york_city_neighborhood: - type: string - title: Borough - description: One of the 5 Boroughs of New York City - favorite_tv_shows: - type: array - items: - type: string - format: uuid - title: Favorite TV Shows - description: Array of TV Show objects on merge.tv_shows - favorite_watch: - type: string - title: Favorite Watch - description: Favorite watch of all time - remote_field_classes: - type: object - additionalProperties: {} - status: - $ref: '#/components/schemas/LinkedAccountStatus' - example: - linked_account_status: COMPLETE - can_make_request: true - has_conditional_params: - type: boolean - has_required_linked_account_params: - type: boolean - required: - - has_conditional_params - - has_required_linked_account_params - - request_schema - x-merge-category: ticketing - MethodEnum: - enum: - - GET - - OPTIONS - - HEAD - - POST - - PUT - - PATCH - - DELETE - type: string - description: |- - * `GET` - GET - * `OPTIONS` - OPTIONS - * `HEAD` - HEAD - * `POST` - POST - * `PUT` - PUT - * `PATCH` - PATCH - * `DELETE` - DELETE - x-merge-category: ticketing - ModelOperation: - type: object - description: |- - # 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: - type: string - example: Candidate - available_operations: - type: array - items: - type: string - example: - - FETCH - - CREATE - required_post_parameters: - type: array - items: - type: string - example: - - remote_user_id - supported_fields: - type: array - items: - type: string - example: - - first_name - - last_name - - company - - title - required: - - available_operations - - model_name - - required_post_parameters - - supported_fields - x-merge-category: ticketing - ModelPermissionDeserializer: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: ticketing - ModelPermissionDeserializerRequest: - type: object - properties: - is_enabled: - type: boolean - x-merge-category: ticketing - MultipartFormFieldRequest: - type: object - description: |- - # 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 - minLength: 1 - description: The name of the form field - example: resume - data: - type: string - minLength: 1 - description: The data for the form field. - example: SW50ZWdyYXRlIGZhc3QKSW50ZWdyYXRlIG9uY2U= - encoding: - oneOf: - - $ref: '#/components/schemas/EncodingEnum' - - type: string - nullable: true - default: RAW - description: |- - The encoding of the value of `data`. Defaults to `RAW` if not defined. - - * `RAW` - RAW - * `BASE64` - BASE64 - * `GZIP_BASE64` - GZIP_BASE64 - example: BASE64 - file_name: - type: string - nullable: true - minLength: 1 - description: The file name of the form field, if the field is for a file. - example: resume.pdf - content_type: - type: string - nullable: true - minLength: 1 - description: The MIME type of the file, if the field is for a file. - example: application/pdf - required: - - data - - name - x-merge-category: ticketing - PaginatedAccountDetailsAndActionsList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AccountDetailsAndActions' - x-merge-category: ticketing - PaginatedAccountList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Account' - x-merge-category: ticketing - PaginatedAttachmentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Attachment' - x-merge-category: ticketing - PaginatedAuditLogEventList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/AuditLogEvent' - x-merge-category: ticketing - PaginatedCollectionList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Collection' - x-merge-category: ticketing - PaginatedCommentList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Comment' - x-merge-category: ticketing - PaginatedContactList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Contact' - x-merge-category: ticketing - PaginatedIssueList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Issue' - x-merge-category: ticketing - PaginatedProjectList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Project' - x-merge-category: ticketing - PaginatedRemoteFieldClassList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/RemoteFieldClass' - x-merge-category: ticketing - PaginatedRoleList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Role' - x-merge-category: ticketing - PaginatedSyncStatusList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/SyncStatus' - x-merge-category: ticketing - PaginatedTagList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Tag' - x-merge-category: ticketing - PaginatedTeamList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Team' - x-merge-category: ticketing - PaginatedTicketList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Ticket' - x-merge-category: ticketing - PaginatedUserList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/User' - x-merge-category: ticketing - PaginatedViewerList: - type: object - properties: - next: - type: string - nullable: true - example: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw - previous: - type: string - nullable: true - example: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ - results: - type: array - items: - $ref: '#/components/schemas/Viewer' - x-merge-category: ticketing - PatchedEditFieldMappingRequest: - type: object - properties: - remote_field_traversal_path: - type: array - items: {} - description: The field traversal path of the remote field listed when you - hit the GET /remote-fields endpoint. - example: - - example_remote_field_name - remote_method: - type: string - minLength: 1 - description: The method of the remote endpoint where the remote field is - coming from. - example: GET - remote_url_path: - type: string - minLength: 1 - description: The path of the remote endpoint where the remote field is coming - from. - example: /example-url-path - x-merge-category: ticketing - PatchedTicketEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/PatchedTicketRequest' - required: - - model - x-merge-category: ticketing - PatchedTicketRequest: - type: object - description: |- - # The Ticket Object - ### Description - The `Ticket` object is used to represent a ticket, issue, task or case. - ### Usage Example - TODO - properties: - name: - type: string - nullable: true - description: The ticket's name. - example: Please add more integrations - assignees: - type: array - items: - type: string - format: uuid - nullable: true - description: The individual `Users` who are assigned to this ticket. This - does not include `Users` who just have view access to this ticket. To - fetch all `Users` and `Teams` that can access the ticket, use the `GET - /tickets/{ticket_id}/viewers` [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - example: - - 17a54124-287f-494d-965e-3c5b330c9a68 - assigned_teams: - type: array - items: - type: string - format: uuid - nullable: true - description: The `Teams` that are assigned to this ticket. This does not - include `Teams` who just have view access to this ticket. To fetch all - `Users` and `Teams` that can access this ticket, use the `GET /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - example: - - 4857c306-c1f9-489e-a6b6-90902f736dfe - creator: - type: string - format: uuid - nullable: true - description: The user who created this ticket. - due_date: - type: string - format: date-time - nullable: true - description: The ticket's due date. - example: '2022-10-11T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/TicketStatusEnum' - - type: string - nullable: true - description: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - example: OPEN - description: - type: string - nullable: true - description: The ticket’s description. HTML version of description is mapped - if supported by the third-party platform. - example: Can you please add more integrations? It'll make syncing data much - easier! - collections: - type: array - items: - type: string - format: uuid - nullable: true - description: The `Collections` that this `Ticket` is included in. - example: - - fb8c55b6-1cb8-4b4c-9fb6-17924231619d - ticket_type: - type: string - nullable: true - description: The sub category of the ticket within the 3rd party system. - Examples include incident, task, subtask or to-do. - example: incident - account: - type: string - format: uuid - nullable: true - description: The account associated with the ticket. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - contact: - type: string - format: uuid - nullable: true - description: The contact associated with the ticket. - example: 65c345ba-6870-4974-87ba-dd31509c367a - parent_ticket: - type: string - format: uuid - nullable: true - description: The ticket's parent ticket. - example: 75b33d04-30d2-4f3e-be45-27838bc94342 - access_level: - oneOf: - - $ref: '#/components/schemas/TicketAccessLevelEnum' - - type: string - nullable: true - description: |- - The description of who is able to access a given ticket, or where access is inherited from. - - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - * `COLLECTION` - COLLECTION - example: PRIVATE - tags: - type: array - items: - type: string - nullable: true - description: The tag's name. - example: - - enterprise - - other-tag - roles: - type: array - items: - type: string - format: uuid - nullable: true - example: - - 21a54124-397f-494d-985e-3c5b330b8a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - completed_at: - type: string - format: date-time - nullable: true - description: When the ticket was completed. - example: '2021-12-09T00:00:00Z' - ticket_url: - type: string - format: uri - nullable: true - description: The 3rd party url of the Ticket. - maxLength: 2000 - example: https://thirdpartysoftware.com/project/3/issue/1 - priority: - oneOf: - - $ref: '#/components/schemas/PriorityEnum' - - type: string - nullable: true - description: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - example: HIGH - $ref: '#/components/schemas/PriorityEnum' - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-category: ticketing - PriorityEnum: - enum: - - URGENT - - HIGH - - NORMAL - - LOW - type: string - description: |- - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - x-merge-category: ticketing - Project: - type: object - description: |- - # The Project Object - ### Description - Please use the `Collection` model. This model will be fully deprecated on 3/30/2024. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: fb8c55b6-1cb8-4b4c-9fb6-17924231619d - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: "The project's name. " - example: Q1 Platform - description: - type: string - nullable: true - description: The project's description. - example: For tracking all tasks related to Platform for Q1 - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"company": "CompanyInfo", "contact": "Contact"}' - x-merge-category: ticketing - RemoteData: - type: object - description: |- - # 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 - description: The third-party API path that is being called. - example: /platform-endpoint - data: - readOnly: true - description: The data returned from the third-party for this object in its - original, unnormalized format. - example: - - Varies by platform - required: - - path - x-merge-category: ticketing - RemoteEndpointInfo: - type: object - properties: - method: - type: string - example: GET - url_path: - type: string - example: /example-url-path - field_traversal_path: - type: array - items: {} - example: - - example_key_name - required: - - field_traversal_path - - method - - url_path - x-merge-category: ticketing - RemoteField: - type: object - properties: - remote_field_class: - oneOf: - - type: string - - $ref: '#/components/schemas/RemoteFieldClass' - x-merge-expands-to: RemoteFieldClass - value: - nullable: true - example: string - required: - - remote_field_class - x-merge-expands: '{"remote_field_class": "RemoteFieldClass"}' - x-merge-category: ticketing - RemoteFieldAPI: - type: object - properties: - schema: - type: object - additionalProperties: {} - example: - type: string - remote_key_name: - type: string - example: example_remote_key_name - remote_endpoint_info: - $ref: '#/components/schemas/RemoteEndpointInfo' - example: - method: GET - url_path: /example-url-path - field_traversal_path: - - example_key_name - example_values: - type: array - items: {} - nullable: true - example: - - example - advanced_metadata: - allOf: - - $ref: '#/components/schemas/AdvancedMetadata' - nullable: true - coverage: - oneOf: - - type: integer - - type: number - format: double - nullable: true - readOnly: true - example: 0.33 - required: - - advanced_metadata - - remote_endpoint_info - - remote_key_name - - schema - x-merge-category: ticketing - RemoteFieldAPIResponse: - type: object - properties: - Ticket: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Comment: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Project: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Collection: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - User: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Role: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Account: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Team: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Attachment: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Tag: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - Contact: - type: array - items: - $ref: '#/components/schemas/RemoteFieldAPI' - x-merge-category: ticketing - RemoteFieldClass: - type: object - properties: - id: - type: string - display_name: - type: string - remote_key_name: - type: string - description: - type: string - is_custom: - type: boolean - is_common_model_field: - type: boolean - is_required: - type: boolean - field_type: - $ref: '#/components/schemas/FieldTypeEnum' - field_format: - $ref: '#/components/schemas/FieldFormatEnum' - field_choices: - type: array - items: - type: object - properties: - value: - nullable: true - display_name: - type: string - nullable: true - nullable: true - readOnly: true - item_schema: - $ref: '#/components/schemas/ItemSchema' - x-merge-category: ticketing - RemoteFieldRequest: - type: object - properties: - remote_field_class: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/RemoteFieldClass' - example: b057d1d2-c204-4da8-a74c-c91d1a260614 - x-merge-expands-to: RemoteFieldClass - value: - nullable: true - example: string - required: - - remote_field_class - x-merge-expands: '{"remote_field_class": "RemoteFieldClass"}' - x-merge-category: ticketing - RemoteKey: - type: object - description: |- - # 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: - type: string - example: Remote Deployment Key 1 - key: - type: string - example: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA - required: - - key - - name - x-merge-category: ticketing - RemoteKeyForRegenerationRequest: - type: object - description: |- - # The RemoteKeyForRegeneration Object - ### Description - The `RemoteKeyForRegeneration` object is used to exchange an old remote key for a new one - - ### Usage Example - Post a `RemoteKeyForRegeneration` to swap out an old remote key for a new one - properties: - name: - type: string - minLength: 1 - description: The name of the remote key - example: Remote Deployment Key 1 - required: - - name - x-merge-category: ticketing - RemoteResponse: - type: object - description: |- - # 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: - type: string - example: GET - path: - type: string - example: /scooters - status: - type: integer - example: 200 - response: - example: - scooters: - - company: Lime - model: Gen 2.5 - - company: Bird - model: Bird Zero - response_headers: - type: object - additionalProperties: {} - example: - X-Page-Token: value - response_type: - oneOf: - - $ref: '#/components/schemas/ResponseTypeEnum' - - type: string - example: JSON - headers: - type: object - additionalProperties: {} - example: - EXTRA-HEADER: value - Authorization: - required: - - method - - path - - response - - status - x-merge-category: ticketing - RequestFormatEnum: - enum: - - JSON - - XML - - MULTIPART - type: string - description: |- - * `JSON` - JSON - * `XML` - XML - * `MULTIPART` - MULTIPART - x-merge-category: ticketing - ResponseTypeEnum: - enum: - - JSON - - BASE64_GZIP - type: string - description: |- - * `JSON` - JSON - * `BASE64_GZIP` - BASE64_GZIP - x-merge-category: ticketing - Role: - type: object - description: |- - # The Role Object - ### Description - The `Role` object is used to represent the set of actions & access that a user with this role is allowed to perform. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 23454124-387f-494d-265e-345b330c9123 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '123' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The name of the Role. - example: Member - ticket_actions: - type: array - items: - oneOf: - - $ref: '#/components/schemas/TicketActionsEnum' - - type: string - nullable: true - nullable: true - description: 'The set of actions that a User with this Role can perform. - Possible enum values include: `VIEW`, `CREATE`, `EDIT`, `DELETE`, `CLOSE`, - and `ASSIGN`.' - example: - - VIEW - - EDIT - - CREATE - ticket_access: - oneOf: - - $ref: '#/components/schemas/TicketAccessEnum' - - type: string - nullable: true - description: |- - The level of Ticket access that a User with this Role can perform. - - * `ALL` - ALL - * `ASSIGNED_ONLY` - ASSIGNED_ONLY - * `TEAM_ONLY` - TEAM_ONLY - example: ASSIGNED_ONLY - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-category: ticketing - RoleEnum: - enum: - - ADMIN - - DEVELOPER - - MEMBER - - API - - SYSTEM - - MERGE_TEAM - type: string - description: |- - * `ADMIN` - ADMIN - * `DEVELOPER` - DEVELOPER - * `MEMBER` - MEMBER - * `API` - API - * `SYSTEM` - SYSTEM - * `MERGE_TEAM` - MERGE_TEAM - x-merge-category: ticketing - SelectiveSyncConfigurationsUsageEnum: - enum: - - IN_NEXT_SYNC - - IN_LAST_SYNC - type: string - description: |- - * `IN_NEXT_SYNC` - IN_NEXT_SYNC - * `IN_LAST_SYNC` - IN_LAST_SYNC - x-merge-category: ticketing - StatusFd5Enum: - enum: - - SYNCING - - DONE - - FAILED - - DISABLED - - PAUSED - - PARTIALLY_SYNCED - type: string - description: |- - * `SYNCING` - SYNCING - * `DONE` - DONE - * `FAILED` - FAILED - * `DISABLED` - DISABLED - * `PAUSED` - PAUSED - * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED - x-merge-category: ticketing - SyncStatus: - type: object - description: |- - # 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: - type: string - example: Ticket - model_id: - type: string - example: ticketing.Ticket - last_sync_start: - type: string - format: date-time - example: '2021-03-30T19:44:18.695973Z' - next_sync_start: - type: string - format: date-time - example: '2021-03-30T20:44:18.662942Z' - last_sync_result: - oneOf: - - $ref: '#/components/schemas/LastSyncResultEnum' - - type: string - example: DONE - last_sync_finished: - type: string - format: date-time - example: '2021-03-30T19:55:18.695973Z' - status: - oneOf: - - $ref: '#/components/schemas/StatusFd5Enum' - - type: string - example: SYNCING - is_initial_sync: - type: boolean - example: true - selective_sync_configurations_usage: - $ref: '#/components/schemas/SelectiveSyncConfigurationsUsageEnum' - required: - - is_initial_sync - - model_id - - model_name - - status - x-merge-sample-json: '{"model_name": "Candidate", "model_id": "ats.Candidate", - "last_sync_start": "2021-03-30T19:44:18.695973Z", "next_sync_start": "2021-03-30T20:44:18.662942Z", - "status": "SYNCING", "is_initial_sync": true}' - x-merge-category: ticketing - Tag: - type: object - description: |- - # The Tag Object - ### Description - The `Tag` object is used to represent a tag or label for a ticket. - - ### Usage Example - TODO - properties: - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - id: - type: string - format: uuid - readOnly: true - example: 17a54124-287f-494d-965e-3c5b330c9a68 - name: - type: string - nullable: true - description: The tag's name. - example: Ticketing API - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-category: ticketing - Team: - type: object - description: |- - # The Team Object - ### Description - The `Team` object is used to represent one or more `Users` within the company receiving the ticket. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The team's name. - example: Platform - description: - type: string - nullable: true - description: The team's description. - example: Platform and Integrations Team - remote_was_deleted: - type: boolean - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"parent_team": "Team"}' - x-merge-category: ticketing - Ticket: - type: object - description: |- - # The Ticket Object - ### Description - The `Ticket` object is used to represent a ticket, issue, task or case. - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The ticket's name. - example: Please add more integrations - assignees: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The individual `Users` who are assigned to this ticket. This - does not include `Users` who just have view access to this ticket. To - fetch all `Users` and `Teams` that can access the ticket, use the `GET - /tickets/{ticket_id}/viewers` [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - example: - - 17a54124-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: User - assigned_teams: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Team' - nullable: true - description: The `Teams` that are assigned to this ticket. This does not - include `Teams` who just have view access to this ticket. To fetch all - `Users` and `Teams` that can access this ticket, use the `GET /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - example: - - 4857c306-c1f9-489e-a6b6-90902f736dfe - x-merge-expands-to: Team - creator: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The user who created this ticket. - x-merge-expands-to: User - due_date: - type: string - format: date-time - nullable: true - description: The ticket's due date. - example: '2022-10-11T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/TicketStatusEnum' - - type: string - nullable: true - description: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - example: OPEN - description: - type: string - nullable: true - description: The ticket’s description. HTML version of description is mapped - if supported by the third-party platform. - example: Can you please add more integrations? It'll make syncing data much - easier! - collections: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Collection' - nullable: true - description: The `Collections` that this `Ticket` is included in. - example: - - fb8c55b6-1cb8-4b4c-9fb6-17924231619d - x-merge-expands-to: Collection - ticket_type: - type: string - nullable: true - description: The sub category of the ticket within the 3rd party system. - Examples include incident, task, subtask or to-do. - example: incident - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account associated with the ticket. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Account - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The contact associated with the ticket. - example: 65c345ba-6870-4974-87ba-dd31509c367a - x-merge-expands-to: Contact - parent_ticket: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Ticket' - nullable: true - description: The ticket's parent ticket. - example: 75b33d04-30d2-4f3e-be45-27838bc94342 - x-merge-expands-to: Ticket - attachments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Attachment' - nullable: true - example: - - 42747df1-95e7-46e2-93cc-66f1191edca5 - - 92f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Attachment - access_level: - oneOf: - - $ref: '#/components/schemas/TicketAccessLevelEnum' - - type: string - nullable: true - description: |- - The description of who is able to access a given ticket, or where access is inherited from. - - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - * `COLLECTION` - COLLECTION - example: PRIVATE - tags: - type: array - items: - type: string - nullable: true - description: The tag's name. - example: - - enterprise - - other-tag - roles: - type: array - items: - type: string - format: uuid - nullable: true - example: - - 21a54124-397f-494d-985e-3c5b330b8a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - ticket_url: - type: string - format: uri - nullable: true - description: The 3rd party url of the Ticket. - maxLength: 2000 - example: https://thirdpartysoftware.com/project/3/issue/1 - priority: - oneOf: - - $ref: '#/components/schemas/PriorityEnum' - - type: string - nullable: true - description: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - example: HIGH - remote_created_at: - type: string - format: date-time - nullable: true - description: When the third party's ticket was created. - example: '2021-11-10T00:00:00Z' - remote_updated_at: - type: string - format: date-time - nullable: true - description: When the third party's ticket was updated. - example: '2021-12-09T00:00:00Z' - completed_at: - type: string - format: date-time - nullable: true - description: When the ticket was completed. - example: '2021-12-09T00:00:00Z' - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteField' - readOnly: true - x-merge-expands: '{"account": "Account", "assigned_teams": "Team", "assignees": - "User", "attachments": "Attachment", "collections": "Collection", "contact": - "Contact", "creator": "User", "parent_ticket": "Ticket"}' - x-merge-category: ticketing - TicketAccessEnum: - enum: - - ALL - - ASSIGNED_ONLY - - TEAM_ONLY - type: string - description: |- - * `ALL` - ALL - * `ASSIGNED_ONLY` - ASSIGNED_ONLY - * `TEAM_ONLY` - TEAM_ONLY - x-merge-category: ticketing - TicketAccessLevelEnum: - enum: - - COMPANY - - PUBLIC - - PRIVATE - - COLLECTION - type: string - description: |- - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - * `COLLECTION` - COLLECTION - x-merge-category: ticketing - TicketActionsEnum: - enum: - - VIEW - - CREATE - - EDIT - - DELETE - - CLOSE - - ASSIGN - type: string - description: |- - * `VIEW` - VIEW - * `CREATE` - CREATE - * `EDIT` - EDIT - * `DELETE` - DELETE - * `CLOSE` - CLOSE - * `ASSIGN` - ASSIGN - x-merge-category: ticketing - TicketEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/TicketRequest' - required: - - model - x-merge-category: ticketing - TicketRequest: - type: object - description: |- - # The Ticket Object - ### Description - The `Ticket` object is used to represent a ticket, issue, task or case. - ### Usage Example - TODO - properties: - name: - type: string - nullable: true - description: The ticket's name. - example: Please add more integrations - assignees: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The individual `Users` who are assigned to this ticket. This - does not include `Users` who just have view access to this ticket. To - fetch all `Users` and `Teams` that can access the ticket, use the `GET - /tickets/{ticket_id}/viewers` [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - example: - - 17a54124-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: User - assigned_teams: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Team' - nullable: true - description: The `Teams` that are assigned to this ticket. This does not - include `Teams` who just have view access to this ticket. To fetch all - `Users` and `Teams` that can access this ticket, use the `GET /tickets/{ticket_id}/viewers` - [endpoint](https://docs.merge.dev/ticketing/tickets/#tickets_viewers_list). - example: - - 4857c306-c1f9-489e-a6b6-90902f736dfe - x-merge-expands-to: Team - creator: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The user who created this ticket. - x-merge-expands-to: User - due_date: - type: string - format: date-time - nullable: true - description: The ticket's due date. - example: '2022-10-11T00:00:00Z' - status: - oneOf: - - $ref: '#/components/schemas/TicketStatusEnum' - - type: string - nullable: true - description: |- - The current status of the ticket. - - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - example: OPEN - description: - type: string - nullable: true - description: The ticket’s description. HTML version of description is mapped - if supported by the third-party platform. - example: Can you please add more integrations? It'll make syncing data much - easier! - collections: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Collection' - nullable: true - description: The `Collections` that this `Ticket` is included in. - example: - - fb8c55b6-1cb8-4b4c-9fb6-17924231619d - x-merge-expands-to: Collection - ticket_type: - type: string - nullable: true - description: The sub category of the ticket within the 3rd party system. - Examples include incident, task, subtask or to-do. - example: incident - account: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Account' - nullable: true - description: The account associated with the ticket. - example: 0958cbc6-6040-430a-848e-aafacbadf4ae - x-merge-expands-to: Account - contact: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Contact' - nullable: true - description: The contact associated with the ticket. - example: 65c345ba-6870-4974-87ba-dd31509c367a - x-merge-expands-to: Contact - parent_ticket: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Ticket' - nullable: true - description: The ticket's parent ticket. - example: 75b33d04-30d2-4f3e-be45-27838bc94342 - x-merge-expands-to: Ticket - attachments: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Attachment' - nullable: true - example: - - 42747df1-95e7-46e2-93cc-66f1191edca5 - - 92f972d0-2526-434b-9409-4c3b468e08f0 - x-merge-expands-to: Attachment - access_level: - oneOf: - - $ref: '#/components/schemas/TicketAccessLevelEnum' - - type: string - nullable: true - description: |- - The description of who is able to access a given ticket, or where access is inherited from. - - * `COMPANY` - COMPANY - * `PUBLIC` - PUBLIC - * `PRIVATE` - PRIVATE - * `COLLECTION` - COLLECTION - example: PRIVATE - tags: - type: array - items: - type: string - nullable: true - description: The tag's name. - example: - - enterprise - - other-tag - roles: - type: array - items: - type: string - format: uuid - nullable: true - example: - - 21a54124-397f-494d-985e-3c5b330b8a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - completed_at: - type: string - format: date-time - nullable: true - description: When the ticket was completed. - example: '2021-12-09T00:00:00Z' - ticket_url: - type: string - format: uri - nullable: true - description: The 3rd party url of the Ticket. - maxLength: 2000 - example: https://thirdpartysoftware.com/project/3/issue/1 - priority: - oneOf: - - $ref: '#/components/schemas/PriorityEnum' - - type: string - nullable: true - description: |- - The priority or urgency of the Ticket. - - * `URGENT` - URGENT - * `HIGH` - HIGH - * `NORMAL` - NORMAL - * `LOW` - LOW - example: HIGH - integration_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_integration_field: unique_integration_field_value - linked_account_params: - type: object - additionalProperties: {} - writeOnly: true - nullable: true - example: - unique_linked_account_field: unique_linked_account_field_value - remote_fields: - type: array - items: - $ref: '#/components/schemas/RemoteFieldRequest' - writeOnly: true - x-merge-expands: '{"account": "Account", "assigned_teams": "Team", "assignees": - "User", "attachments": "Attachment", "collections": "Collection", "contact": - "Contact", "creator": "User", "parent_ticket": "Ticket"}' - x-merge-category: ticketing - TicketResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Ticket' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ticketing - TicketStatusEnum: - enum: - - OPEN - - CLOSED - - IN_PROGRESS - - ON_HOLD - type: string - description: |- - * `OPEN` - OPEN - * `CLOSED` - CLOSED - * `IN_PROGRESS` - IN_PROGRESS - * `ON_HOLD` - ON_HOLD - x-merge-category: ticketing - TicketingAttachmentEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/AttachmentRequest' - required: - - model - x-merge-category: ticketing - TicketingAttachmentResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Attachment' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ticketing - TicketingContactEndpointRequest: - type: object - properties: - model: - $ref: '#/components/schemas/ContactRequest' - required: - - model - x-merge-category: ticketing - TicketingContactResponse: - type: object - properties: - model: - $ref: '#/components/schemas/Contact' - warnings: - type: array - items: - $ref: '#/components/schemas/WarningValidationProblem' - errors: - type: array - items: - $ref: '#/components/schemas/ErrorValidationProblem' - logs: - type: array - items: - $ref: '#/components/schemas/DebugModeLog' - required: - - errors - - model - - warnings - x-merge-category: ticketing - User: - type: object - description: |- - # The User Object - ### Description - The `User` object is used to represent a user with a login to the ticketing system. - Users are either assignees who are directly responsible or a viewer on a `Ticket`/ `Collection`. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '19202938' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - name: - type: string - nullable: true - description: The user's name. - example: Gil Feig - email_address: - type: string - nullable: true - description: The user's email address. - example: help@merge.dev - is_active: - type: boolean - nullable: true - description: Whether or not the user is active. - example: true - teams: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Team' - nullable: true - example: - - 28b54125-287f-494d-965e-3c5b330c9a68 - - 17a54124-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: Team - roles: - type: array - items: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Role' - nullable: true - example: - - 23454124-387f-494d-265e-345b330c9123 - x-merge-expands-to: Role - avatar: - type: string - nullable: true - description: The user's avatar picture. - example: https://merge.dev/user_profile_pic.png - remote_was_deleted: - type: boolean - readOnly: true - description: 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: - type: object - additionalProperties: {} - nullable: true - readOnly: true - example: - organization_defined_targets: - custom_key: custom_value - linked_account_defined_targets: - custom_key: custom_value - remote_data: - type: array - items: - $ref: '#/components/schemas/RemoteData' - readOnly: true - nullable: true - x-merge-expands: '{"roles": "Role", "teams": "Team"}' - x-merge-category: ticketing - ValidationProblemSource: - type: object - properties: - pointer: - type: string - required: - - pointer - x-merge-category: ticketing - Viewer: - type: object - description: |- - # The Viewer Object - ### Description - The `Viewer` object is used to represent a User or Team within a company. - - ### Usage Example - TODO - properties: - id: - type: string - format: uuid - readOnly: true - example: 17a54124-287f-494d-965e-3c5b330c9a68 - remote_id: - type: string - nullable: true - description: The third-party API ID of the matching object. - example: '088899' - created_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was created by Merge. - example: '2021-09-15T00:00:00Z' - modified_at: - type: string - format: date-time - readOnly: true - description: The datetime that this object was modified by Merge. - example: '2021-10-16T00:00:00Z' - team: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/Team' - nullable: true - description: The Team this Viewer belongs to. - example: 28b54125-287f-494d-965e-3c5b330c9a68 - x-merge-expands-to: Team - user: - oneOf: - - type: string - format: uuid - - $ref: '#/components/schemas/User' - nullable: true - description: The User this Viewer belongs to. - example: 23454124-387f-494d-265e-345b330c9123 - x-merge-expands-to: User - x-merge-expands: '{"team": "Team", "user": "User"}' - x-merge-category: ticketing - WarningValidationProblem: - type: object - properties: - source: - $ref: '#/components/schemas/ValidationProblemSource' - example: - pointer: /age - title: - type: string - example: Unrecognized Field - detail: - type: string - example: An unrecognized field, age, was passed in with request data. - problem_type: - type: string - example: UNRECOGNIZED_FIELD - required: - - detail - - problem_type - - title - x-merge-category: ticketing - WebhookReceiver: - type: object - properties: - event: - type: string - is_active: - type: boolean - key: - type: string - required: - - event - - is_active - x-merge-category: ticketing - WebhookReceiverRequest: - type: object - properties: - event: - type: string - minLength: 1 - is_active: - type: boolean - key: - type: string - minLength: 1 - required: - - event - - is_active - x-merge-category: ticketing - securitySchemes: - tokenAuth: - type: http - scheme: bearer - description: Token-based authentication with required prefix "Bearer" - x-fern-token-variable-name: api_key -servers: -- url: https://api.merge.dev/api/ticketing/v1 - description: Production - x-fern-server-name: Production -- url: https://api-sandbox.merge.dev/api/ticketing/v1 - description: Sandbox - x-fern-server-name: Sandbox -- url: https://api-eu.merge.dev/api/ticketing/v1 - description: Production EU - x-fern-server-name: ProductionEU -- url: https://api-ap.merge.dev/api/ticketing/v1 - description: Production APSE1 - x-fern-server-name: ProductionAPSE1 diff --git a/README.md b/README.md index ce839f993..c339a4c64 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,25 @@ The Merge Java library provides convenient access to the Merge APIs from Java. +## Table of Contents + +- [Documentation](#documentation) +- [Installation](#installation) +- [Instantiation](#instantiation) +- [Request Options](#request-options) +- [Usage](#usage) +- [Environments](#environments) +- [Base Url](#base-url) +- [Exception Handling](#exception-handling) +- [Advanced](#advanced) + - [Custom Client](#custom-client) + - [Retries](#retries) + - [Timeouts](#timeouts) + - [Custom Headers](#custom-headers) + - [Access Raw Response Data](#access-raw-response-data) +- [Contributing](#contributing) +- [Reference](#reference) + ## Documentation API documentation is available at [here](https://docs.merge.dev/basics/authentication/). @@ -17,7 +36,7 @@ Add the dependency in your `build.gradle` file: ```groovy dependencies { - implementation 'dev.merge:merge-java-client' + implementation 'dev.merge:merge-java-client:5.1.0' } ``` @@ -29,7 +48,7 @@ Add the dependency in your `pom.xml` file: dev.merge merge-java-client - 5.0.1 + 5.1.0 ``` @@ -117,9 +136,9 @@ When the API returns a non-success status code (4xx or 5xx response), an API exc ```java import com.merge.api.core.ApiError; -try { +try{ client.ats().accountDetails().retrieve(...); -} catch (ApiError e) { +} catch (ApiError e){ // Do something with the API exception... } ``` @@ -128,7 +147,7 @@ try { ### Custom Client -This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one. +This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one. However, you can pass your own client like so: ```java @@ -147,7 +166,9 @@ MergeApiClient client = MergeApiClient The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured -retry limit (default: 2). +retry limit (default: 2). Before defaulting to exponential backoff, the SDK will first attempt to respect +the `Retry-After` header (as either in seconds or as an HTTP date), and then the `X-RateLimit-Reset` header +(as a Unix timestamp in epoch seconds); failing both of those, it will fall back to exponential backoff. A request is deemed retryable when any of the following HTTP status codes is returned: @@ -216,6 +237,19 @@ client.ats().accountDetails().retrieve( ); ``` +### Access Raw Response Data + +The SDK provides access to raw response data, including headers, through the `withRawResponse()` method. +The `withRawResponse()` method returns a raw client that wraps all responses with `body()` and `headers()` methods. +(A normal client's `response` is identical to a raw client's `response.body()`.) + +```java +RetrieveHttpResponse response = client.ats().accountDetails().withRawResponse().retrieve(...); + +System.out.println(response.body()); +System.out.println(response.headers().get("X-My-Header")); +``` + ## Contributing While we value open-source contributions to this SDK, this library is generated programmatically. diff --git a/build.gradle b/build.gradle index e1892b052..3872e5adf 100644 --- a/build.gradle +++ b/build.gradle @@ -9,19 +9,18 @@ plugins { repositories { mavenCentral() maven { - url 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/' + url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' } } dependencies { - api 'com.squareup.okhttp3:okhttp:4.12.0' - api 'com.fasterxml.jackson.core:jackson-databind:2.17.2' - api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2' - api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2' + api 'com.squareup.okhttp3:okhttp:5.2.1' + api 'com.fasterxml.jackson.core:jackson-databind:2.18.2' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2' + api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2' testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2' - testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0' } @@ -48,7 +47,7 @@ java { group = 'dev.merge' -version = '5.0.1' +version = '5.1.0' jar { dependsOn(":generatePomFileForMavenPublication") @@ -79,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.merge' artifactId = 'merge-java-client' - version = '5.0.1' + version = '5.1.0' from components.java pom { name = 'merge' @@ -87,7 +86,7 @@ publishing { url = 'https://buildwithfern.com' licenses { license { - name = 'Custom License (LICENSE)' + name = 'Last updated: April 21, 2022' } } developers { diff --git a/src/main/java/com/merge/api/AsyncMergeApiClient.java b/src/main/java/com/merge/api/AsyncMergeApiClient.java index fba90deab..f56e55e1d 100644 --- a/src/main/java/com/merge/api/AsyncMergeApiClient.java +++ b/src/main/java/com/merge/api/AsyncMergeApiClient.java @@ -5,11 +5,13 @@ import com.merge.api.accounting.AsyncAccountingClient; import com.merge.api.ats.AsyncAtsClient; +import com.merge.api.chat.AsyncChatClient; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; import com.merge.api.crm.AsyncCrmClient; import com.merge.api.filestorage.AsyncFileStorageClient; import com.merge.api.hris.AsyncHrisClient; +import com.merge.api.knowledgebase.AsyncKnowledgebaseClient; import com.merge.api.ticketing.AsyncTicketingClient; import java.util.function.Supplier; @@ -22,10 +24,14 @@ public class AsyncMergeApiClient { protected final Supplier crmClient; + protected final Supplier chatClient; + protected final Supplier fileStorageClient; protected final Supplier hrisClient; + protected final Supplier knowledgebaseClient; + protected final Supplier ticketingClient; public AsyncMergeApiClient(ClientOptions clientOptions) { @@ -33,8 +39,10 @@ public AsyncMergeApiClient(ClientOptions clientOptions) { this.atsClient = Suppliers.memoize(() -> new AsyncAtsClient(clientOptions)); this.accountingClient = Suppliers.memoize(() -> new AsyncAccountingClient(clientOptions)); this.crmClient = Suppliers.memoize(() -> new AsyncCrmClient(clientOptions)); + this.chatClient = Suppliers.memoize(() -> new AsyncChatClient(clientOptions)); this.fileStorageClient = Suppliers.memoize(() -> new AsyncFileStorageClient(clientOptions)); this.hrisClient = Suppliers.memoize(() -> new AsyncHrisClient(clientOptions)); + this.knowledgebaseClient = Suppliers.memoize(() -> new AsyncKnowledgebaseClient(clientOptions)); this.ticketingClient = Suppliers.memoize(() -> new AsyncTicketingClient(clientOptions)); } @@ -50,6 +58,10 @@ public AsyncCrmClient crm() { return this.crmClient.get(); } + public AsyncChatClient chat() { + return this.chatClient.get(); + } + public AsyncFileStorageClient fileStorage() { return this.fileStorageClient.get(); } @@ -58,6 +70,10 @@ public AsyncHrisClient hris() { return this.hrisClient.get(); } + public AsyncKnowledgebaseClient knowledgebase() { + return this.knowledgebaseClient.get(); + } + public AsyncTicketingClient ticketing() { return this.ticketingClient.get(); } diff --git a/src/main/java/com/merge/api/MergeApiClient.java b/src/main/java/com/merge/api/MergeApiClient.java index 972e6641e..be31b3656 100644 --- a/src/main/java/com/merge/api/MergeApiClient.java +++ b/src/main/java/com/merge/api/MergeApiClient.java @@ -5,11 +5,13 @@ import com.merge.api.accounting.AccountingClient; import com.merge.api.ats.AtsClient; +import com.merge.api.chat.ChatClient; import com.merge.api.core.ClientOptions; import com.merge.api.core.Suppliers; import com.merge.api.crm.CrmClient; import com.merge.api.filestorage.FileStorageClient; import com.merge.api.hris.HrisClient; +import com.merge.api.knowledgebase.KnowledgebaseClient; import com.merge.api.ticketing.TicketingClient; import java.util.function.Supplier; @@ -22,10 +24,14 @@ public class MergeApiClient { protected final Supplier crmClient; + protected final Supplier chatClient; + protected final Supplier fileStorageClient; protected final Supplier hrisClient; + protected final Supplier knowledgebaseClient; + protected final Supplier ticketingClient; public MergeApiClient(ClientOptions clientOptions) { @@ -33,8 +39,10 @@ public MergeApiClient(ClientOptions clientOptions) { this.atsClient = Suppliers.memoize(() -> new AtsClient(clientOptions)); this.accountingClient = Suppliers.memoize(() -> new AccountingClient(clientOptions)); this.crmClient = Suppliers.memoize(() -> new CrmClient(clientOptions)); + this.chatClient = Suppliers.memoize(() -> new ChatClient(clientOptions)); this.fileStorageClient = Suppliers.memoize(() -> new FileStorageClient(clientOptions)); this.hrisClient = Suppliers.memoize(() -> new HrisClient(clientOptions)); + this.knowledgebaseClient = Suppliers.memoize(() -> new KnowledgebaseClient(clientOptions)); this.ticketingClient = Suppliers.memoize(() -> new TicketingClient(clientOptions)); } @@ -50,6 +58,10 @@ public CrmClient crm() { return this.crmClient.get(); } + public ChatClient chat() { + return this.chatClient.get(); + } + public FileStorageClient fileStorage() { return this.fileStorageClient.get(); } @@ -58,6 +70,10 @@ public HrisClient hris() { return this.hrisClient.get(); } + public KnowledgebaseClient knowledgebase() { + return this.knowledgebaseClient.get(); + } + public TicketingClient ticketing() { return this.ticketingClient.get(); } diff --git a/src/main/java/com/merge/api/accounting/AccountTokenClient.java b/src/main/java/com/merge/api/accounting/AccountTokenClient.java index e1bd0ccb9..1b5a4ef59 100644 --- a/src/main/java/com/merge/api/accounting/AccountTokenClient.java +++ b/src/main/java/com/merge/api/accounting/AccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AccountToken; +import com.merge.api.accounting.types.RegenerateAccountToken; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; @@ -37,4 +38,18 @@ public AccountToken retrieve(String publicToken) { public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).body(); } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } } diff --git a/src/main/java/com/merge/api/accounting/AccountingClient.java b/src/main/java/com/merge/api/accounting/AccountingClient.java index d62497b9e..8e623634d 100644 --- a/src/main/java/com/merge/api/accounting/AccountingClient.java +++ b/src/main/java/com/merge/api/accounting/AccountingClient.java @@ -50,6 +50,8 @@ public class AccountingClient { protected final Supplier employeesClient; + protected final Supplier expenseReportsClient; + protected final Supplier expensesClient; protected final Supplier fieldMappingClient; @@ -64,6 +66,8 @@ public class AccountingClient { protected final Supplier issuesClient; + protected final Supplier itemFulfillmentsClient; + protected final Supplier itemsClient; protected final Supplier journalEntriesClient; @@ -88,6 +92,8 @@ public class AccountingClient { protected final Supplier regenerateKeyClient; + protected final Supplier salesOrdersClient; + protected final Supplier syncStatusClient; protected final Supplier forceResyncClient; @@ -124,6 +130,7 @@ public AccountingClient(ClientOptions clientOptions) { this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); this.employeesClient = Suppliers.memoize(() -> new EmployeesClient(clientOptions)); + this.expenseReportsClient = Suppliers.memoize(() -> new ExpenseReportsClient(clientOptions)); this.expensesClient = Suppliers.memoize(() -> new ExpensesClient(clientOptions)); this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); this.generalLedgerTransactionsClient = @@ -132,6 +139,7 @@ public AccountingClient(ClientOptions clientOptions) { this.incomeStatementsClient = Suppliers.memoize(() -> new IncomeStatementsClient(clientOptions)); this.invoicesClient = Suppliers.memoize(() -> new InvoicesClient(clientOptions)); this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); + this.itemFulfillmentsClient = Suppliers.memoize(() -> new ItemFulfillmentsClient(clientOptions)); this.itemsClient = Suppliers.memoize(() -> new ItemsClient(clientOptions)); this.journalEntriesClient = Suppliers.memoize(() -> new JournalEntriesClient(clientOptions)); this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); @@ -144,6 +152,7 @@ public AccountingClient(ClientOptions clientOptions) { this.projectsClient = Suppliers.memoize(() -> new ProjectsClient(clientOptions)); this.purchaseOrdersClient = Suppliers.memoize(() -> new PurchaseOrdersClient(clientOptions)); this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.salesOrdersClient = Suppliers.memoize(() -> new SalesOrdersClient(clientOptions)); this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); this.taxRatesClient = Suppliers.memoize(() -> new TaxRatesClient(clientOptions)); @@ -233,6 +242,10 @@ public EmployeesClient employees() { return this.employeesClient.get(); } + public ExpenseReportsClient expenseReports() { + return this.expenseReportsClient.get(); + } + public ExpensesClient expenses() { return this.expensesClient.get(); } @@ -261,6 +274,10 @@ public IssuesClient issues() { return this.issuesClient.get(); } + public ItemFulfillmentsClient itemFulfillments() { + return this.itemFulfillmentsClient.get(); + } + public ItemsClient items() { return this.itemsClient.get(); } @@ -309,6 +326,10 @@ public RegenerateKeyClient regenerateKey() { return this.regenerateKeyClient.get(); } + public SalesOrdersClient salesOrders() { + return this.salesOrdersClient.get(); + } + public SyncStatusClient syncStatus() { return this.syncStatusClient.get(); } diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java index 6bdc8b349..3b0247537 100644 --- a/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AccountToken; +import com.merge.api.accounting.types.RegenerateAccountToken; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import java.util.concurrent.CompletableFuture; @@ -38,4 +39,18 @@ public CompletableFuture retrieve(String publicToken) { public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountingClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountingClient.java index 211947e9f..0aabb0fae 100644 --- a/src/main/java/com/merge/api/accounting/AsyncAccountingClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncAccountingClient.java @@ -50,6 +50,8 @@ public class AsyncAccountingClient { protected final Supplier employeesClient; + protected final Supplier expenseReportsClient; + protected final Supplier expensesClient; protected final Supplier fieldMappingClient; @@ -64,6 +66,8 @@ public class AsyncAccountingClient { protected final Supplier issuesClient; + protected final Supplier itemFulfillmentsClient; + protected final Supplier itemsClient; protected final Supplier journalEntriesClient; @@ -88,6 +92,8 @@ public class AsyncAccountingClient { protected final Supplier regenerateKeyClient; + protected final Supplier salesOrdersClient; + protected final Supplier syncStatusClient; protected final Supplier forceResyncClient; @@ -124,6 +130,7 @@ public AsyncAccountingClient(ClientOptions clientOptions) { this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); this.employeesClient = Suppliers.memoize(() -> new AsyncEmployeesClient(clientOptions)); + this.expenseReportsClient = Suppliers.memoize(() -> new AsyncExpenseReportsClient(clientOptions)); this.expensesClient = Suppliers.memoize(() -> new AsyncExpensesClient(clientOptions)); this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); this.generalLedgerTransactionsClient = @@ -132,6 +139,7 @@ public AsyncAccountingClient(ClientOptions clientOptions) { this.incomeStatementsClient = Suppliers.memoize(() -> new AsyncIncomeStatementsClient(clientOptions)); this.invoicesClient = Suppliers.memoize(() -> new AsyncInvoicesClient(clientOptions)); this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.itemFulfillmentsClient = Suppliers.memoize(() -> new AsyncItemFulfillmentsClient(clientOptions)); this.itemsClient = Suppliers.memoize(() -> new AsyncItemsClient(clientOptions)); this.journalEntriesClient = Suppliers.memoize(() -> new AsyncJournalEntriesClient(clientOptions)); this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); @@ -144,6 +152,7 @@ public AsyncAccountingClient(ClientOptions clientOptions) { this.projectsClient = Suppliers.memoize(() -> new AsyncProjectsClient(clientOptions)); this.purchaseOrdersClient = Suppliers.memoize(() -> new AsyncPurchaseOrdersClient(clientOptions)); this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.salesOrdersClient = Suppliers.memoize(() -> new AsyncSalesOrdersClient(clientOptions)); this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); this.taxRatesClient = Suppliers.memoize(() -> new AsyncTaxRatesClient(clientOptions)); @@ -233,6 +242,10 @@ public AsyncEmployeesClient employees() { return this.employeesClient.get(); } + public AsyncExpenseReportsClient expenseReports() { + return this.expenseReportsClient.get(); + } + public AsyncExpensesClient expenses() { return this.expensesClient.get(); } @@ -261,6 +274,10 @@ public AsyncIssuesClient issues() { return this.issuesClient.get(); } + public AsyncItemFulfillmentsClient itemFulfillments() { + return this.itemFulfillmentsClient.get(); + } + public AsyncItemsClient items() { return this.itemsClient.get(); } @@ -309,6 +326,10 @@ public AsyncRegenerateKeyClient regenerateKey() { return this.regenerateKeyClient.get(); } + public AsyncSalesOrdersClient salesOrders() { + return this.salesOrdersClient.get(); + } + public AsyncSyncStatusClient syncStatus() { return this.syncStatusClient.get(); } diff --git a/src/main/java/com/merge/api/accounting/AsyncContactsClient.java b/src/main/java/com/merge/api/accounting/AsyncContactsClient.java index 4f626f9e3..2076541c5 100644 --- a/src/main/java/com/merge/api/accounting/AsyncContactsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncContactsClient.java @@ -10,6 +10,7 @@ import com.merge.api.accounting.types.ContactsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.ContactsRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedContactEndpointRequest; import com.merge.api.accounting.types.RemoteFieldClass; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; @@ -91,6 +92,35 @@ public CompletableFuture retrieve( return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedContactEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Contact PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Contact PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + /** * Returns metadata for Contact POSTs. */ diff --git a/src/main/java/com/merge/api/accounting/AsyncCreditNotesClient.java b/src/main/java/com/merge/api/accounting/AsyncCreditNotesClient.java index 94b875854..7cda95bd2 100644 --- a/src/main/java/com/merge/api/accounting/AsyncCreditNotesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncCreditNotesClient.java @@ -3,12 +3,14 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyCreditNoteRequest; import com.merge.api.accounting.types.CreditNote; import com.merge.api.accounting.types.CreditNoteEndpointRequest; import com.merge.api.accounting.types.CreditNoteResponse; import com.merge.api.accounting.types.CreditNotesListRequest; import com.merge.api.accounting.types.CreditNotesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedCreditNoteEndpointRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; @@ -90,6 +92,50 @@ public CompletableFuture retrieve( return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } + /** + * Updates a CreditNote object with the given id. + */ + public CompletableFuture partialUpdate(String id, PatchedCreditNoteEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a CreditNote object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedCreditNoteEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public CompletableFuture applicationCreate(String id, ApplyCreditNoteRequest request) { + return this.rawClient.applicationCreate(id, request).thenApply(response -> response.body()); + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public CompletableFuture applicationCreate( + String id, ApplyCreditNoteRequest request, RequestOptions requestOptions) { + return this.rawClient.applicationCreate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + /** * Returns metadata for CreditNote POSTs. */ diff --git a/src/main/java/com/merge/api/accounting/AsyncExpenseReportsClient.java b/src/main/java/com/merge/api/accounting/AsyncExpenseReportsClient.java new file mode 100644 index 000000000..9a335b7da --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncExpenseReportsClient.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.ExpenseReport; +import com.merge.api.accounting.types.ExpenseReportEndpointRequest; +import com.merge.api.accounting.types.ExpenseReportLine; +import com.merge.api.accounting.types.ExpenseReportResponse; +import com.merge.api.accounting.types.ExpenseReportsLinesListRequest; +import com.merge.api.accounting.types.ExpenseReportsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsListRequest; +import com.merge.api.accounting.types.ExpenseReportsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncExpenseReportsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawExpenseReportsClient rawClient; + + public AsyncExpenseReportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawExpenseReportsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawExpenseReportsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of ExpenseReport objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public CompletableFuture> list(ExpenseReportsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public CompletableFuture> list( + ExpenseReportsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public CompletableFuture create(ExpenseReportEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public CompletableFuture create( + ExpenseReportEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public CompletableFuture> linesList(String expenseReportId) { + return this.rawClient.linesList(expenseReportId).thenApply(response -> response.body()); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public CompletableFuture> linesList( + String expenseReportId, ExpenseReportsLinesListRequest request) { + return this.rawClient.linesList(expenseReportId, request).thenApply(response -> response.body()); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public CompletableFuture> linesList( + String expenseReportId, ExpenseReportsLinesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesList(expenseReportId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public CompletableFuture retrieve(String id, ExpenseReportsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public CompletableFuture retrieve( + String id, ExpenseReportsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncExpensesClient.java b/src/main/java/com/merge/api/accounting/AsyncExpensesClient.java index d06106a84..8c34cee33 100644 --- a/src/main/java/com/merge/api/accounting/AsyncExpensesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncExpensesClient.java @@ -3,7 +3,10 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseBulkRequest; import com.merge.api.accounting.types.ExpenseEndpointRequest; import com.merge.api.accounting.types.ExpenseResponse; import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; @@ -92,6 +95,35 @@ public CompletableFuture retrieve( return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } + /** + * Creates multiple Expense objects with the given values. + */ + public CompletableFuture bulkCreate(ExpenseBulkRequest request) { + return this.rawClient.bulkCreate(request).thenApply(response -> response.body()); + } + + /** + * Creates multiple Expense objects with the given values. + */ + public CompletableFuture bulkCreate( + ExpenseBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).thenApply(response -> response.body()); + } + /** * Returns a list of RemoteFieldClass objects. */ diff --git a/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java b/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java index 897b611c4..e5dbf5d42 100644 --- a/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java @@ -3,7 +3,10 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceBulkRequest; import com.merge.api.accounting.types.InvoiceEndpointRequest; import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; @@ -110,6 +113,35 @@ public CompletableFuture partialUpdate( return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); } + /** + * Creates multiple Invoice objects with the given values. + */ + public CompletableFuture bulkCreate(InvoiceBulkRequest request) { + return this.rawClient.bulkCreate(request).thenApply(response -> response.body()); + } + + /** + * Creates multiple Invoice objects with the given values. + */ + public CompletableFuture bulkCreate( + InvoiceBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).thenApply(response -> response.body()); + } + /** * Returns a list of RemoteFieldClass objects. */ diff --git a/src/main/java/com/merge/api/accounting/AsyncItemFulfillmentsClient.java b/src/main/java/com/merge/api/accounting/AsyncItemFulfillmentsClient.java new file mode 100644 index 000000000..0368cf2c8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncItemFulfillmentsClient.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.ItemFulfillment; +import com.merge.api.accounting.types.ItemFulfillmentBulkRequest; +import com.merge.api.accounting.types.ItemFulfillmentEndpointRequest; +import com.merge.api.accounting.types.ItemFulfillmentResponse; +import com.merge.api.accounting.types.ItemFulfillmentsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncItemFulfillmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawItemFulfillmentsClient rawClient; + + public AsyncItemFulfillmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawItemFulfillmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawItemFulfillmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public CompletableFuture> list(ItemFulfillmentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public CompletableFuture> list( + ItemFulfillmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public CompletableFuture create(ItemFulfillmentEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public CompletableFuture create( + ItemFulfillmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public CompletableFuture retrieve(String id, ItemFulfillmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public CompletableFuture retrieve( + String id, ItemFulfillmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public CompletableFuture bulkCreate(ItemFulfillmentBulkRequest request) { + return this.rawClient.bulkCreate(request).thenApply(response -> response.body()); + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public CompletableFuture bulkCreate( + ItemFulfillmentBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncLinkTokenClient.java index 5c237a789..b00c1d262 100644 --- a/src/main/java/com/merge/api/accounting/AsyncLinkTokenClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncLinkTokenClient.java @@ -27,14 +27,14 @@ public AsyncRawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request) { return this.rawClient.create(request).thenApply(response -> response.body()); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); diff --git a/src/main/java/com/merge/api/accounting/AsyncProjectsClient.java b/src/main/java/com/merge/api/accounting/AsyncProjectsClient.java index 061f17989..c10adbc25 100644 --- a/src/main/java/com/merge/api/accounting/AsyncProjectsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncProjectsClient.java @@ -3,12 +3,12 @@ */ package com.merge.api.accounting; -import com.merge.api.accounting.types.PaginatedProjectList; import com.merge.api.accounting.types.Project; import com.merge.api.accounting.types.ProjectsListRequest; import com.merge.api.accounting.types.ProjectsRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; import java.util.concurrent.CompletableFuture; public class AsyncProjectsClient { @@ -31,21 +31,22 @@ public AsyncRawProjectsClient withRawResponse() { /** * Returns a list of Project objects. */ - public CompletableFuture list() { + public CompletableFuture> list() { return this.rawClient.list().thenApply(response -> response.body()); } /** * Returns a list of Project objects. */ - public CompletableFuture list(ProjectsListRequest request) { + public CompletableFuture> list(ProjectsListRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } /** * Returns a list of Project objects. */ - public CompletableFuture list(ProjectsListRequest request, RequestOptions requestOptions) { + public CompletableFuture> list( + ProjectsListRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountDetailsClient.java index 6c2bc2036..a28670f87 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountDetailsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(RequestO @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountTokenClient.java index b5f2c7d7b..036aa5c56 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAccountTokenClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AccountToken; +import com.merge.api.accounting.types.RegenerateAccountToken; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -18,6 +19,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; @@ -61,18 +63,70 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java index 66228b3bb..d3efe724c 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java @@ -103,9 +103,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); AccountingPeriodsListRequest nextRequest = AccountingPeriodsListRequest.builder() .from(request) @@ -127,12 +128,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -197,18 +195,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPeriod.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountingPeriod.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java index c497ac2ca..0dbbf4692 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -160,9 +158,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); Optional startingAfter = parsedResponse.getNext(); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) @@ -183,12 +182,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -226,12 +222,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -251,18 +245,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -338,17 +330,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -393,18 +383,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAddressesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAddressesClient.java index 5e0580b26..b7825154a 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAddressesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAddressesClient.java @@ -88,17 +88,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Address.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Address.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java index 98ecea4f7..b6177b082 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java @@ -73,19 +73,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -133,19 +130,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + responseBodyString, AsyncPassthroughRetrieveResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java index e5ff7bb9a..83f45962c 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java @@ -60,18 +60,16 @@ public CompletableFuture> retrieve(String id @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPostTask.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPostTask.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java index eb1302e65..e42c11b49 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -134,9 +132,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) @@ -158,12 +157,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -202,12 +198,10 @@ public CompletableFuture> cre QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -227,19 +221,17 @@ public CompletableFuture> cre @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AccountingAttachmentResponse.class), + responseBodyString, AccountingAttachmentResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -304,18 +296,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingAttachment.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountingAttachment.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -360,18 +350,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java index 1fa3cdd82..0605ce9aa 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java @@ -99,9 +99,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAuditLogEventList.class); + responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -122,12 +123,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawAvailableActionsClient.java index 066431754..cd6865968 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAvailableActionsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java index f18b92a6a..88b0b3fb8 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java @@ -130,9 +130,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedBalanceSheetList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedBalanceSheetList.class); + responseBodyString, PaginatedBalanceSheetList.class); Optional startingAfter = parsedResponse.getNext(); BalanceSheetsListRequest nextRequest = BalanceSheetsListRequest.builder() .from(request) @@ -153,12 +154,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,18 +225,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BalanceSheet.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BalanceSheet.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java index 74a7b3b90..49da308e1 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -109,9 +107,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); BankFeedAccountsListRequest nextRequest = BankFeedAccountsListRequest.builder() .from(request) @@ -133,12 +132,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -177,12 +173,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -202,19 +196,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), BankFeedAccountResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankFeedAccountResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -279,18 +270,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedAccount.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankFeedAccount.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -335,18 +324,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java index 7ec0f2dc6..35c069361 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -138,9 +136,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); BankFeedTransactionsListRequest nextRequest = BankFeedTransactionsListRequest.builder() .from(request) @@ -162,12 +161,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -206,12 +202,10 @@ public CompletableFuture> crea QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -231,19 +225,17 @@ public CompletableFuture> crea @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), BankFeedTransactionResponse.class), + responseBodyString, BankFeedTransactionResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -312,18 +304,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedTransaction.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankFeedTransaction.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -368,18 +358,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java index 26652d49f..23d7a8ec5 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java @@ -131,9 +131,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); CashFlowStatementsListRequest nextRequest = CashFlowStatementsListRequest.builder() .from(request) @@ -155,12 +156,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -229,18 +227,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CashFlowStatement.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CashFlowStatement.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java b/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java index 9ce6da5dc..3d126fb92 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java @@ -99,6 +99,10 @@ public CompletableFuture>> QueryStringMapper.addQueryParameter( httpUrl, "modified_before", request.getModifiedBefore().get(), false); } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); @@ -126,9 +130,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedCompanyInfoList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedCompanyInfoList.class); + PaginatedCompanyInfoList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyInfoList.class); Optional startingAfter = parsedResponse.getNext(); CompanyInfoListRequest nextRequest = CompanyInfoListRequest.builder() .from(request) @@ -149,12 +154,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -223,18 +225,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CompanyInfo.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CompanyInfo.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java index f78a5b65e..b84a16dc1 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java @@ -12,6 +12,7 @@ import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedContactList; import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PatchedContactEndpointRequest; import com.merge.api.accounting.types.RemoteFieldClass; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; @@ -24,9 +25,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -174,9 +173,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedContactList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); Optional startingAfter = parsedResponse.getNext(); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) @@ -197,12 +197,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -240,12 +237,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -265,18 +260,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ContactResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ContactResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -359,17 +352,142 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Contact.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedContactEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Contact object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/contacts") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ContactResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for Contact PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Contact PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/contacts/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -414,18 +532,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -517,9 +632,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() @@ -542,12 +658,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java index e68488516..5d5537030 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java @@ -3,6 +3,7 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyCreditNoteRequest; import com.merge.api.accounting.types.CreditNote; import com.merge.api.accounting.types.CreditNoteEndpointRequest; import com.merge.api.accounting.types.CreditNoteResponse; @@ -10,6 +11,7 @@ import com.merge.api.accounting.types.CreditNotesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedCreditNoteList; +import com.merge.api.accounting.types.PatchedCreditNoteEndpointRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,9 +23,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -159,9 +159,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedCreditNoteList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedCreditNoteList.class); + PaginatedCreditNoteList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCreditNoteList.class); Optional startingAfter = parsedResponse.getNext(); CreditNotesListRequest nextRequest = CreditNotesListRequest.builder() .from(request) @@ -182,12 +183,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -225,12 +223,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -250,18 +246,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNoteResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -337,18 +331,215 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNote.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a CreditNote object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCreditNoteEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a CreditNote object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedCreditNoteEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNoteResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public CompletableFuture> applicationCreate( + String id, ApplyCreditNoteRequest request) { + return applicationCreate(id, request, null); + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public CompletableFuture> applicationCreate( + String id, ApplyCreditNoteRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes") + .addPathSegment(id) + .addPathSegments("application"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNote.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNoteResponse.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -393,18 +584,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/accounting/AsyncRawDeleteAccountClient.java index 90b7ddd2c..542d438ef 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawDeleteAccountClient.java @@ -63,11 +63,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java index e8274e409..10bd77f72 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java @@ -60,6 +60,18 @@ public CompletableFuture>> lis HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/employees"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -82,10 +94,22 @@ public CompletableFuture>> lis QueryStringMapper.addQueryParameter( httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -105,9 +129,10 @@ public CompletableFuture>> lis @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEmployeeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); Optional startingAfter = parsedResponse.getNext(); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) @@ -128,12 +153,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -201,17 +223,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Employee.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawExpenseReportsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawExpenseReportsClient.java new file mode 100644 index 000000000..6335c6153 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawExpenseReportsClient.java @@ -0,0 +1,762 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.ExpenseReport; +import com.merge.api.accounting.types.ExpenseReportEndpointRequest; +import com.merge.api.accounting.types.ExpenseReportLine; +import com.merge.api.accounting.types.ExpenseReportResponse; +import com.merge.api.accounting.types.ExpenseReportsLinesListRequest; +import com.merge.api.accounting.types.ExpenseReportsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsListRequest; +import com.merge.api.accounting.types.ExpenseReportsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedExpenseReportLineList; +import com.merge.api.accounting.types.PaginatedExpenseReportList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawExpenseReportsClient { + protected final ClientOptions clientOptions; + + public AsyncRawExpenseReportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of ExpenseReport objects. + */ + public CompletableFuture>> list() { + return list(ExpenseReportsListRequest.builder().build()); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public CompletableFuture>> list( + ExpenseReportsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public CompletableFuture>> list( + ExpenseReportsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedExpenseReportList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedExpenseReportList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsListRequest nextRequest = ExpenseReportsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public CompletableFuture> create(ExpenseReportEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public CompletableFuture> create( + ExpenseReportEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExpenseReportResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public CompletableFuture>> linesList( + String expenseReportId) { + return linesList( + expenseReportId, ExpenseReportsLinesListRequest.builder().build()); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public CompletableFuture>> linesList( + String expenseReportId, ExpenseReportsLinesListRequest request) { + return linesList(expenseReportId, request, null); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public CompletableFuture>> linesList( + String expenseReportId, ExpenseReportsLinesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports") + .addPathSegment(expenseReportId) + .addPathSegments("lines"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedExpenseReportLineList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedExpenseReportLineList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsLinesListRequest nextRequest = ExpenseReportsLinesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return linesList(expenseReportId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ExpenseReportsRetrieveRequest.builder().build()); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public CompletableFuture> retrieve( + String id, ExpenseReportsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public CompletableFuture> retrieve( + String id, ExpenseReportsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExpenseReport.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsLinesRemoteFieldClassesListRequest nextRequest = + ExpenseReportsLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return linesRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsRemoteFieldClassesListRequest nextRequest = + ExpenseReportsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java index a7cb5375a..a136709e3 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java @@ -3,7 +3,11 @@ */ package com.merge.api.accounting; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseBulkRequest; import com.merge.api.accounting.types.ExpenseEndpointRequest; import com.merge.api.accounting.types.ExpenseResponse; import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; @@ -25,9 +29,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -161,9 +163,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedExpenseList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedExpenseList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedExpenseList.class); Optional startingAfter = parsedResponse.getNext(); ExpensesListRequest nextRequest = ExpensesListRequest.builder() .from(request) @@ -184,12 +187,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,12 +227,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -252,18 +250,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ExpenseResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExpenseResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -338,17 +334,134 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Expense.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates multiple Expense objects with the given values. + */ + public CompletableFuture> bulkCreate(ExpenseBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple Expense objects with the given values. + */ + public CompletableFuture> bulkCreate( + ExpenseBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Expense.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public CompletableFuture> bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public CompletableFuture> bulkRetrieve( + String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -440,9 +553,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); ExpensesLinesRemoteFieldClassesListRequest nextRequest = ExpensesLinesRemoteFieldClassesListRequest.builder() @@ -465,12 +579,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -515,18 +626,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -618,9 +726,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); ExpensesRemoteFieldClassesListRequest nextRequest = ExpensesRemoteFieldClassesListRequest.builder() @@ -643,12 +752,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java index a873b31ca..98a4d8926 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.accounting; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.accounting.types.CreateFieldMappingRequest; import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; @@ -21,8 +20,6 @@ import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -87,19 +84,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + responseBodyString, FieldMappingApiInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -137,17 +132,17 @@ public CompletableFuture> fie request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -167,19 +162,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,19 +220,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -276,25 +267,31 @@ public CompletableFuture> fie */ public CompletableFuture> fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -304,19 +301,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,19 +375,16 @@ public CompletableFuture> remoteFie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -438,19 +430,17 @@ public CompletableFuture> t @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + responseBodyString, ExternalTargetFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/accounting/AsyncRawForceResyncClient.java index e2576117c..aed5a78f5 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawForceResyncClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawForceResyncClient.java @@ -63,19 +63,17 @@ public CompletableFuture>> syncStatusResyn @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java index 45f7d2f92..f01ece0d9 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java @@ -139,9 +139,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); GeneralLedgerTransactionsListRequest nextRequest = GeneralLedgerTransactionsListRequest.builder() @@ -164,12 +165,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -238,19 +236,16 @@ public CompletableFuture> retriev @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), GeneralLedgerTransaction.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GeneralLedgerTransaction.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/accounting/AsyncRawGenerateKeyClient.java index b6d70b6be..7cfbda1e6 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawGenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java index 901856583..032fb3850 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java @@ -130,9 +130,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); IncomeStatementsListRequest nextRequest = IncomeStatementsListRequest.builder() .from(request) @@ -154,12 +155,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -228,18 +226,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), IncomeStatement.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, IncomeStatement.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java index a58033264..447a28f37 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java @@ -3,7 +3,11 @@ */ package com.merge.api.accounting; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceBulkRequest; import com.merge.api.accounting.types.InvoiceEndpointRequest; import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; @@ -26,9 +30,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -180,9 +182,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedInvoiceList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedInvoiceList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedInvoiceList.class); Optional startingAfter = parsedResponse.getNext(); InvoicesListRequest nextRequest = InvoicesListRequest.builder() .from(request) @@ -203,12 +206,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -248,12 +248,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -273,18 +271,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, InvoiceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -367,17 +363,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Invoice.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Invoice.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -417,12 +411,10 @@ public CompletableFuture> partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -442,18 +434,135 @@ public CompletableFuture> partialUpdate( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, InvoiceResponse.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates multiple Invoice objects with the given values. + */ + public CompletableFuture> bulkCreate(InvoiceBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple Invoice objects with the given values. + */ + public CompletableFuture> bulkCreate( + InvoiceBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public CompletableFuture> bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public CompletableFuture> bulkRetrieve( + String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -547,9 +656,10 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedRemoteFieldClassList.class); + responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); InvoicesLineItemsRemoteFieldClassesListRequest nextRequest = InvoicesLineItemsRemoteFieldClassesListRequest.builder() @@ -572,12 +682,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -624,18 +731,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -680,18 +784,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -783,9 +884,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); InvoicesRemoteFieldClassesListRequest nextRequest = InvoicesRemoteFieldClassesListRequest.builder() @@ -808,12 +910,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java index 425fdf966..a03918b65 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java @@ -145,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -167,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,17 +216,15 @@ public CompletableFuture> retrieve(String id, Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawItemFulfillmentsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawItemFulfillmentsClient.java new file mode 100644 index 000000000..e083ef6ab --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawItemFulfillmentsClient.java @@ -0,0 +1,755 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.ItemFulfillment; +import com.merge.api.accounting.types.ItemFulfillmentBulkRequest; +import com.merge.api.accounting.types.ItemFulfillmentEndpointRequest; +import com.merge.api.accounting.types.ItemFulfillmentResponse; +import com.merge.api.accounting.types.ItemFulfillmentsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedItemFulfillmentList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawItemFulfillmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawItemFulfillmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public CompletableFuture>> list() { + return list(ItemFulfillmentsListRequest.builder().build()); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public CompletableFuture>> list( + ItemFulfillmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public CompletableFuture>> list( + ItemFulfillmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedItemFulfillmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedItemFulfillmentList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemFulfillmentsListRequest nextRequest = ItemFulfillmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public CompletableFuture> create( + ItemFulfillmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public CompletableFuture> create( + ItemFulfillmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemFulfillmentResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ItemFulfillmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public CompletableFuture> retrieve( + String id, ItemFulfillmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public CompletableFuture> retrieve( + String id, ItemFulfillmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemFulfillment.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public CompletableFuture> bulkCreate( + ItemFulfillmentBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public CompletableFuture> bulkCreate( + ItemFulfillmentBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public CompletableFuture> bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public CompletableFuture> bulkRetrieve( + String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemFulfillmentsLinesRemoteFieldClassesListRequest nextRequest = + ItemFulfillmentsLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return linesRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemFulfillmentsRemoteFieldClassesListRequest nextRequest = + ItemFulfillmentsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java index f9d7934ce..038d70e37 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java @@ -22,9 +22,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -110,6 +108,10 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "modified_before", request.getModifiedBefore().get(), false); } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); @@ -145,9 +147,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedItemList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedItemList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedItemList.class); Optional startingAfter = parsedResponse.getNext(); ItemsListRequest nextRequest = ItemsListRequest.builder() .from(request) @@ -167,12 +170,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -210,12 +210,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -235,18 +233,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ItemResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -322,17 +317,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Item.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Item.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -372,12 +365,10 @@ public CompletableFuture> partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -397,18 +388,15 @@ public CompletableFuture> partialUpdate( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ItemResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -455,18 +443,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -511,18 +496,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java index 9687e9388..716805cbf 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java @@ -25,9 +25,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -162,9 +160,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedJournalEntryList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedJournalEntryList.class); + responseBodyString, PaginatedJournalEntryList.class); Optional startingAfter = parsedResponse.getNext(); JournalEntriesListRequest nextRequest = JournalEntriesListRequest.builder() .from(request) @@ -185,12 +184,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -228,12 +224,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -253,18 +247,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntryResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JournalEntryResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -340,18 +332,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntry.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JournalEntry.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -443,9 +432,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); JournalEntriesLinesRemoteFieldClassesListRequest nextRequest = JournalEntriesLinesRemoteFieldClassesListRequest.builder() @@ -468,12 +458,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -518,18 +505,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -621,9 +605,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); JournalEntriesRemoteFieldClassesListRequest nextRequest = JournalEntriesRemoteFieldClassesListRequest.builder() @@ -646,12 +631,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java index 18417db65..1ba960743 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java @@ -34,14 +34,14 @@ public AsyncRawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create( EndUserDetailsRequest request, RequestOptions requestOptions) { @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java index 5dc571861..0bb060275 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java @@ -138,9 +138,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -162,12 +163,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPassthroughClient.java index 02c8a827e..03fef8db0 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPassthroughClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPassthroughClient.java @@ -72,18 +72,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java index 462cf91f6..a3b6331bb 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java @@ -102,9 +102,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPaymentMethodList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedPaymentMethodList.class); + responseBodyString, PaginatedPaymentMethodList.class); Optional startingAfter = parsedResponse.getNext(); PaymentMethodsListRequest nextRequest = PaymentMethodsListRequest.builder() .from(request) @@ -125,12 +126,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -195,18 +193,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentMethod.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentMethod.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java index 5b150f6c6..1af1a1e4b 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java @@ -106,9 +106,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedPaymentTermList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedPaymentTermList.class); + PaginatedPaymentTermList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentTermList.class); Optional startingAfter = parsedResponse.getNext(); PaymentTermsListRequest nextRequest = PaymentTermsListRequest.builder() .from(request) @@ -129,12 +130,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -203,18 +201,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentTerm.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentTerm.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java index 68efcb630..ed5e7b039 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java @@ -26,9 +26,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -170,9 +168,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPaymentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentList.class); Optional startingAfter = parsedResponse.getNext(); PaymentsListRequest nextRequest = PaymentsListRequest.builder() .from(request) @@ -193,12 +192,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -236,12 +232,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -261,18 +255,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -347,17 +339,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Payment.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Payment.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -397,12 +387,10 @@ public CompletableFuture> partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -422,18 +410,16 @@ public CompletableFuture> partialUpdate( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -527,9 +513,10 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedRemoteFieldClassList.class); + responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); PaymentsLineItemsRemoteFieldClassesListRequest nextRequest = PaymentsLineItemsRemoteFieldClassesListRequest.builder() @@ -552,12 +539,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -604,18 +588,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -660,18 +641,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -763,9 +741,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); PaymentsRemoteFieldClassesListRequest nextRequest = PaymentsRemoteFieldClassesListRequest.builder() @@ -788,12 +767,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPhoneNumbersClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPhoneNumbersClient.java index a14059b24..3ca386168 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPhoneNumbersClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPhoneNumbersClient.java @@ -81,18 +81,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPhoneNumber.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountingPhoneNumber.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawProjectsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawProjectsClient.java index 9d5514d9b..675010dae 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawProjectsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawProjectsClient.java @@ -14,8 +14,13 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; import okhttp3.Call; import okhttp3.Callback; import okhttp3.Headers; @@ -36,25 +41,37 @@ public AsyncRawProjectsClient(ClientOptions clientOptions) { /** * Returns a list of Project objects. */ - public CompletableFuture> list() { + public CompletableFuture>> list() { return list(ProjectsListRequest.builder().build()); } /** * Returns a list of Project objects. */ - public CompletableFuture> list(ProjectsListRequest request) { + public CompletableFuture>> list(ProjectsListRequest request) { return list(request, null); } /** * Returns a list of Project objects. */ - public CompletableFuture> list( + public CompletableFuture>> list( ProjectsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/projects"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -77,10 +94,26 @@ public CompletableFuture> list( QueryStringMapper.addQueryParameter( httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); } + if (request.getIsActive().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_active", request.getIsActive().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -95,23 +128,38 @@ public CompletableFuture> list( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { + PaginatedProjectList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class); + Optional startingAfter = parsedResponse.getNext(); + ProjectsListRequest nextRequest = ProjectsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class), + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -179,17 +227,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Project.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Project.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java b/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java index 717f741e6..0a32a0f11 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java @@ -25,9 +25,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -164,9 +162,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPurchaseOrderList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedPurchaseOrderList.class); + responseBodyString, PaginatedPurchaseOrderList.class); Optional startingAfter = parsedResponse.getNext(); PurchaseOrdersListRequest nextRequest = PurchaseOrdersListRequest.builder() .from(request) @@ -187,12 +186,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -230,12 +226,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -255,18 +249,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrderResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PurchaseOrderResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -350,18 +342,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrder.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PurchaseOrder.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -455,9 +445,10 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedRemoteFieldClassList.class); + responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); PurchaseOrdersLineItemsRemoteFieldClassesListRequest nextRequest = PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder() @@ -480,12 +471,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -530,18 +518,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -633,9 +618,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); PurchaseOrdersRemoteFieldClassesListRequest nextRequest = PurchaseOrdersRemoteFieldClassesListRequest.builder() @@ -658,12 +644,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/accounting/AsyncRawRegenerateKeyClient.java index e416d992f..a9c297033 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawRegenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawSalesOrdersClient.java b/src/main/java/com/merge/api/accounting/AsyncRawSalesOrdersClient.java new file mode 100644 index 000000000..2197144a9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncRawSalesOrdersClient.java @@ -0,0 +1,782 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PaginatedSalesOrderList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.accounting.types.SalesOrder; +import com.merge.api.accounting.types.SalesOrderBulkRequest; +import com.merge.api.accounting.types.SalesOrderEndpointRequest; +import com.merge.api.accounting.types.SalesOrderResponse; +import com.merge.api.accounting.types.SalesOrdersLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersListRequest; +import com.merge.api.accounting.types.SalesOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSalesOrdersClient { + protected final ClientOptions clientOptions; + + public AsyncRawSalesOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of SalesOrder objects. + */ + public CompletableFuture>> list() { + return list(SalesOrdersListRequest.builder().build()); + } + + /** + * Returns a list of SalesOrder objects. + */ + public CompletableFuture>> list( + SalesOrdersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of SalesOrder objects. + */ + public CompletableFuture>> list( + SalesOrdersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIssueDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "issue_date_after", request.getIssueDateAfter().get(), false); + } + if (request.getIssueDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "issue_date_before", request.getIssueDateBefore().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedSalesOrderList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSalesOrderList.class); + Optional startingAfter = parsedResponse.getNext(); + SalesOrdersListRequest nextRequest = SalesOrdersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a SalesOrder object with the given values. + */ + public CompletableFuture> create(SalesOrderEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a SalesOrder object with the given values. + */ + public CompletableFuture> create( + SalesOrderEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SalesOrderResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a SalesOrder object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, SalesOrdersRetrieveRequest.builder().build()); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public CompletableFuture> retrieve(String id, SalesOrdersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public CompletableFuture> retrieve( + String id, SalesOrdersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SalesOrder.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public CompletableFuture> bulkCreate(SalesOrderBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public CompletableFuture> bulkCreate( + SalesOrderBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public CompletableFuture> bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public CompletableFuture> bulkRetrieve( + String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + SalesOrdersLinesRemoteFieldClassesListRequest nextRequest = + SalesOrdersLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return linesRemoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public CompletableFuture> metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList() { + return remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture>> remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + SalesOrdersRemoteFieldClassesListRequest nextRequest = + SalesOrdersRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return remoteFieldClassesList(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncRawScopesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawScopesClient.java index ee3a59fe2..496b5e5b8 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawScopesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawScopesClient.java @@ -64,18 +64,16 @@ public CompletableFuture> defaultScope @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -121,18 +119,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -187,18 +183,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java index 9eeeac6a1..cfdff1456 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java @@ -82,9 +82,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedSyncStatusList.class); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -105,12 +106,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java index b6f169e8a..1b5295c29 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java @@ -133,9 +133,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTaxRateList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaxRateList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaxRateList.class); Optional startingAfter = parsedResponse.getNext(); TaxRatesListRequest nextRequest = TaxRatesListRequest.builder() .from(request) @@ -156,12 +157,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -229,17 +227,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaxRate.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TaxRate.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java index bcc6c1202..444385f08 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java @@ -151,9 +151,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); TrackingCategoriesListRequest nextRequest = TrackingCategoriesListRequest.builder() .from(request) @@ -175,12 +176,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -257,18 +255,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TrackingCategory.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TrackingCategory.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java index 989497df2..a3963ad4f 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java @@ -144,9 +144,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedTransactionList.class); + PaginatedTransactionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTransactionList.class); Optional startingAfter = parsedResponse.getNext(); TransactionsListRequest nextRequest = TransactionsListRequest.builder() .from(request) @@ -167,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -241,18 +239,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Transaction.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Transaction.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java index e8c3921e9..5e4a905f0 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java @@ -3,8 +3,10 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyVendorCreditRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedVendorCreditList; +import com.merge.api.accounting.types.PatchedVendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCredit; import com.merge.api.accounting.types.VendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCreditResponse; @@ -21,9 +23,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -151,9 +151,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedVendorCreditList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedVendorCreditList.class); + responseBodyString, PaginatedVendorCreditList.class); Optional startingAfter = parsedResponse.getNext(); VendorCreditsListRequest nextRequest = VendorCreditsListRequest.builder() .from(request) @@ -174,12 +175,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -217,12 +215,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -242,18 +238,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCreditResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCreditResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -322,18 +316,215 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCredit.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Updates a VendorCredit object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedVendorCreditEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a VendorCredit object with the given id. + */ + public CompletableFuture> partialUpdate( + String id, PatchedVendorCreditEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCreditResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public CompletableFuture> applicationCreate( + String id, ApplyVendorCreditRequest request) { + return applicationCreate(id, request, null); + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public CompletableFuture> applicationCreate( + String id, ApplyVendorCreditRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits") + .addPathSegment(id) + .addPathSegments("application"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCredit.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCreditResponse.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public CompletableFuture> metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -378,18 +569,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/accounting/AsyncRawWebhookReceiversClient.java index 587d0de91..94c387861 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawWebhookReceiversClient.java @@ -65,19 +65,17 @@ public CompletableFuture>> list(Reque @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -131,18 +129,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/accounting/AsyncSalesOrdersClient.java b/src/main/java/com/merge/api/accounting/AsyncSalesOrdersClient.java new file mode 100644 index 000000000..3ab7ae45a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/AsyncSalesOrdersClient.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.accounting.types.SalesOrder; +import com.merge.api.accounting.types.SalesOrderBulkRequest; +import com.merge.api.accounting.types.SalesOrderEndpointRequest; +import com.merge.api.accounting.types.SalesOrderResponse; +import com.merge.api.accounting.types.SalesOrdersLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersListRequest; +import com.merge.api.accounting.types.SalesOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncSalesOrdersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSalesOrdersClient rawClient; + + public AsyncSalesOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSalesOrdersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSalesOrdersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of SalesOrder objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of SalesOrder objects. + */ + public CompletableFuture> list(SalesOrdersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of SalesOrder objects. + */ + public CompletableFuture> list( + SalesOrdersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a SalesOrder object with the given values. + */ + public CompletableFuture create(SalesOrderEndpointRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a SalesOrder object with the given values. + */ + public CompletableFuture create( + SalesOrderEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public CompletableFuture retrieve(String id, SalesOrdersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public CompletableFuture retrieve( + String id, SalesOrdersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public CompletableFuture bulkCreate(SalesOrderBulkRequest request) { + return this.rawClient.bulkCreate(request).thenApply(response -> response.body()); + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public CompletableFuture bulkCreate( + SalesOrderBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).thenApply(response -> response.body()); + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public CompletableFuture bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public CompletableFuture metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public CompletableFuture metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public CompletableFuture> remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/accounting/AsyncVendorCreditsClient.java b/src/main/java/com/merge/api/accounting/AsyncVendorCreditsClient.java index ecaf6f9b6..a0ac1756f 100644 --- a/src/main/java/com/merge/api/accounting/AsyncVendorCreditsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncVendorCreditsClient.java @@ -3,7 +3,9 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyVendorCreditRequest; import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedVendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCredit; import com.merge.api.accounting.types.VendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCreditResponse; @@ -90,6 +92,51 @@ public CompletableFuture retrieve( return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } + /** + * Updates a VendorCredit object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedVendorCreditEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).thenApply(response -> response.body()); + } + + /** + * Updates a VendorCredit object with the given id. + */ + public CompletableFuture partialUpdate( + String id, PatchedVendorCreditEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public CompletableFuture applicationCreate(String id, ApplyVendorCreditRequest request) { + return this.rawClient.applicationCreate(id, request).thenApply(response -> response.body()); + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public CompletableFuture applicationCreate( + String id, ApplyVendorCreditRequest request, RequestOptions requestOptions) { + return this.rawClient.applicationCreate(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + } + /** * Returns metadata for VendorCredit POSTs. */ diff --git a/src/main/java/com/merge/api/accounting/ContactsClient.java b/src/main/java/com/merge/api/accounting/ContactsClient.java index 57b792a48..b8934b302 100644 --- a/src/main/java/com/merge/api/accounting/ContactsClient.java +++ b/src/main/java/com/merge/api/accounting/ContactsClient.java @@ -10,6 +10,7 @@ import com.merge.api.accounting.types.ContactsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.ContactsRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedContactEndpointRequest; import com.merge.api.accounting.types.RemoteFieldClass; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; @@ -88,6 +89,35 @@ public Contact retrieve(String id, ContactsRetrieveRequest request, RequestOptio return this.rawClient.retrieve(id, request, requestOptions).body(); } + /** + * Updates a Contact object with the given id. + */ + public ContactResponse partialUpdate(String id, PatchedContactEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a Contact object with the given id. + */ + public ContactResponse partialUpdate( + String id, PatchedContactEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for Contact PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for Contact PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + /** * Returns metadata for Contact POSTs. */ diff --git a/src/main/java/com/merge/api/accounting/CreditNotesClient.java b/src/main/java/com/merge/api/accounting/CreditNotesClient.java index 55faeb234..69cba3b37 100644 --- a/src/main/java/com/merge/api/accounting/CreditNotesClient.java +++ b/src/main/java/com/merge/api/accounting/CreditNotesClient.java @@ -3,12 +3,14 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyCreditNoteRequest; import com.merge.api.accounting.types.CreditNote; import com.merge.api.accounting.types.CreditNoteEndpointRequest; import com.merge.api.accounting.types.CreditNoteResponse; import com.merge.api.accounting.types.CreditNotesListRequest; import com.merge.api.accounting.types.CreditNotesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedCreditNoteEndpointRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; @@ -86,6 +88,50 @@ public CreditNote retrieve(String id, CreditNotesRetrieveRequest request, Reques return this.rawClient.retrieve(id, request, requestOptions).body(); } + /** + * Updates a CreditNote object with the given id. + */ + public CreditNoteResponse partialUpdate(String id, PatchedCreditNoteEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a CreditNote object with the given id. + */ + public CreditNoteResponse partialUpdate( + String id, PatchedCreditNoteEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public CreditNoteResponse applicationCreate(String id, ApplyCreditNoteRequest request) { + return this.rawClient.applicationCreate(id, request).body(); + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public CreditNoteResponse applicationCreate( + String id, ApplyCreditNoteRequest request, RequestOptions requestOptions) { + return this.rawClient.applicationCreate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + /** * Returns metadata for CreditNote POSTs. */ diff --git a/src/main/java/com/merge/api/accounting/ExpenseReportsClient.java b/src/main/java/com/merge/api/accounting/ExpenseReportsClient.java new file mode 100644 index 000000000..4ae456540 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/ExpenseReportsClient.java @@ -0,0 +1,180 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.ExpenseReport; +import com.merge.api.accounting.types.ExpenseReportEndpointRequest; +import com.merge.api.accounting.types.ExpenseReportLine; +import com.merge.api.accounting.types.ExpenseReportResponse; +import com.merge.api.accounting.types.ExpenseReportsLinesListRequest; +import com.merge.api.accounting.types.ExpenseReportsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsListRequest; +import com.merge.api.accounting.types.ExpenseReportsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ExpenseReportsClient { + protected final ClientOptions clientOptions; + + private final RawExpenseReportsClient rawClient; + + public ExpenseReportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawExpenseReportsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawExpenseReportsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of ExpenseReport objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public SyncPagingIterable list(ExpenseReportsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public SyncPagingIterable list(ExpenseReportsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public ExpenseReportResponse create(ExpenseReportEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public ExpenseReportResponse create(ExpenseReportEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public SyncPagingIterable linesList(String expenseReportId) { + return this.rawClient.linesList(expenseReportId).body(); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public SyncPagingIterable linesList( + String expenseReportId, ExpenseReportsLinesListRequest request) { + return this.rawClient.linesList(expenseReportId, request).body(); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public SyncPagingIterable linesList( + String expenseReportId, ExpenseReportsLinesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesList(expenseReportId, request, requestOptions) + .body(); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public ExpenseReport retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public ExpenseReport retrieve(String id, ExpenseReportsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public ExpenseReport retrieve(String id, ExpenseReportsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/ExpensesClient.java b/src/main/java/com/merge/api/accounting/ExpensesClient.java index 439cef7a0..d0c5fdd8c 100644 --- a/src/main/java/com/merge/api/accounting/ExpensesClient.java +++ b/src/main/java/com/merge/api/accounting/ExpensesClient.java @@ -3,7 +3,10 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseBulkRequest; import com.merge.api.accounting.types.ExpenseEndpointRequest; import com.merge.api.accounting.types.ExpenseResponse; import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; @@ -89,6 +92,34 @@ public Expense retrieve(String id, ExpensesRetrieveRequest request, RequestOptio return this.rawClient.retrieve(id, request, requestOptions).body(); } + /** + * Creates multiple Expense objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(ExpenseBulkRequest request) { + return this.rawClient.bulkCreate(request).body(); + } + + /** + * Creates multiple Expense objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(ExpenseBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).body(); + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).body(); + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).body(); + } + /** * Returns a list of RemoteFieldClass objects. */ diff --git a/src/main/java/com/merge/api/accounting/InvoicesClient.java b/src/main/java/com/merge/api/accounting/InvoicesClient.java index 92d062d6c..d42fd4f43 100644 --- a/src/main/java/com/merge/api/accounting/InvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/InvoicesClient.java @@ -3,7 +3,10 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceBulkRequest; import com.merge.api.accounting.types.InvoiceEndpointRequest; import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; @@ -107,6 +110,34 @@ public InvoiceResponse partialUpdate( return this.rawClient.partialUpdate(id, request, requestOptions).body(); } + /** + * Creates multiple Invoice objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(InvoiceBulkRequest request) { + return this.rawClient.bulkCreate(request).body(); + } + + /** + * Creates multiple Invoice objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(InvoiceBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).body(); + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).body(); + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).body(); + } + /** * Returns a list of RemoteFieldClass objects. */ diff --git a/src/main/java/com/merge/api/accounting/ItemFulfillmentsClient.java b/src/main/java/com/merge/api/accounting/ItemFulfillmentsClient.java new file mode 100644 index 000000000..738833ecc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/ItemFulfillmentsClient.java @@ -0,0 +1,185 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.ItemFulfillment; +import com.merge.api.accounting.types.ItemFulfillmentBulkRequest; +import com.merge.api.accounting.types.ItemFulfillmentEndpointRequest; +import com.merge.api.accounting.types.ItemFulfillmentResponse; +import com.merge.api.accounting.types.ItemFulfillmentsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ItemFulfillmentsClient { + protected final ClientOptions clientOptions; + + private final RawItemFulfillmentsClient rawClient; + + public ItemFulfillmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawItemFulfillmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawItemFulfillmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public SyncPagingIterable list(ItemFulfillmentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public SyncPagingIterable list( + ItemFulfillmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public ItemFulfillmentResponse create(ItemFulfillmentEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public ItemFulfillmentResponse create(ItemFulfillmentEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public ItemFulfillment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public ItemFulfillment retrieve(String id, ItemFulfillmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public ItemFulfillment retrieve(String id, ItemFulfillmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(ItemFulfillmentBulkRequest request) { + return this.rawClient.bulkCreate(request).body(); + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(ItemFulfillmentBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).body(); + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).body(); + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/LinkTokenClient.java b/src/main/java/com/merge/api/accounting/LinkTokenClient.java index 965e9e733..7bc24637c 100644 --- a/src/main/java/com/merge/api/accounting/LinkTokenClient.java +++ b/src/main/java/com/merge/api/accounting/LinkTokenClient.java @@ -26,14 +26,14 @@ public RawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request) { return this.rawClient.create(request).body(); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); diff --git a/src/main/java/com/merge/api/accounting/ProjectsClient.java b/src/main/java/com/merge/api/accounting/ProjectsClient.java index ca971d1cb..808fe6807 100644 --- a/src/main/java/com/merge/api/accounting/ProjectsClient.java +++ b/src/main/java/com/merge/api/accounting/ProjectsClient.java @@ -3,12 +3,12 @@ */ package com.merge.api.accounting; -import com.merge.api.accounting.types.PaginatedProjectList; import com.merge.api.accounting.types.Project; import com.merge.api.accounting.types.ProjectsListRequest; import com.merge.api.accounting.types.ProjectsRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; public class ProjectsClient { protected final ClientOptions clientOptions; @@ -30,21 +30,21 @@ public RawProjectsClient withRawResponse() { /** * Returns a list of Project objects. */ - public PaginatedProjectList list() { + public SyncPagingIterable list() { return this.rawClient.list().body(); } /** * Returns a list of Project objects. */ - public PaginatedProjectList list(ProjectsListRequest request) { + public SyncPagingIterable list(ProjectsListRequest request) { return this.rawClient.list(request).body(); } /** * Returns a list of Project objects. */ - public PaginatedProjectList list(ProjectsListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(ProjectsListRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } diff --git a/src/main/java/com/merge/api/accounting/RawAccountDetailsClient.java b/src/main/java/com/merge/api/accounting/RawAccountDetailsClient.java index 5ad592d7a..0a890b5e6 100644 --- a/src/main/java/com/merge/api/accounting/RawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAccountDetailsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOptio } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAccountTokenClient.java b/src/main/java/com/merge/api/accounting/RawAccountTokenClient.java index 7dded342b..a689c1b2b 100644 --- a/src/main/java/com/merge/api/accounting/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/accounting/RawAccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AccountToken; +import com.merge.api.accounting.types.RegenerateAccountToken; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -15,6 +16,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; @@ -53,16 +55,53 @@ public MergeApiHttpResponse retrieve(String publicToken, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java b/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java index 08c269138..638793c66 100644 --- a/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java @@ -93,9 +93,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountingPeriodList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountingPeriodList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountingPeriodList.class); Optional startingAfter = parsedResponse.getNext(); AccountingPeriodsListRequest nextRequest = AccountingPeriodsListRequest.builder() .from(request) @@ -109,12 +110,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -166,16 +163,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPeriod.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountingPeriod.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAccountsClient.java b/src/main/java/com/merge/api/accounting/RawAccountsClient.java index c700c8e6b..6a48d30c2 100644 --- a/src/main/java/com/merge/api/accounting/RawAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAccountsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -152,9 +150,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); Optional startingAfter = parsedResponse.getNext(); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) @@ -167,12 +166,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -200,12 +195,10 @@ public MergeApiHttpResponse create(AccountEndpointRequest reque QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -222,16 +215,13 @@ public MergeApiHttpResponse create(AccountEndpointRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -295,16 +285,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -337,16 +324,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAddressesClient.java b/src/main/java/com/merge/api/accounting/RawAddressesClient.java index 429833e3c..abd177d0f 100644 --- a/src/main/java/com/merge/api/accounting/RawAddressesClient.java +++ b/src/main/java/com/merge/api/accounting/RawAddressesClient.java @@ -81,16 +81,13 @@ public MergeApiHttpResponse
retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Address.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Address.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java index 1ffe54009..1be7d63fa 100644 --- a/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java @@ -66,17 +66,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -111,18 +108,14 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java b/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java index 9ce1438cb..68efa0f62 100644 --- a/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java +++ b/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java @@ -53,16 +53,13 @@ public MergeApiHttpResponse retrieve(String id, RequestOptions re } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPostTask.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPostTask.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java b/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java index 95c6eb727..5e3fc4beb 100644 --- a/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -124,9 +122,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountingAttachmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAccountingAttachmentList.class); + responseBodyString, PaginatedAccountingAttachmentList.class); Optional startingAfter = parsedResponse.getNext(); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) @@ -140,12 +139,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -174,12 +169,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -196,17 +189,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingAttachmentResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountingAttachmentResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -258,17 +248,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingAttachment.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountingAttachment.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -301,16 +287,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java b/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java index bbbb6d837..624c49aee 100644 --- a/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java @@ -90,9 +90,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -106,12 +107,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawAvailableActionsClient.java b/src/main/java/com/merge/api/accounting/RawAvailableActionsClient.java index d8274f2bf..40745a8ff 100644 --- a/src/main/java/com/merge/api/accounting/RawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAvailableActionsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java b/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java index e83b623c9..6c7c1dfee 100644 --- a/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java +++ b/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java @@ -121,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedBalanceSheetList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBalanceSheetList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBalanceSheetList.class); Optional startingAfter = parsedResponse.getNext(); BalanceSheetsListRequest nextRequest = BalanceSheetsListRequest.builder() .from(request) @@ -137,12 +138,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,16 +195,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BalanceSheet.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BalanceSheet.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java b/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java index e4b49fdd2..e6e16a685 100644 --- a/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -100,9 +98,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedBankFeedAccountList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBankFeedAccountList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankFeedAccountList.class); Optional startingAfter = parsedResponse.getNext(); BankFeedAccountsListRequest nextRequest = BankFeedAccountsListRequest.builder() .from(request) @@ -116,12 +115,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -150,12 +145,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -172,17 +165,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedAccountResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankFeedAccountResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -234,16 +224,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedAccount.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankFeedAccount.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -276,16 +263,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java b/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java index 5047c6487..9757eaf98 100644 --- a/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -128,9 +126,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedBankFeedTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedBankFeedTransactionList.class); + PaginatedBankFeedTransactionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankFeedTransactionList.class); Optional startingAfter = parsedResponse.getNext(); BankFeedTransactionsListRequest nextRequest = BankFeedTransactionsListRequest.builder() .from(request) @@ -144,12 +143,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -178,12 +173,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -200,17 +193,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedTransactionResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankFeedTransactionResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -266,17 +256,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankFeedTransaction.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankFeedTransaction.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -309,16 +295,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java b/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java index 34cdc0093..5c213cabd 100644 --- a/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java @@ -121,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedCashFlowStatementList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedCashFlowStatementList.class); + PaginatedCashFlowStatementList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCashFlowStatementList.class); Optional startingAfter = parsedResponse.getNext(); CashFlowStatementsListRequest nextRequest = CashFlowStatementsListRequest.builder() .from(request) @@ -137,12 +138,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,16 +195,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CashFlowStatement.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CashFlowStatement.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java b/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java index 78dc80cda..c8c2db1b0 100644 --- a/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java +++ b/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java @@ -93,6 +93,10 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "modified_before", request.getModifiedBefore().get(), false); } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); @@ -117,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCompanyInfoList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCompanyInfoList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyInfoList.class); Optional startingAfter = parsedResponse.getNext(); CompanyInfoListRequest nextRequest = CompanyInfoListRequest.builder() .from(request) @@ -133,12 +138,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -194,16 +195,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CompanyInfo.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CompanyInfo.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawContactsClient.java b/src/main/java/com/merge/api/accounting/RawContactsClient.java index 1d273fd3e..fb5dd8fd9 100644 --- a/src/main/java/com/merge/api/accounting/RawContactsClient.java +++ b/src/main/java/com/merge/api/accounting/RawContactsClient.java @@ -12,6 +12,7 @@ import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedContactList; import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PatchedContactEndpointRequest; import com.merge.api.accounting.types.RemoteFieldClass; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; @@ -24,9 +25,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -166,9 +165,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedContactList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); Optional startingAfter = parsedResponse.getNext(); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) @@ -181,12 +181,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -214,12 +210,10 @@ public MergeApiHttpResponse create(ContactEndpointRequest reque QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -236,16 +230,13 @@ public MergeApiHttpResponse create(ContactEndpointRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ContactResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ContactResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -316,16 +307,109 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Contact.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a Contact object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedContactEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a Contact object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedContactEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/contacts") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ContactResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for Contact PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for Contact PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/contacts/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -358,16 +442,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -446,9 +527,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() .from(request) @@ -462,12 +544,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java b/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java index a5dda9f34..90d323100 100644 --- a/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java +++ b/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java @@ -3,6 +3,7 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyCreditNoteRequest; import com.merge.api.accounting.types.CreditNote; import com.merge.api.accounting.types.CreditNoteEndpointRequest; import com.merge.api.accounting.types.CreditNoteResponse; @@ -10,6 +11,7 @@ import com.merge.api.accounting.types.CreditNotesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedCreditNoteList; +import com.merge.api.accounting.types.PatchedCreditNoteEndpointRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,9 +23,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -150,9 +150,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCreditNoteList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCreditNoteList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCreditNoteList.class); Optional startingAfter = parsedResponse.getNext(); CreditNotesListRequest nextRequest = CreditNotesListRequest.builder() .from(request) @@ -166,12 +167,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -200,12 +197,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -222,16 +217,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -295,16 +287,166 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNote.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a CreditNote object with the given id. + */ + public MergeApiHttpResponse partialUpdate(String id, PatchedCreditNoteEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a CreditNote object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedCreditNoteEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNoteResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public MergeApiHttpResponse applicationCreate(String id, ApplyCreditNoteRequest request) { + return applicationCreate(id, request, null); + } + + /** + * Creates a new CreditNoteApplyLine to apply a credit note to an invoice + */ + public MergeApiHttpResponse applicationCreate( + String id, ApplyCreditNoteRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes") + .addPathSegment(id) + .addPathSegments("application"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CreditNote.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNoteResponse.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for CreditNote PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/credit-notes/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -337,16 +479,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawDeleteAccountClient.java b/src/main/java/com/merge/api/accounting/RawDeleteAccountClient.java index 79cd314e5..346d39e75 100644 --- a/src/main/java/com/merge/api/accounting/RawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/accounting/RawDeleteAccountClient.java @@ -55,11 +55,8 @@ public MergeApiHttpResponse delete(RequestOptions requestOptions) { return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawEmployeesClient.java b/src/main/java/com/merge/api/accounting/RawEmployeesClient.java index c4a2f287b..d063e13c8 100644 --- a/src/main/java/com/merge/api/accounting/RawEmployeesClient.java +++ b/src/main/java/com/merge/api/accounting/RawEmployeesClient.java @@ -55,6 +55,18 @@ public MergeApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/employees"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -77,10 +89,22 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -97,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEmployeeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); Optional startingAfter = parsedResponse.getNext(); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) @@ -112,12 +137,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -173,16 +194,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Employee.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawExpenseReportsClient.java b/src/main/java/com/merge/api/accounting/RawExpenseReportsClient.java new file mode 100644 index 000000000..d1f1f28fd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawExpenseReportsClient.java @@ -0,0 +1,624 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.ExpenseReport; +import com.merge.api.accounting.types.ExpenseReportEndpointRequest; +import com.merge.api.accounting.types.ExpenseReportLine; +import com.merge.api.accounting.types.ExpenseReportResponse; +import com.merge.api.accounting.types.ExpenseReportsLinesListRequest; +import com.merge.api.accounting.types.ExpenseReportsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsListRequest; +import com.merge.api.accounting.types.ExpenseReportsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ExpenseReportsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedExpenseReportLineList; +import com.merge.api.accounting.types.PaginatedExpenseReportList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawExpenseReportsClient { + protected final ClientOptions clientOptions; + + public RawExpenseReportsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of ExpenseReport objects. + */ + public MergeApiHttpResponse> list() { + return list(ExpenseReportsListRequest.builder().build()); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public MergeApiHttpResponse> list(ExpenseReportsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of ExpenseReport objects. + */ + public MergeApiHttpResponse> list( + ExpenseReportsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedExpenseReportList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedExpenseReportList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsListRequest nextRequest = ExpenseReportsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public MergeApiHttpResponse create(ExpenseReportEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an ExpenseReport object with the given values. + */ + public MergeApiHttpResponse create( + ExpenseReportEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExpenseReportResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public MergeApiHttpResponse> linesList(String expenseReportId) { + return linesList( + expenseReportId, ExpenseReportsLinesListRequest.builder().build()); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public MergeApiHttpResponse> linesList( + String expenseReportId, ExpenseReportsLinesListRequest request) { + return linesList(expenseReportId, request, null); + } + + /** + * Returns a list of ExpenseReportLine objects that point to a ExpenseReport with the given id. + */ + public MergeApiHttpResponse> linesList( + String expenseReportId, ExpenseReportsLinesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports") + .addPathSegment(expenseReportId) + .addPathSegments("lines"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedExpenseReportLineList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedExpenseReportLineList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsLinesListRequest nextRequest = ExpenseReportsLinesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> linesList( + expenseReportId, nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ExpenseReportsRetrieveRequest.builder().build()); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ExpenseReportsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an ExpenseReport object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ExpenseReportsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExpenseReport.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + ExpenseReportsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsLinesRemoteFieldClassesListRequest nextRequest = + ExpenseReportsLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> linesRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for ExpenseReport POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ExpenseReportsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expense-reports/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ExpenseReportsRemoteFieldClassesListRequest nextRequest = + ExpenseReportsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawExpensesClient.java b/src/main/java/com/merge/api/accounting/RawExpensesClient.java index e23eae6fb..fd6ba1d5a 100644 --- a/src/main/java/com/merge/api/accounting/RawExpensesClient.java +++ b/src/main/java/com/merge/api/accounting/RawExpensesClient.java @@ -3,7 +3,11 @@ */ package com.merge.api.accounting; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Expense; +import com.merge.api.accounting.types.ExpenseBulkRequest; import com.merge.api.accounting.types.ExpenseEndpointRequest; import com.merge.api.accounting.types.ExpenseResponse; import com.merge.api.accounting.types.ExpensesLinesRemoteFieldClassesListRequest; @@ -25,9 +29,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -153,9 +155,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedExpenseList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedExpenseList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedExpenseList.class); Optional startingAfter = parsedResponse.getNext(); ExpensesListRequest nextRequest = ExpensesListRequest.builder() .from(request) @@ -168,12 +171,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -201,12 +200,10 @@ public MergeApiHttpResponse create(ExpenseEndpointRequest reque QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -223,16 +220,13 @@ public MergeApiHttpResponse create(ExpenseEndpointRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ExpenseResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExpenseResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -295,16 +289,102 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Expense.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates multiple Expense objects with the given values. + */ + public MergeApiHttpResponse bulkCreate(ExpenseBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple Expense objects with the given values. + */ + public MergeApiHttpResponse bulkCreate( + ExpenseBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Expense.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of an Expense bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/expenses/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -383,9 +463,10 @@ public MergeApiHttpResponse> linesRemoteFie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); ExpensesLinesRemoteFieldClassesListRequest nextRequest = ExpensesLinesRemoteFieldClassesListRequest.builder() @@ -400,12 +481,8 @@ public MergeApiHttpResponse> linesRemoteFie .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -438,16 +515,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -526,9 +600,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); ExpensesRemoteFieldClassesListRequest nextRequest = ExpensesRemoteFieldClassesListRequest.builder() .from(request) @@ -542,12 +617,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java b/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java index 008716ff4..21fdd234e 100644 --- a/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.accounting; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.accounting.types.CreateFieldMappingRequest; import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; @@ -21,8 +20,6 @@ import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -80,18 +77,14 @@ public MergeApiHttpResponse fieldMappingsRetrie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -119,17 +112,17 @@ public MergeApiHttpResponse fieldMappingsCreate( request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -146,17 +139,14 @@ public MergeApiHttpResponse fieldMappingsCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,17 +181,14 @@ public MergeApiHttpResponse fieldMappingsDestroy( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -228,42 +215,45 @@ public MergeApiHttpResponse fieldMappingsPartialUp */ public MergeApiHttpResponse fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -314,17 +304,14 @@ public MergeApiHttpResponse remoteFieldsRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -357,18 +344,14 @@ public MergeApiHttpResponse targetFieldsRetrieve } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawForceResyncClient.java b/src/main/java/com/merge/api/accounting/RawForceResyncClient.java index fca1bd5ad..20f1f18a8 100644 --- a/src/main/java/com/merge/api/accounting/RawForceResyncClient.java +++ b/src/main/java/com/merge/api/accounting/RawForceResyncClient.java @@ -55,18 +55,15 @@ public MergeApiHttpResponse> syncStatusResyncCreate(RequestOpti } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java b/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java index 976c4fc1b..dcd92aa4b 100644 --- a/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java @@ -130,9 +130,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedGeneralLedgerTransactionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedGeneralLedgerTransactionList.class); + responseBodyString, PaginatedGeneralLedgerTransactionList.class); Optional startingAfter = parsedResponse.getNext(); GeneralLedgerTransactionsListRequest nextRequest = GeneralLedgerTransactionsListRequest.builder() .from(request) @@ -147,12 +148,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -209,17 +206,14 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), GeneralLedgerTransaction.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GeneralLedgerTransaction.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawGenerateKeyClient.java b/src/main/java/com/merge/api/accounting/RawGenerateKeyClient.java index badbd11f9..11896f7f1 100644 --- a/src/main/java/com/merge/api/accounting/RawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/accounting/RawGenerateKeyClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java b/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java index b02be95f5..3aef69bdd 100644 --- a/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java @@ -121,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIncomeStatementList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIncomeStatementList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIncomeStatementList.class); Optional startingAfter = parsedResponse.getNext(); IncomeStatementsListRequest nextRequest = IncomeStatementsListRequest.builder() .from(request) @@ -137,12 +138,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,16 +195,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), IncomeStatement.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, IncomeStatement.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawInvoicesClient.java b/src/main/java/com/merge/api/accounting/RawInvoicesClient.java index 53fb1ed32..10f4622eb 100644 --- a/src/main/java/com/merge/api/accounting/RawInvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/RawInvoicesClient.java @@ -3,7 +3,11 @@ */ package com.merge.api.accounting; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; import com.merge.api.accounting.types.Invoice; +import com.merge.api.accounting.types.InvoiceBulkRequest; import com.merge.api.accounting.types.InvoiceEndpointRequest; import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; @@ -26,9 +30,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -172,9 +174,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedInvoiceList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedInvoiceList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedInvoiceList.class); Optional startingAfter = parsedResponse.getNext(); InvoicesListRequest nextRequest = InvoicesListRequest.builder() .from(request) @@ -187,12 +190,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -222,12 +221,10 @@ public MergeApiHttpResponse create(InvoiceEndpointRequest reque QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -244,16 +241,13 @@ public MergeApiHttpResponse create(InvoiceEndpointRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, InvoiceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -324,16 +318,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Invoice.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Invoice.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -363,12 +354,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -385,16 +374,102 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, InvoiceResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates multiple Invoice objects with the given values. + */ + public MergeApiHttpResponse bulkCreate(InvoiceBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple Invoice objects with the given values. + */ + public MergeApiHttpResponse bulkCreate( + InvoiceBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), InvoiceResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of an Invoice bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/invoices/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -473,9 +548,10 @@ public MergeApiHttpResponse> lineItemsRemot } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); InvoicesLineItemsRemoteFieldClassesListRequest nextRequest = InvoicesLineItemsRemoteFieldClassesListRequest.builder() @@ -492,12 +568,8 @@ public MergeApiHttpResponse> lineItemsRemot .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -531,16 +603,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -573,16 +642,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -661,9 +727,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); InvoicesRemoteFieldClassesListRequest nextRequest = InvoicesRemoteFieldClassesListRequest.builder() .from(request) @@ -677,12 +744,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawIssuesClient.java b/src/main/java/com/merge/api/accounting/RawIssuesClient.java index dd539b014..0024d8c90 100644 --- a/src/main/java/com/merge/api/accounting/RawIssuesClient.java +++ b/src/main/java/com/merge/api/accounting/RawIssuesClient.java @@ -137,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -152,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,16 +188,13 @@ public MergeApiHttpResponse retrieve(String id, RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawItemFulfillmentsClient.java b/src/main/java/com/merge/api/accounting/RawItemFulfillmentsClient.java new file mode 100644 index 000000000..c2cdd33ab --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawItemFulfillmentsClient.java @@ -0,0 +1,608 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.ItemFulfillment; +import com.merge.api.accounting.types.ItemFulfillmentBulkRequest; +import com.merge.api.accounting.types.ItemFulfillmentEndpointRequest; +import com.merge.api.accounting.types.ItemFulfillmentResponse; +import com.merge.api.accounting.types.ItemFulfillmentsLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.ItemFulfillmentsRetrieveRequest; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedItemFulfillmentList; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawItemFulfillmentsClient { + protected final ClientOptions clientOptions; + + public RawItemFulfillmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public MergeApiHttpResponse> list() { + return list(ItemFulfillmentsListRequest.builder().build()); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public MergeApiHttpResponse> list(ItemFulfillmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of ItemFulfillment objects. + */ + public MergeApiHttpResponse> list( + ItemFulfillmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedItemFulfillmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedItemFulfillmentList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemFulfillmentsListRequest nextRequest = ItemFulfillmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public MergeApiHttpResponse create(ItemFulfillmentEndpointRequest request) { + return create(request, null); + } + + /** + * Creates an ItemFulfillment object with the given values. + */ + public MergeApiHttpResponse create( + ItemFulfillmentEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemFulfillmentResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ItemFulfillmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ItemFulfillmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an ItemFulfillment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ItemFulfillmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemFulfillment.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public MergeApiHttpResponse bulkCreate(ItemFulfillmentBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple ItemFulfillment objects with the given values. + */ + public MergeApiHttpResponse bulkCreate( + ItemFulfillmentBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of an ItemFulfillment bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + ItemFulfillmentsLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemFulfillmentsLinesRemoteFieldClassesListRequest nextRequest = + ItemFulfillmentsLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> linesRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for ItemFulfillment POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + ItemFulfillmentsRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/item-fulfillments/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + ItemFulfillmentsRemoteFieldClassesListRequest nextRequest = + ItemFulfillmentsRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawItemsClient.java b/src/main/java/com/merge/api/accounting/RawItemsClient.java index 4d1d34d78..65f2eab69 100644 --- a/src/main/java/com/merge/api/accounting/RawItemsClient.java +++ b/src/main/java/com/merge/api/accounting/RawItemsClient.java @@ -22,9 +22,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -105,6 +103,10 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "modified_before", request.getModifiedBefore().get(), false); } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); @@ -137,9 +139,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedItemList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedItemList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedItemList.class); Optional startingAfter = parsedResponse.getNext(); ItemsListRequest nextRequest = ItemsListRequest.builder() .from(request) @@ -152,12 +155,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -185,12 +184,10 @@ public MergeApiHttpResponse create(ItemEndpointRequest request, Re QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -207,16 +204,13 @@ public MergeApiHttpResponse create(ItemEndpointRequest request, Re } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ItemResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -279,16 +273,13 @@ public MergeApiHttpResponse retrieve(String id, ItemsRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Item.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Item.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -318,12 +309,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -340,16 +329,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ItemResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ItemResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -383,16 +369,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -425,16 +408,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java b/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java index d71523312..76bb3aca2 100644 --- a/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java +++ b/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java @@ -25,9 +25,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -153,9 +151,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedJournalEntryList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJournalEntryList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJournalEntryList.class); Optional startingAfter = parsedResponse.getNext(); JournalEntriesListRequest nextRequest = JournalEntriesListRequest.builder() .from(request) @@ -169,12 +168,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -203,12 +198,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -225,17 +218,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntryResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JournalEntryResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -298,16 +287,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JournalEntry.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JournalEntry.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -386,9 +372,10 @@ public MergeApiHttpResponse> linesRemoteFie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); JournalEntriesLinesRemoteFieldClassesListRequest nextRequest = JournalEntriesLinesRemoteFieldClassesListRequest.builder() @@ -403,12 +390,8 @@ public MergeApiHttpResponse> linesRemoteFie .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -441,16 +424,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -529,9 +509,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); JournalEntriesRemoteFieldClassesListRequest nextRequest = JournalEntriesRemoteFieldClassesListRequest.builder() @@ -546,12 +527,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java b/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java index 42a8e1320..cbdfe05f0 100644 --- a/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java @@ -30,14 +30,14 @@ public RawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(EndUserDetailsRequest request, Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java index 68d2bd0c1..b16c386b7 100644 --- a/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java @@ -128,9 +128,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); Optional startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -145,12 +146,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawPassthroughClient.java b/src/main/java/com/merge/api/accounting/RawPassthroughClient.java index 21a2d3dd1..1714b1690 100644 --- a/src/main/java/com/merge/api/accounting/RawPassthroughClient.java +++ b/src/main/java/com/merge/api/accounting/RawPassthroughClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(DataPassthroughRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java b/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java index 18ed9394c..b8a878c87 100644 --- a/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java +++ b/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java @@ -93,9 +93,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPaymentMethodList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentMethodList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentMethodList.class); Optional startingAfter = parsedResponse.getNext(); PaymentMethodsListRequest nextRequest = PaymentMethodsListRequest.builder() .from(request) @@ -109,12 +110,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -166,16 +163,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentMethod.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentMethod.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java b/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java index 778fb0ce0..6792a6fda 100644 --- a/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java +++ b/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java @@ -97,9 +97,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPaymentTermList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentTermList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentTermList.class); Optional startingAfter = parsedResponse.getNext(); PaymentTermsListRequest nextRequest = PaymentTermsListRequest.builder() .from(request) @@ -113,12 +114,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -174,16 +171,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentTerm.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentTerm.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawPaymentsClient.java b/src/main/java/com/merge/api/accounting/RawPaymentsClient.java index 723b07980..725f28a0e 100644 --- a/src/main/java/com/merge/api/accounting/RawPaymentsClient.java +++ b/src/main/java/com/merge/api/accounting/RawPaymentsClient.java @@ -26,9 +26,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -162,9 +160,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPaymentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPaymentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentList.class); Optional startingAfter = parsedResponse.getNext(); PaymentsListRequest nextRequest = PaymentsListRequest.builder() .from(request) @@ -177,12 +176,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -210,12 +205,10 @@ public MergeApiHttpResponse create(PaymentEndpointRequest reque QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -232,16 +225,13 @@ public MergeApiHttpResponse create(PaymentEndpointRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -304,16 +294,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Payment.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Payment.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -343,12 +330,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -365,16 +350,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaymentResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaymentResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -453,9 +435,10 @@ public MergeApiHttpResponse> lineItemsRemot } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); PaymentsLineItemsRemoteFieldClassesListRequest nextRequest = PaymentsLineItemsRemoteFieldClassesListRequest.builder() @@ -472,12 +455,8 @@ public MergeApiHttpResponse> lineItemsRemot .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -511,16 +490,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -553,16 +529,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -641,9 +614,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); PaymentsRemoteFieldClassesListRequest nextRequest = PaymentsRemoteFieldClassesListRequest.builder() .from(request) @@ -657,12 +631,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawPhoneNumbersClient.java b/src/main/java/com/merge/api/accounting/RawPhoneNumbersClient.java index 1514811c1..4b8091e72 100644 --- a/src/main/java/com/merge/api/accounting/RawPhoneNumbersClient.java +++ b/src/main/java/com/merge/api/accounting/RawPhoneNumbersClient.java @@ -73,17 +73,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountingPhoneNumber.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountingPhoneNumber.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawProjectsClient.java b/src/main/java/com/merge/api/accounting/RawProjectsClient.java index 296efdadf..a746b755e 100644 --- a/src/main/java/com/merge/api/accounting/RawProjectsClient.java +++ b/src/main/java/com/merge/api/accounting/RawProjectsClient.java @@ -14,7 +14,11 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -32,24 +36,37 @@ public RawProjectsClient(ClientOptions clientOptions) { /** * Returns a list of Project objects. */ - public MergeApiHttpResponse list() { + public MergeApiHttpResponse> list() { return list(ProjectsListRequest.builder().build()); } /** * Returns a list of Project objects. */ - public MergeApiHttpResponse list(ProjectsListRequest request) { + public MergeApiHttpResponse> list(ProjectsListRequest request) { return list(request, null); } /** * Returns a list of Project objects. */ - public MergeApiHttpResponse list(ProjectsListRequest request, RequestOptions requestOptions) { + public MergeApiHttpResponse> list( + ProjectsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/projects"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -72,10 +89,26 @@ public MergeApiHttpResponse list(ProjectsListRequest reque QueryStringMapper.addQueryParameter( httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); } + if (request.getIsActive().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_active", request.getIsActive().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } if (request.getPageSize().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -92,17 +125,24 @@ public MergeApiHttpResponse list(ProjectsListRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { + PaginatedProjectList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class); + Optional startingAfter = parsedResponse.getNext(); + ProjectsListRequest nextRequest = ProjectsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class), + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -158,16 +198,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Project.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Project.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java b/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java index 9994f919b..550cc54a1 100644 --- a/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java +++ b/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java @@ -25,9 +25,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -155,9 +153,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPurchaseOrderList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPurchaseOrderList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPurchaseOrderList.class); Optional startingAfter = parsedResponse.getNext(); PurchaseOrdersListRequest nextRequest = PurchaseOrdersListRequest.builder() .from(request) @@ -171,12 +170,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -205,12 +200,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -227,17 +220,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrderResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PurchaseOrderResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -308,16 +297,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PurchaseOrder.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PurchaseOrder.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -396,9 +382,10 @@ public MergeApiHttpResponse> lineItemsRemot } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); PurchaseOrdersLineItemsRemoteFieldClassesListRequest nextRequest = PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder() @@ -415,12 +402,8 @@ public MergeApiHttpResponse> lineItemsRemot .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -453,16 +436,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -541,9 +521,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); PurchaseOrdersRemoteFieldClassesListRequest nextRequest = PurchaseOrdersRemoteFieldClassesListRequest.builder() @@ -558,12 +539,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/accounting/RawRegenerateKeyClient.java index 0f4bc9272..80d15cd63 100644 --- a/src/main/java/com/merge/api/accounting/RawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/accounting/RawRegenerateKeyClient.java @@ -65,16 +65,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawSalesOrdersClient.java b/src/main/java/com/merge/api/accounting/RawSalesOrdersClient.java new file mode 100644 index 000000000..773235db4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/RawSalesOrdersClient.java @@ -0,0 +1,639 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PaginatedRemoteFieldClassList; +import com.merge.api.accounting.types.PaginatedSalesOrderList; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.accounting.types.SalesOrder; +import com.merge.api.accounting.types.SalesOrderBulkRequest; +import com.merge.api.accounting.types.SalesOrderEndpointRequest; +import com.merge.api.accounting.types.SalesOrderResponse; +import com.merge.api.accounting.types.SalesOrdersLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersListRequest; +import com.merge.api.accounting.types.SalesOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSalesOrdersClient { + protected final ClientOptions clientOptions; + + public RawSalesOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of SalesOrder objects. + */ + public MergeApiHttpResponse> list() { + return list(SalesOrdersListRequest.builder().build()); + } + + /** + * Returns a list of SalesOrder objects. + */ + public MergeApiHttpResponse> list(SalesOrdersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of SalesOrder objects. + */ + public MergeApiHttpResponse> list( + SalesOrdersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders"); + if (request.getCompanyId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "company_id", request.getCompanyId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIssueDateAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "issue_date_after", request.getIssueDateAfter().get(), false); + } + if (request.getIssueDateBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "issue_date_before", request.getIssueDateBefore().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedSalesOrderList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSalesOrderList.class); + Optional startingAfter = parsedResponse.getNext(); + SalesOrdersListRequest nextRequest = SalesOrdersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a SalesOrder object with the given values. + */ + public MergeApiHttpResponse create(SalesOrderEndpointRequest request) { + return create(request, null); + } + + /** + * Creates a SalesOrder object with the given values. + */ + public MergeApiHttpResponse create( + SalesOrderEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SalesOrderResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a SalesOrder object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, SalesOrdersRetrieveRequest.builder().build()); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, SalesOrdersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, SalesOrdersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, SalesOrder.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public MergeApiHttpResponse bulkCreate(SalesOrderBulkRequest request) { + return bulkCreate(request, null); + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public MergeApiHttpResponse bulkCreate( + SalesOrderBulkRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/bulk") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncBulkCreateResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId) { + return bulkRetrieve(batchId, null); + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public MergeApiHttpResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/bulk") + .addPathSegment(batchId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BatchObjectsResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList() { + return linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request) { + return linesRemoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/lines/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + SalesOrdersLinesRemoteFieldClassesListRequest nextRequest = + SalesOrdersLinesRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> linesRemoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve() { + return metaPostRetrieve(null); + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/meta/post") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList() { + return remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest.builder().build()); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request) { + return remoteFieldClassesList(request, null); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public MergeApiHttpResponse> remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/sales-orders/remote-field-classes"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getIsCommonModelField().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "is_common_model_field", + request.getIsCommonModelField().get(), + false); + } + if (request.getIsCustom().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_custom", request.getIsCustom().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedRemoteFieldClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + Optional startingAfter = parsedResponse.getNext(); + SalesOrdersRemoteFieldClassesListRequest nextRequest = + SalesOrdersRemoteFieldClassesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/RawScopesClient.java b/src/main/java/com/merge/api/accounting/RawScopesClient.java index 22e347d6d..92e1feb26 100644 --- a/src/main/java/com/merge/api/accounting/RawScopesClient.java +++ b/src/main/java/com/merge/api/accounting/RawScopesClient.java @@ -56,17 +56,13 @@ public MergeApiHttpResponse defaultScopesRetrieve(RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -99,17 +95,13 @@ public MergeApiHttpResponse linkedAccountScopesRetrieve(Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -152,17 +144,13 @@ public MergeApiHttpResponse linkedAccountScopesCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java b/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java index 7e4679be3..162342cea 100644 --- a/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java @@ -74,9 +74,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedSyncStatusList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -90,12 +91,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java b/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java index 95fb7da60..3516fb8c5 100644 --- a/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java +++ b/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java @@ -125,9 +125,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTaxRateList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaxRateList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaxRateList.class); Optional startingAfter = parsedResponse.getNext(); TaxRatesListRequest nextRequest = TaxRatesListRequest.builder() .from(request) @@ -140,12 +141,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -201,16 +198,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaxRate.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TaxRate.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java b/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java index 2f9370ef8..373b8e6b4 100644 --- a/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java +++ b/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java @@ -141,9 +141,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTrackingCategoryList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTrackingCategoryList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTrackingCategoryList.class); Optional startingAfter = parsedResponse.getNext(); TrackingCategoriesListRequest nextRequest = TrackingCategoriesListRequest.builder() .from(request) @@ -157,12 +158,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -226,16 +223,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TrackingCategory.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TrackingCategory.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawTransactionsClient.java b/src/main/java/com/merge/api/accounting/RawTransactionsClient.java index 47e5435b8..6246131b4 100644 --- a/src/main/java/com/merge/api/accounting/RawTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/RawTransactionsClient.java @@ -135,9 +135,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTransactionList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTransactionList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTransactionList.class); Optional startingAfter = parsedResponse.getNext(); TransactionsListRequest nextRequest = TransactionsListRequest.builder() .from(request) @@ -151,12 +152,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -212,16 +209,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Transaction.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Transaction.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java b/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java index f3f9cf763..8f31fb49a 100644 --- a/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java +++ b/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java @@ -3,8 +3,10 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyVendorCreditRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedVendorCreditList; +import com.merge.api.accounting.types.PatchedVendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCredit; import com.merge.api.accounting.types.VendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCreditResponse; @@ -21,9 +23,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -142,9 +142,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedVendorCreditList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedVendorCreditList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedVendorCreditList.class); Optional startingAfter = parsedResponse.getNext(); VendorCreditsListRequest nextRequest = VendorCreditsListRequest.builder() .from(request) @@ -158,12 +159,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -192,12 +189,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -214,17 +209,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCreditResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCreditResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -280,16 +271,167 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), VendorCredit.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCredit.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Updates a VendorCredit object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedVendorCreditEndpointRequest request) { + return partialUpdate(id, request, null); + } + + /** + * Updates a VendorCredit object with the given id. + */ + public MergeApiHttpResponse partialUpdate( + String id, PatchedVendorCreditEndpointRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits") + .addPathSegment(id); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCreditResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public MergeApiHttpResponse applicationCreate(String id, ApplyVendorCreditRequest request) { + return applicationCreate(id, request, null); + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public MergeApiHttpResponse applicationCreate( + String id, ApplyVendorCreditRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits") + .addPathSegment(id) + .addPathSegments("application"); + if (request.getIsDebugMode().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); + } + if (request.getRunAsync().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "run_async", request.getRunAsync().get(), false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCreditResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id) { + return metaPatchRetrieve(id, null); + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("accounting/v1/vendor-credits/meta/patch") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -322,16 +464,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/accounting/RawWebhookReceiversClient.java index 9dd2a8114..b64d26d30 100644 --- a/src/main/java/com/merge/api/accounting/RawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/accounting/RawWebhookReceiversClient.java @@ -58,18 +58,15 @@ public MergeApiHttpResponse> list(RequestOptions requestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -110,16 +107,13 @@ public MergeApiHttpResponse create(WebhookReceiverRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/accounting/SalesOrdersClient.java b/src/main/java/com/merge/api/accounting/SalesOrdersClient.java new file mode 100644 index 000000000..0ce6d1606 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/SalesOrdersClient.java @@ -0,0 +1,184 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting; + +import com.merge.api.accounting.types.AsyncBulkCreateResponse; +import com.merge.api.accounting.types.BatchObjectsResponse; +import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.RemoteFieldClass; +import com.merge.api.accounting.types.SalesOrder; +import com.merge.api.accounting.types.SalesOrderBulkRequest; +import com.merge.api.accounting.types.SalesOrderEndpointRequest; +import com.merge.api.accounting.types.SalesOrderResponse; +import com.merge.api.accounting.types.SalesOrdersLinesRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersListRequest; +import com.merge.api.accounting.types.SalesOrdersRemoteFieldClassesListRequest; +import com.merge.api.accounting.types.SalesOrdersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class SalesOrdersClient { + protected final ClientOptions clientOptions; + + private final RawSalesOrdersClient rawClient; + + public SalesOrdersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSalesOrdersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSalesOrdersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of SalesOrder objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of SalesOrder objects. + */ + public SyncPagingIterable list(SalesOrdersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of SalesOrder objects. + */ + public SyncPagingIterable list(SalesOrdersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Creates a SalesOrder object with the given values. + */ + public SalesOrderResponse create(SalesOrderEndpointRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a SalesOrder object with the given values. + */ + public SalesOrderResponse create(SalesOrderEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public SalesOrder retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public SalesOrder retrieve(String id, SalesOrdersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a SalesOrder object with the given id. + */ + public SalesOrder retrieve(String id, SalesOrdersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(SalesOrderBulkRequest request) { + return this.rawClient.bulkCreate(request).body(); + } + + /** + * Creates multiple SalesOrder objects with the given values. + */ + public AsyncBulkCreateResponse bulkCreate(SalesOrderBulkRequest request, RequestOptions requestOptions) { + return this.rawClient.bulkCreate(request, requestOptions).body(); + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId) { + return this.rawClient.bulkRetrieve(batchId).body(); + } + + /** + * Returns the status and results of a SalesOrder bulk create batch. + */ + public BatchObjectsResponse bulkRetrieve(String batchId, RequestOptions requestOptions) { + return this.rawClient.bulkRetrieve(batchId, requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList() { + return this.rawClient.linesRemoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request) { + return this.rawClient.linesRemoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable linesRemoteFieldClassesList( + SalesOrdersLinesRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient + .linesRemoteFieldClassesList(request, requestOptions) + .body(); + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public MetaResponse metaPostRetrieve() { + return this.rawClient.metaPostRetrieve().body(); + } + + /** + * Returns metadata for SalesOrder POSTs. + */ + public MetaResponse metaPostRetrieve(RequestOptions requestOptions) { + return this.rawClient.metaPostRetrieve(requestOptions).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList() { + return this.rawClient.remoteFieldClassesList().body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request) { + return this.rawClient.remoteFieldClassesList(request).body(); + } + + /** + * Returns a list of RemoteFieldClass objects. + */ + public SyncPagingIterable remoteFieldClassesList( + SalesOrdersRemoteFieldClassesListRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldClassesList(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/accounting/VendorCreditsClient.java b/src/main/java/com/merge/api/accounting/VendorCreditsClient.java index 1f3f340b7..ebc60e8a5 100644 --- a/src/main/java/com/merge/api/accounting/VendorCreditsClient.java +++ b/src/main/java/com/merge/api/accounting/VendorCreditsClient.java @@ -3,7 +3,9 @@ */ package com.merge.api.accounting; +import com.merge.api.accounting.types.ApplyVendorCreditRequest; import com.merge.api.accounting.types.MetaResponse; +import com.merge.api.accounting.types.PatchedVendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCredit; import com.merge.api.accounting.types.VendorCreditEndpointRequest; import com.merge.api.accounting.types.VendorCreditResponse; @@ -86,6 +88,50 @@ public VendorCredit retrieve(String id, VendorCreditsRetrieveRequest request, Re return this.rawClient.retrieve(id, request, requestOptions).body(); } + /** + * Updates a VendorCredit object with the given id. + */ + public VendorCreditResponse partialUpdate(String id, PatchedVendorCreditEndpointRequest request) { + return this.rawClient.partialUpdate(id, request).body(); + } + + /** + * Updates a VendorCredit object with the given id. + */ + public VendorCreditResponse partialUpdate( + String id, PatchedVendorCreditEndpointRequest request, RequestOptions requestOptions) { + return this.rawClient.partialUpdate(id, request, requestOptions).body(); + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public VendorCreditResponse applicationCreate(String id, ApplyVendorCreditRequest request) { + return this.rawClient.applicationCreate(id, request).body(); + } + + /** + * Creates a new VendorCreditApplyLine to apply a vendor credit to an invoice + */ + public VendorCreditResponse applicationCreate( + String id, ApplyVendorCreditRequest request, RequestOptions requestOptions) { + return this.rawClient.applicationCreate(id, request, requestOptions).body(); + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id) { + return this.rawClient.metaPatchRetrieve(id).body(); + } + + /** + * Returns metadata for VendorCredit PATCHs. + */ + public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + } + /** * Returns metadata for VendorCredit POSTs. */ diff --git a/src/main/java/com/merge/api/accounting/types/Account.java b/src/main/java/com/merge/api/accounting/types/Account.java index 701308416..bdf5f1fb7 100644 --- a/src/main/java/com/merge/api/accounting/types/Account.java +++ b/src/main/java/com/merge/api/accounting/types/Account.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Account.Builder.class) public final class Account { + private final Optional accountUrl; + private final Optional id; private final Optional remoteId; @@ -51,7 +53,7 @@ public final class Account { private final Optional parentAccount; - private final Optional company; + private final Optional company; private final Optional remoteWasDeleted; @@ -62,6 +64,7 @@ public final class Account { private final Map additionalProperties; private Account( + Optional accountUrl, Optional id, Optional remoteId, Optional createdAt, @@ -76,11 +79,12 @@ private Account( Optional currency, Optional accountNumber, Optional parentAccount, - Optional company, + Optional company, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { + this.accountUrl = accountUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -102,6 +106,14 @@ private Account( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the account. + */ + @JsonProperty("account_url") + public Optional getAccountUrl() { + return accountUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -550,7 +562,7 @@ public Optional getParentAccount() { * @return The company the account belongs to. */ @JsonProperty("company") - public Optional getCompany() { + public Optional getCompany() { return company; } @@ -584,7 +596,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(Account other) { - return id.equals(other.id) + return accountUrl.equals(other.accountUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -607,6 +620,7 @@ private boolean equalTo(Account other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.accountUrl, this.id, this.remoteId, this.createdAt, @@ -638,6 +652,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional accountUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -666,7 +682,7 @@ public static final class Builder { private Optional parentAccount = Optional.empty(); - private Optional company = Optional.empty(); + private Optional company = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -680,6 +696,7 @@ public static final class Builder { private Builder() {} public Builder from(Account other) { + accountUrl(other.getAccountUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -701,6 +718,20 @@ public Builder from(Account other) { return this; } + /** + *

The 3rd party URL of the account.

+ */ + @JsonSetter(value = "account_url", nulls = Nulls.SKIP) + public Builder accountUrl(Optional accountUrl) { + this.accountUrl = accountUrl; + return this; + } + + public Builder accountUrl(String accountUrl) { + this.accountUrl = Optional.ofNullable(accountUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -1233,12 +1264,12 @@ public Builder parentAccount(String parentAccount) { *

The company the account belongs to.

*/ @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { + public Builder company(Optional company) { this.company = company; return this; } - public Builder company(String company) { + public Builder company(AccountCompany company) { this.company = Optional.ofNullable(company); return this; } @@ -1281,6 +1312,7 @@ public Builder remoteData(List remoteData) { public Account build() { return new Account( + accountUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/AccountCompany.java b/src/main/java/com/merge/api/accounting/types/AccountCompany.java new file mode 100644 index 000000000..805f7f30d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountCompany.Deserializer.class) +public final class AccountCompany { + private final Object value; + + private final int type; + + private AccountCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountCompany && equalTo((AccountCompany) other); + } + + private boolean equalTo(AccountCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountCompany of(String value) { + return new AccountCompany(value, 0); + } + + public static AccountCompany of(CompanyInfo value) { + return new AccountCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountCompany.class); + } + + @java.lang.Override + public AccountCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountDetails.java b/src/main/java/com/merge/api/accounting/types/AccountDetails.java index 836f028a9..59f89139c 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountDetails.java +++ b/src/main/java/com/merge/api/accounting/types/AccountDetails.java @@ -27,7 +27,7 @@ public final class AccountDetails { private final Optional integrationSlug; - private final Optional category; + private final Optional category; private final Optional endUserOriginId; @@ -45,13 +45,17 @@ public final class AccountDetails { private final Optional completedAt; + private final Optional instanceId; + + private final Optional instanceDisplayValue; + private final Map additionalProperties; private AccountDetails( Optional id, Optional integration, Optional integrationSlug, - Optional category, + Optional category, Optional endUserOriginId, Optional endUserOrganizationName, Optional endUserEmailAddress, @@ -60,6 +64,8 @@ private AccountDetails( Optional isDuplicate, Optional accountType, Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, Map additionalProperties) { this.id = id; this.integration = integration; @@ -73,6 +79,8 @@ private AccountDetails( this.isDuplicate = isDuplicate; this.accountType = accountType; this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; this.additionalProperties = additionalProperties; } @@ -92,7 +100,7 @@ public Optional getIntegrationSlug() { } @JsonProperty("category") - public Optional getCategory() { + public Optional getCategory() { return category; } @@ -142,6 +150,16 @@ public Optional getCompletedAt() { return completedAt; } + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -165,7 +183,9 @@ private boolean equalTo(AccountDetails other) { && webhookListenerUrl.equals(other.webhookListenerUrl) && isDuplicate.equals(other.isDuplicate) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); } @java.lang.Override @@ -182,7 +202,9 @@ public int hashCode() { this.webhookListenerUrl, this.isDuplicate, this.accountType, - this.completedAt); + this.completedAt, + this.instanceId, + this.instanceDisplayValue); } @java.lang.Override @@ -202,7 +224,7 @@ public static final class Builder { private Optional integrationSlug = Optional.empty(); - private Optional category = Optional.empty(); + private Optional category = Optional.empty(); private Optional endUserOriginId = Optional.empty(); @@ -220,6 +242,10 @@ public static final class Builder { private Optional completedAt = Optional.empty(); + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -238,6 +264,8 @@ public Builder from(AccountDetails other) { isDuplicate(other.getIsDuplicate()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); return this; } @@ -275,12 +303,12 @@ public Builder integrationSlug(String integrationSlug) { } @JsonSetter(value = "category", nulls = Nulls.SKIP) - public Builder category(Optional category) { + public Builder category(Optional category) { this.category = category; return this; } - public Builder category(CategoryEnum category) { + public Builder category(AccountDetailsCategory category) { this.category = Optional.ofNullable(category); return this; } @@ -379,6 +407,28 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + public AccountDetails build() { return new AccountDetails( id, @@ -393,6 +443,8 @@ public AccountDetails build() { isDuplicate, accountType, completedAt, + instanceId, + instanceDisplayValue, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java index a68e0c32c..4c1b85580 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -48,6 +49,8 @@ public final class AccountDetailsAndActions { private final OffsetDateTime completedAt; + private final Optional> integrationSpecificFields; + private final Map additionalProperties; private AccountDetailsAndActions( @@ -64,6 +67,7 @@ private AccountDetailsAndActions( Optional integration, String accountType, OffsetDateTime completedAt, + Optional> integrationSpecificFields, Map additionalProperties) { this.id = id; this.category = category; @@ -78,6 +82,7 @@ private AccountDetailsAndActions( this.integration = integration; this.accountType = accountType; this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; this.additionalProperties = additionalProperties; } @@ -152,6 +157,11 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -176,7 +186,8 @@ private boolean equalTo(AccountDetailsAndActions other) { && isDuplicate.equals(other.isDuplicate) && integration.equals(other.integration) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); } @java.lang.Override @@ -194,7 +205,8 @@ public int hashCode() { this.isDuplicate, this.integration, this.accountType, - this.completedAt); + this.completedAt, + this.integrationSpecificFields); } @java.lang.Override @@ -268,6 +280,10 @@ public interface _FinalStage { _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -294,6 +310,8 @@ public static final class Builder private OffsetDateTime completedAt; + private Optional> integrationSpecificFields = Optional.empty(); + private Optional integration = Optional.empty(); private Optional isDuplicate = Optional.empty(); @@ -326,6 +344,7 @@ public Builder from(AccountDetailsAndActions other) { integration(other.getIntegration()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); return this; } @@ -378,6 +397,19 @@ public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { return this; } + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + @java.lang.Override public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { this.integration = Optional.ofNullable(integration); @@ -486,6 +518,7 @@ public AccountDetailsAndActions build() { integration, accountType, completedAt, + integrationSpecificFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/AccountDetailsCategory.java b/src/main/java/com/merge/api/accounting/types/AccountDetailsCategory.java new file mode 100644 index 000000000..e992da08f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountDetailsCategory.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountDetailsCategory.Deserializer.class) +public final class AccountDetailsCategory { + private final Object value; + + private final int type; + + private AccountDetailsCategory(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CategoryEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsCategory && equalTo((AccountDetailsCategory) other); + } + + private boolean equalTo(AccountDetailsCategory other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountDetailsCategory of(CategoryEnum value) { + return new AccountDetailsCategory(value, 0); + } + + public static AccountDetailsCategory of(String value) { + return new AccountDetailsCategory(value, 1); + } + + public interface Visitor { + T visit(CategoryEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountDetailsCategory.class); + } + + @java.lang.Override + public AccountDetailsCategory deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CategoryEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountRequest.java b/src/main/java/com/merge/api/accounting/types/AccountRequest.java index 752ffe961..bab62c745 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountRequest.java @@ -21,6 +21,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AccountRequest.Builder.class) public final class AccountRequest { + private final Optional accountUrl; + private final Optional name; private final Optional description; @@ -41,7 +43,7 @@ public final class AccountRequest { private final Optional parentAccount; - private final Optional company; + private final Optional company; private final Optional> integrationParams; @@ -50,6 +52,7 @@ public final class AccountRequest { private final Map additionalProperties; private AccountRequest( + Optional accountUrl, Optional name, Optional description, Optional classification, @@ -60,10 +63,11 @@ private AccountRequest( Optional currency, Optional accountNumber, Optional parentAccount, - Optional company, + Optional company, Optional> integrationParams, Optional> linkedAccountParams, Map additionalProperties) { + this.accountUrl = accountUrl; this.name = name; this.description = description; this.classification = classification; @@ -80,6 +84,14 @@ private AccountRequest( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the account. + */ + @JsonProperty("account_url") + public Optional getAccountUrl() { + return accountUrl; + } + /** * @return The account's name. */ @@ -499,7 +511,7 @@ public Optional getParentAccount() { * @return The company the account belongs to. */ @JsonProperty("company") - public Optional getCompany() { + public Optional getCompany() { return company; } @@ -525,7 +537,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(AccountRequest other) { - return name.equals(other.name) + return accountUrl.equals(other.accountUrl) + && name.equals(other.name) && description.equals(other.description) && classification.equals(other.classification) && type.equals(other.type) @@ -543,6 +556,7 @@ private boolean equalTo(AccountRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.accountUrl, this.name, this.description, this.classification, @@ -569,6 +583,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional accountUrl = Optional.empty(); + private Optional name = Optional.empty(); private Optional description = Optional.empty(); @@ -589,7 +605,7 @@ public static final class Builder { private Optional parentAccount = Optional.empty(); - private Optional company = Optional.empty(); + private Optional company = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -601,6 +617,7 @@ public static final class Builder { private Builder() {} public Builder from(AccountRequest other) { + accountUrl(other.getAccountUrl()); name(other.getName()); description(other.getDescription()); classification(other.getClassification()); @@ -617,6 +634,20 @@ public Builder from(AccountRequest other) { return this; } + /** + *

The 3rd party URL of the account.

+ */ + @JsonSetter(value = "account_url", nulls = Nulls.SKIP) + public Builder accountUrl(Optional accountUrl) { + this.accountUrl = accountUrl; + return this; + } + + public Builder accountUrl(String accountUrl) { + this.accountUrl = Optional.ofNullable(accountUrl); + return this; + } + /** *

The account's name.

*/ @@ -1096,12 +1127,12 @@ public Builder parentAccount(String parentAccount) { *

The company the account belongs to.

*/ @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { + public Builder company(Optional company) { this.company = company; return this; } - public Builder company(String company) { + public Builder company(AccountRequestCompany company) { this.company = Optional.ofNullable(company); return this; } @@ -1130,6 +1161,7 @@ public Builder linkedAccountParams(Map linkedAccountParams) { public AccountRequest build() { return new AccountRequest( + accountUrl, name, description, classification, diff --git a/src/main/java/com/merge/api/accounting/types/AccountRequestCompany.java b/src/main/java/com/merge/api/accounting/types/AccountRequestCompany.java new file mode 100644 index 000000000..7ee712ec2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountRequestCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountRequestCompany.Deserializer.class) +public final class AccountRequestCompany { + private final Object value; + + private final int type; + + private AccountRequestCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountRequestCompany && equalTo((AccountRequestCompany) other); + } + + private boolean equalTo(AccountRequestCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountRequestCompany of(String value) { + return new AccountRequestCompany(value, 0); + } + + public static AccountRequestCompany of(CompanyInfo value) { + return new AccountRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountRequestCompany.class); + } + + @java.lang.Override + public AccountRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java index e8e1c31a3..2d9935d4f 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AccountingPeriod.Builder.class) public final class AccountingPeriod { + private final Optional accountingPeriodUrl; + private final Optional id; private final Optional remoteId; @@ -46,6 +48,7 @@ public final class AccountingPeriod { private final Map additionalProperties; private AccountingPeriod( + Optional accountingPeriodUrl, Optional id, Optional remoteId, Optional createdAt, @@ -57,6 +60,7 @@ private AccountingPeriod( Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { + this.accountingPeriodUrl = accountingPeriodUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -70,6 +74,14 @@ private AccountingPeriod( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the accounting period. + */ + @JsonProperty("accounting_period_url") + public Optional getAccountingPeriodUrl() { + return accountingPeriodUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -150,7 +162,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(AccountingPeriod other) { - return id.equals(other.id) + return accountingPeriodUrl.equals(other.accountingPeriodUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -165,6 +178,7 @@ private boolean equalTo(AccountingPeriod other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.accountingPeriodUrl, this.id, this.remoteId, this.createdAt, @@ -188,6 +202,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional accountingPeriodUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -214,6 +230,7 @@ public static final class Builder { private Builder() {} public Builder from(AccountingPeriod other) { + accountingPeriodUrl(other.getAccountingPeriodUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -227,6 +244,20 @@ public Builder from(AccountingPeriod other) { return this; } + /** + *

The 3rd party URL of the accounting period.

+ */ + @JsonSetter(value = "accounting_period_url", nulls = Nulls.SKIP) + public Builder accountingPeriodUrl(Optional accountingPeriodUrl) { + this.accountingPeriodUrl = accountingPeriodUrl; + return this; + } + + public Builder accountingPeriodUrl(String accountingPeriodUrl) { + this.accountingPeriodUrl = Optional.ofNullable(accountingPeriodUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -357,6 +388,7 @@ public Builder remoteData(List remoteData) { public AccountingPeriod build() { return new AccountingPeriod( + accountingPeriodUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/AccountingPeriodsListRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingPeriodsListRequest.java index 301bc79a6..8af903e09 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountingPeriodsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPeriodsListRequest.java @@ -80,7 +80,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -204,7 +204,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

Number of results to return per page.

+ *

Number of results to return per page. The maximum limit is 100.

*/ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java b/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java index 708801ac4..be97e2895 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java @@ -207,7 +207,7 @@ public Optional getName() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -563,7 +563,7 @@ public Builder name(String name) { } /** - *

Number of results to return per page.

+ *

Number of results to return per page. The maximum limit is 100.

*/ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/Address.java b/src/main/java/com/merge/api/accounting/types/Address.java index f8e223c47..edcec8582 100644 --- a/src/main/java/com/merge/api/accounting/types/Address.java +++ b/src/main/java/com/merge/api/accounting/types/Address.java @@ -121,6 +121,9 @@ public Optional getCity() { return city; } + /** + * @return The address's state or region. + */ @JsonProperty("state") public Optional getState() { return state; @@ -578,6 +581,9 @@ public Builder city(String city) { return this; } + /** + *

The address's state or region.

+ */ @JsonSetter(value = "state", nulls = Nulls.SKIP) public Builder state(Optional state) { this.state = state; diff --git a/src/main/java/com/merge/api/accounting/types/ApplyCreditNoteRequest.java b/src/main/java/com/merge/api/accounting/types/ApplyCreditNoteRequest.java new file mode 100644 index 000000000..be84b25a3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ApplyCreditNoteRequest.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ApplyCreditNoteRequest.Builder.class) +public final class ApplyCreditNoteRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final Optional invoice; + + private final OffsetDateTime appliedDate; + + private final String appliedAmount; + + private final Map additionalProperties; + + private ApplyCreditNoteRequest( + Optional isDebugMode, + Optional runAsync, + Optional invoice, + OffsetDateTime appliedDate, + String appliedAmount, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.invoice = invoice; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + /** + * @return The invoice to apply the credit note to. + */ + @JsonProperty("invoice") + public Optional getInvoice() { + return invoice; + } + + /** + * @return Date that the credit note is applied to the invoice. + */ + @JsonProperty("applied_date") + public OffsetDateTime getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of credit applied to the invoice. + */ + @JsonProperty("applied_amount") + public String getAppliedAmount() { + return appliedAmount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplyCreditNoteRequest && equalTo((ApplyCreditNoteRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplyCreditNoteRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && invoice.equals(other.invoice) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.invoice, this.appliedDate, this.appliedAmount); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AppliedDateStage builder() { + return new Builder(); + } + + public interface AppliedDateStage { + /** + *

Date that the credit note is applied to the invoice.

+ */ + AppliedAmountStage appliedDate(@NotNull OffsetDateTime appliedDate); + + Builder from(ApplyCreditNoteRequest other); + } + + public interface AppliedAmountStage { + /** + *

The amount of credit applied to the invoice.

+ */ + _FinalStage appliedAmount(@NotNull String appliedAmount); + } + + public interface _FinalStage { + ApplyCreditNoteRequest build(); + + /** + *

Whether to include debug fields (such as log file links) in the response.

+ */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

Whether or not third-party updates should be run asynchronously.

+ */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + + /** + *

The invoice to apply the credit note to.

+ */ + _FinalStage invoice(Optional invoice); + + _FinalStage invoice(String invoice); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AppliedDateStage, AppliedAmountStage, _FinalStage { + private OffsetDateTime appliedDate; + + private String appliedAmount; + + private Optional invoice = Optional.empty(); + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ApplyCreditNoteRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + invoice(other.getInvoice()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + return this; + } + + /** + *

Date that the credit note is applied to the invoice.

+ *

Date that the credit note is applied to the invoice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("applied_date") + public AppliedAmountStage appliedDate(@NotNull OffsetDateTime appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + /** + *

The amount of credit applied to the invoice.

+ *

The amount of credit applied to the invoice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("applied_amount") + public _FinalStage appliedAmount(@NotNull String appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + /** + *

The invoice to apply the credit note to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage invoice(String invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + /** + *

The invoice to apply the credit note to.

+ */ + @java.lang.Override + @JsonSetter(value = "invoice", nulls = Nulls.SKIP) + public _FinalStage invoice(Optional invoice) { + this.invoice = invoice; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

+ */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

Whether to include debug fields (such as log file links) in the response.

+ */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public ApplyCreditNoteRequest build() { + return new ApplyCreditNoteRequest( + isDebugMode, runAsync, invoice, appliedDate, appliedAmount, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ApplyVendorCreditRequest.java b/src/main/java/com/merge/api/accounting/types/ApplyVendorCreditRequest.java new file mode 100644 index 000000000..c5cee25c1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ApplyVendorCreditRequest.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ApplyVendorCreditRequest.Builder.class) +public final class ApplyVendorCreditRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final Optional invoice; + + private final OffsetDateTime appliedDate; + + private final String appliedAmount; + + private final Map additionalProperties; + + private ApplyVendorCreditRequest( + Optional isDebugMode, + Optional runAsync, + Optional invoice, + OffsetDateTime appliedDate, + String appliedAmount, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.invoice = invoice; + this.appliedDate = appliedDate; + this.appliedAmount = appliedAmount; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + /** + * @return The invoice to apply the vendor credit to. + */ + @JsonProperty("invoice") + public Optional getInvoice() { + return invoice; + } + + /** + * @return Date that the vendor credit is applied to the invoice. + */ + @JsonProperty("applied_date") + public OffsetDateTime getAppliedDate() { + return appliedDate; + } + + /** + * @return The amount of vendor credit applied to the invoice. + */ + @JsonProperty("applied_amount") + public String getAppliedAmount() { + return appliedAmount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ApplyVendorCreditRequest && equalTo((ApplyVendorCreditRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ApplyVendorCreditRequest other) { + return isDebugMode.equals(other.isDebugMode) + && runAsync.equals(other.runAsync) + && invoice.equals(other.invoice) + && appliedDate.equals(other.appliedDate) + && appliedAmount.equals(other.appliedAmount); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.invoice, this.appliedDate, this.appliedAmount); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AppliedDateStage builder() { + return new Builder(); + } + + public interface AppliedDateStage { + /** + *

Date that the vendor credit is applied to the invoice.

+ */ + AppliedAmountStage appliedDate(@NotNull OffsetDateTime appliedDate); + + Builder from(ApplyVendorCreditRequest other); + } + + public interface AppliedAmountStage { + /** + *

The amount of vendor credit applied to the invoice.

+ */ + _FinalStage appliedAmount(@NotNull String appliedAmount); + } + + public interface _FinalStage { + ApplyVendorCreditRequest build(); + + /** + *

Whether to include debug fields (such as log file links) in the response.

+ */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

Whether or not third-party updates should be run asynchronously.

+ */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + + /** + *

The invoice to apply the vendor credit to.

+ */ + _FinalStage invoice(Optional invoice); + + _FinalStage invoice(String invoice); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AppliedDateStage, AppliedAmountStage, _FinalStage { + private OffsetDateTime appliedDate; + + private String appliedAmount; + + private Optional invoice = Optional.empty(); + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ApplyVendorCreditRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + invoice(other.getInvoice()); + appliedDate(other.getAppliedDate()); + appliedAmount(other.getAppliedAmount()); + return this; + } + + /** + *

Date that the vendor credit is applied to the invoice.

+ *

Date that the vendor credit is applied to the invoice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("applied_date") + public AppliedAmountStage appliedDate(@NotNull OffsetDateTime appliedDate) { + this.appliedDate = appliedDate; + return this; + } + + /** + *

The amount of vendor credit applied to the invoice.

+ *

The amount of vendor credit applied to the invoice.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("applied_amount") + public _FinalStage appliedAmount(@NotNull String appliedAmount) { + this.appliedAmount = appliedAmount; + return this; + } + + /** + *

The invoice to apply the vendor credit to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage invoice(String invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + /** + *

The invoice to apply the vendor credit to.

+ */ + @java.lang.Override + @JsonSetter(value = "invoice", nulls = Nulls.SKIP) + public _FinalStage invoice(Optional invoice) { + this.invoice = invoice; + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

Whether or not third-party updates should be run asynchronously.

+ */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

Whether to include debug fields (such as log file links) in the response.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

Whether to include debug fields (such as log file links) in the response.

+ */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public ApplyVendorCreditRequest build() { + return new ApplyVendorCreditRequest( + isDebugMode, runAsync, invoice, appliedDate, appliedAmount, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AsyncBulkCreateResponse.java b/src/main/java/com/merge/api/accounting/types/AsyncBulkCreateResponse.java new file mode 100644 index 000000000..2db5e3714 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AsyncBulkCreateResponse.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncBulkCreateResponse.Builder.class) +public final class AsyncBulkCreateResponse { + private final String batchId; + + private final Map additionalProperties; + + private AsyncBulkCreateResponse(String batchId, Map additionalProperties) { + this.batchId = batchId; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the batch. + */ + @JsonProperty("batch_id") + public String getBatchId() { + return batchId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncBulkCreateResponse && equalTo((AsyncBulkCreateResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncBulkCreateResponse other) { + return batchId.equals(other.batchId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.batchId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BatchIdStage builder() { + return new Builder(); + } + + public interface BatchIdStage { + /** + *

The ID of the batch.

+ */ + _FinalStage batchId(@NotNull String batchId); + + Builder from(AsyncBulkCreateResponse other); + } + + public interface _FinalStage { + AsyncBulkCreateResponse build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BatchIdStage, _FinalStage { + private String batchId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncBulkCreateResponse other) { + batchId(other.getBatchId()); + return this; + } + + /** + *

The ID of the batch.

+ *

The ID of the batch.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("batch_id") + public _FinalStage batchId(@NotNull String batchId) { + this.batchId = batchId; + return this; + } + + @java.lang.Override + public AsyncBulkCreateResponse build() { + return new AsyncBulkCreateResponse(batchId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java b/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java index 27ea3586b..92748c4c6 100644 --- a/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java @@ -145,7 +145,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -381,7 +381,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

Number of results to return per page.

+ *

Number of results to return per page. The maximum limit is 100.

*/ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java b/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java index 2f8f209b1..1b709aea1 100644 --- a/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java @@ -91,6 +91,7 @@ public Optional getUserEmail() { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ @JsonProperty("role") @@ -220,6 +221,7 @@ public interface RoleStage { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ IpAddressStage role(@NotNull AuditLogEventRole role); @@ -359,6 +361,7 @@ public Builder from(AuditLogEvent other) { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * *

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    *
      @@ -368,6 +371,7 @@ public Builder from(AuditLogEvent other) { *
    • API - API
    • *
    • SYSTEM - SYSTEM
    • *
    • MERGE_TEAM - MERGE_TEAM
    • + *
    • SUPPORT - SUPPORT
    • *
    * @return Reference to {@code this} so that method calls can be chained together. */ diff --git a/src/main/java/com/merge/api/accounting/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/accounting/types/AuditTrailListRequest.java index bd4c33ce3..d35561a3c 100644 --- a/src/main/java/com/merge/api/accounting/types/AuditTrailListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AuditTrailListRequest.java @@ -76,7 +76,7 @@ public Optional getEventType() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -205,7 +205,7 @@ public Builder eventType(String eventType) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java b/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java index e9bef96f3..776a156bf 100644 --- a/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java index 2cc32aea3..45acf8f10 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankFeedAccount.Builder.class) public final class BankFeedAccount { + private final Optional bankFeedAccountUrl; + private final Optional id; private final Optional remoteId; @@ -55,11 +57,12 @@ public final class BankFeedAccount { private final Optional> fieldMappings; - private final Optional>>> remoteData; + private final Optional> remoteData; private final Map additionalProperties; private BankFeedAccount( + Optional bankFeedAccountUrl, Optional id, Optional remoteId, Optional createdAt, @@ -76,8 +79,9 @@ private BankFeedAccount( Optional accountType, Optional remoteWasDeleted, Optional> fieldMappings, - Optional>>> remoteData, + Optional> remoteData, Map additionalProperties) { + this.bankFeedAccountUrl = bankFeedAccountUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -98,6 +102,14 @@ private BankFeedAccount( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the bank feed account. + */ + @JsonProperty("bank_feed_account_url") + public Optional getBankFeedAccountUrl() { + return bankFeedAccountUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -537,7 +549,7 @@ public Optional> getFieldMappings() { } @JsonProperty("remote_data") - public Optional>>> getRemoteData() { + public Optional> getRemoteData() { return remoteData; } @@ -553,7 +565,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(BankFeedAccount other) { - return id.equals(other.id) + return bankFeedAccountUrl.equals(other.bankFeedAccountUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -575,6 +588,7 @@ private boolean equalTo(BankFeedAccount other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.bankFeedAccountUrl, this.id, this.remoteId, this.createdAt, @@ -605,6 +619,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional bankFeedAccountUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -637,7 +653,7 @@ public static final class Builder { private Optional> fieldMappings = Optional.empty(); - private Optional>>> remoteData = Optional.empty(); + private Optional> remoteData = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -645,6 +661,7 @@ public static final class Builder { private Builder() {} public Builder from(BankFeedAccount other) { + bankFeedAccountUrl(other.getBankFeedAccountUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -665,6 +682,20 @@ public Builder from(BankFeedAccount other) { return this; } + /** + *

    The 3rd party URL of the bank feed account.

    + */ + @JsonSetter(value = "bank_feed_account_url", nulls = Nulls.SKIP) + public Builder bankFeedAccountUrl(Optional bankFeedAccountUrl) { + this.bankFeedAccountUrl = bankFeedAccountUrl; + return this; + } + + public Builder bankFeedAccountUrl(String bankFeedAccountUrl) { + this.bankFeedAccountUrl = Optional.ofNullable(bankFeedAccountUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -1200,18 +1231,19 @@ public Builder fieldMappings(Map fieldMappings) { } @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) - public Builder remoteData(Optional>>> remoteData) { + public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; return this; } - public Builder remoteData(List>> remoteData) { + public Builder remoteData(List remoteData) { this.remoteData = Optional.ofNullable(remoteData); return this; } public BankFeedAccount build() { return new BankFeedAccount( + bankFeedAccountUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java index b42fb877c..d5324c61e 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java @@ -22,6 +22,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankFeedAccountRequest.Builder.class) public final class BankFeedAccountRequest { + private final Optional bankFeedAccountUrl; + private final Optional sourceAccountId; private final Optional targetAccountId; @@ -49,6 +51,7 @@ public final class BankFeedAccountRequest { private final Map additionalProperties; private BankFeedAccountRequest( + Optional bankFeedAccountUrl, Optional sourceAccountId, Optional targetAccountId, Optional sourceAccountName, @@ -62,6 +65,7 @@ private BankFeedAccountRequest( Optional> integrationParams, Optional> linkedAccountParams, Map additionalProperties) { + this.bankFeedAccountUrl = bankFeedAccountUrl; this.sourceAccountId = sourceAccountId; this.targetAccountId = targetAccountId; this.sourceAccountName = sourceAccountName; @@ -77,6 +81,14 @@ private BankFeedAccountRequest( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the bank feed account. + */ + @JsonProperty("bank_feed_account_url") + public Optional getBankFeedAccountUrl() { + return bankFeedAccountUrl; + } + /** * @return The unique identifier of the source account from our customer’s platform. */ @@ -495,7 +507,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(BankFeedAccountRequest other) { - return sourceAccountId.equals(other.sourceAccountId) + return bankFeedAccountUrl.equals(other.bankFeedAccountUrl) + && sourceAccountId.equals(other.sourceAccountId) && targetAccountId.equals(other.targetAccountId) && sourceAccountName.equals(other.sourceAccountName) && sourceAccountNumber.equals(other.sourceAccountNumber) @@ -512,6 +525,7 @@ private boolean equalTo(BankFeedAccountRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.bankFeedAccountUrl, this.sourceAccountId, this.targetAccountId, this.sourceAccountName, @@ -537,6 +551,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional bankFeedAccountUrl = Optional.empty(); + private Optional sourceAccountId = Optional.empty(); private Optional targetAccountId = Optional.empty(); @@ -567,6 +583,7 @@ public static final class Builder { private Builder() {} public Builder from(BankFeedAccountRequest other) { + bankFeedAccountUrl(other.getBankFeedAccountUrl()); sourceAccountId(other.getSourceAccountId()); targetAccountId(other.getTargetAccountId()); sourceAccountName(other.getSourceAccountName()); @@ -582,6 +599,20 @@ public Builder from(BankFeedAccountRequest other) { return this; } + /** + *

    The 3rd party URL of the bank feed account.

    + */ + @JsonSetter(value = "bank_feed_account_url", nulls = Nulls.SKIP) + public Builder bankFeedAccountUrl(Optional bankFeedAccountUrl) { + this.bankFeedAccountUrl = bankFeedAccountUrl; + return this; + } + + public Builder bankFeedAccountUrl(String bankFeedAccountUrl) { + this.bankFeedAccountUrl = Optional.ofNullable(bankFeedAccountUrl); + return this; + } + /** *

    The unique identifier of the source account from our customer’s platform.

    */ @@ -1062,6 +1093,7 @@ public Builder linkedAccountParams(Map linkedAccountParams) { public BankFeedAccountRequest build() { return new BankFeedAccountRequest( + bankFeedAccountUrl, sourceAccountId, targetAccountId, sourceAccountName, diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedAccountsListRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedAccountsListRequest.java index 0505039ae..81c82c9c3 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedAccountsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountsListRequest.java @@ -80,7 +80,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -204,7 +204,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java index 9d6c0022a..468abd7dd 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java @@ -21,6 +21,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankFeedTransaction.Builder.class) public final class BankFeedTransaction { + private final Optional bankFeedTransactionUrl; + private final Optional id; private final Optional remoteId; @@ -54,6 +56,7 @@ public final class BankFeedTransaction { private final Map additionalProperties; private BankFeedTransaction( + Optional bankFeedTransactionUrl, Optional id, Optional remoteId, Optional createdAt, @@ -70,6 +73,7 @@ private BankFeedTransaction( Optional remoteWasDeleted, Optional isProcessed, Map additionalProperties) { + this.bankFeedTransactionUrl = bankFeedTransactionUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -88,6 +92,14 @@ private BankFeedTransaction( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the bank feed transaction. + */ + @JsonProperty("bank_feed_transaction_url") + public Optional getBankFeedTransactionUrl() { + return bankFeedTransactionUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -221,7 +233,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(BankFeedTransaction other) { - return id.equals(other.id) + return bankFeedTransactionUrl.equals(other.bankFeedTransactionUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -241,6 +254,7 @@ private boolean equalTo(BankFeedTransaction other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.bankFeedTransactionUrl, this.id, this.remoteId, this.createdAt, @@ -269,6 +283,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional bankFeedTransactionUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -305,6 +321,7 @@ public static final class Builder { private Builder() {} public Builder from(BankFeedTransaction other) { + bankFeedTransactionUrl(other.getBankFeedTransactionUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -323,6 +340,20 @@ public Builder from(BankFeedTransaction other) { return this; } + /** + *

    The 3rd party URL of the bank feed transaction.

    + */ + @JsonSetter(value = "bank_feed_transaction_url", nulls = Nulls.SKIP) + public Builder bankFeedTransactionUrl(Optional bankFeedTransactionUrl) { + this.bankFeedTransactionUrl = bankFeedTransactionUrl; + return this; + } + + public Builder bankFeedTransactionUrl(String bankFeedTransactionUrl) { + this.bankFeedTransactionUrl = Optional.ofNullable(bankFeedTransactionUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -536,6 +567,7 @@ public Builder isProcessed(Boolean isProcessed) { public BankFeedTransaction build() { return new BankFeedTransaction( + bankFeedTransactionUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequest.java index 1b6b95f25..0927a52b8 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/BatchObject.java b/src/main/java/com/merge/api/accounting/types/BatchObject.java new file mode 100644 index 000000000..79e7b77e7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BatchObject.java @@ -0,0 +1,249 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BatchObject.Builder.class) +public final class BatchObject { + private final String itemId; + + private final BatchObjectStatus status; + + private final Optional response; + + private final Map additionalProperties; + + private BatchObject( + String itemId, + BatchObjectStatus status, + Optional response, + Map additionalProperties) { + this.itemId = itemId; + this.status = status; + this.response = response; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("item_id") + public String getItemId() { + return itemId; + } + + /** + * @return Possible per-object statuses: + *
      + *
    • + *

      PENDING - This object has not been processed yet

      + *
    • + *
    • + *

      SUCCESS - This object was successfully POSTed

      + *
    • + *
    • + *

      FAILURE - This object was not successfully POSTed

      + *
    • + *
    • + *

      PENDING - PENDING

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILURE - FAILURE

      + *
    • + *
    + */ + @JsonProperty("status") + public BatchObjectStatus getStatus() { + return status; + } + + @JsonProperty("response") + public Optional getResponse() { + return response; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BatchObject && equalTo((BatchObject) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BatchObject other) { + return itemId.equals(other.itemId) && status.equals(other.status) && response.equals(other.response); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemId, this.status, this.response); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ItemIdStage builder() { + return new Builder(); + } + + public interface ItemIdStage { + StatusStage itemId(@NotNull String itemId); + + Builder from(BatchObject other); + } + + public interface StatusStage { + /** + *

    Possible per-object statuses:

    + *
      + *
    • + *

      PENDING - This object has not been processed yet

      + *
    • + *
    • + *

      SUCCESS - This object was successfully POSTed

      + *
    • + *
    • + *

      FAILURE - This object was not successfully POSTed

      + *
    • + *
    • + *

      PENDING - PENDING

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILURE - FAILURE

      + *
    • + *
    + */ + _FinalStage status(@NotNull BatchObjectStatus status); + } + + public interface _FinalStage { + BatchObject build(); + + _FinalStage response(Optional response); + + _FinalStage response(BatchObjectItemResponse response); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ItemIdStage, StatusStage, _FinalStage { + private String itemId; + + private BatchObjectStatus status; + + private Optional response = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BatchObject other) { + itemId(other.getItemId()); + status(other.getStatus()); + response(other.getResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("item_id") + public StatusStage itemId(@NotNull String itemId) { + this.itemId = itemId; + return this; + } + + /** + *

    Possible per-object statuses:

    + *
      + *
    • + *

      PENDING - This object has not been processed yet

      + *
    • + *
    • + *

      SUCCESS - This object was successfully POSTed

      + *
    • + *
    • + *

      FAILURE - This object was not successfully POSTed

      + *
    • + *
    • + *

      PENDING - PENDING

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILURE - FAILURE

      + *
    • + *
    + *

    Possible per-object statuses:

    + *
      + *
    • + *

      PENDING - This object has not been processed yet

      + *
    • + *
    • + *

      SUCCESS - This object was successfully POSTed

      + *
    • + *
    • + *

      FAILURE - This object was not successfully POSTed

      + *
    • + *
    • + *

      PENDING - PENDING

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILURE - FAILURE

      + *
    • + *
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(@NotNull BatchObjectStatus status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage response(BatchObjectItemResponse response) { + this.response = Optional.ofNullable(response); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response", nulls = Nulls.SKIP) + public _FinalStage response(Optional response) { + this.response = response; + return this; + } + + @java.lang.Override + public BatchObject build() { + return new BatchObject(itemId, status, response, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BatchObjectItemResponse.java b/src/main/java/com/merge/api/accounting/types/BatchObjectItemResponse.java new file mode 100644 index 000000000..93a8eff26 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BatchObjectItemResponse.java @@ -0,0 +1,120 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BatchObjectItemResponse.Builder.class) +public final class BatchObjectItemResponse { + private final Optional mergeCommonModelId; + + private final Optional errorMessage; + + private final Map additionalProperties; + + private BatchObjectItemResponse( + Optional mergeCommonModelId, + Optional errorMessage, + Map additionalProperties) { + this.mergeCommonModelId = mergeCommonModelId; + this.errorMessage = errorMessage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("merge_common_model_id") + public Optional getMergeCommonModelId() { + return mergeCommonModelId; + } + + @JsonProperty("error_message") + public Optional getErrorMessage() { + return errorMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BatchObjectItemResponse && equalTo((BatchObjectItemResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BatchObjectItemResponse other) { + return mergeCommonModelId.equals(other.mergeCommonModelId) && errorMessage.equals(other.errorMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.mergeCommonModelId, this.errorMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional mergeCommonModelId = Optional.empty(); + + private Optional errorMessage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(BatchObjectItemResponse other) { + mergeCommonModelId(other.getMergeCommonModelId()); + errorMessage(other.getErrorMessage()); + return this; + } + + @JsonSetter(value = "merge_common_model_id", nulls = Nulls.SKIP) + public Builder mergeCommonModelId(Optional mergeCommonModelId) { + this.mergeCommonModelId = mergeCommonModelId; + return this; + } + + public Builder mergeCommonModelId(String mergeCommonModelId) { + this.mergeCommonModelId = Optional.ofNullable(mergeCommonModelId); + return this; + } + + @JsonSetter(value = "error_message", nulls = Nulls.SKIP) + public Builder errorMessage(Optional errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + public Builder errorMessage(String errorMessage) { + this.errorMessage = Optional.ofNullable(errorMessage); + return this; + } + + public BatchObjectItemResponse build() { + return new BatchObjectItemResponse(mergeCommonModelId, errorMessage, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BatchObjectStatus.java b/src/main/java/com/merge/api/accounting/types/BatchObjectStatus.java new file mode 100644 index 000000000..b65c9bf97 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BatchObjectStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = BatchObjectStatus.Deserializer.class) +public final class BatchObjectStatus { + private final Object value; + + private final int type; + + private BatchObjectStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((BatchObjectStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BatchObjectStatus && equalTo((BatchObjectStatus) other); + } + + private boolean equalTo(BatchObjectStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static BatchObjectStatus of(BatchObjectStatusEnum value) { + return new BatchObjectStatus(value, 0); + } + + public static BatchObjectStatus of(String value) { + return new BatchObjectStatus(value, 1); + } + + public interface Visitor { + T visit(BatchObjectStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BatchObjectStatus.class); + } + + @java.lang.Override + public BatchObjectStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, BatchObjectStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BatchObjectStatusEnum.java b/src/main/java/com/merge/api/accounting/types/BatchObjectStatusEnum.java new file mode 100644 index 000000000..e5c0d5c80 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BatchObjectStatusEnum.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BatchObjectStatusEnum { + public static final BatchObjectStatusEnum FAILURE = new BatchObjectStatusEnum(Value.FAILURE, "FAILURE"); + + public static final BatchObjectStatusEnum SUCCESS = new BatchObjectStatusEnum(Value.SUCCESS, "SUCCESS"); + + public static final BatchObjectStatusEnum PENDING = new BatchObjectStatusEnum(Value.PENDING, "PENDING"); + + private final Value value; + + private final String string; + + BatchObjectStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BatchObjectStatusEnum + && this.string.equals(((BatchObjectStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILURE: + return visitor.visitFailure(); + case SUCCESS: + return visitor.visitSuccess(); + case PENDING: + return visitor.visitPending(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BatchObjectStatusEnum valueOf(String value) { + switch (value) { + case "FAILURE": + return FAILURE; + case "SUCCESS": + return SUCCESS; + case "PENDING": + return PENDING; + default: + return new BatchObjectStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + SUCCESS, + + FAILURE, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitSuccess(); + + T visitFailure(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BatchObjectsResponse.java b/src/main/java/com/merge/api/accounting/types/BatchObjectsResponse.java new file mode 100644 index 000000000..4ac8c32a4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BatchObjectsResponse.java @@ -0,0 +1,383 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = BatchObjectsResponse.Builder.class) +public final class BatchObjectsResponse { + private final String batchId; + + private final BatchObjectsResponseStatus status; + + private final int totalCount; + + private final List objects; + + private final Map additionalProperties; + + private BatchObjectsResponse( + String batchId, + BatchObjectsResponseStatus status, + int totalCount, + List objects, + Map additionalProperties) { + this.batchId = batchId; + this.status = status; + this.totalCount = totalCount; + this.objects = objects; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the batch. + */ + @JsonProperty("batch_id") + public String getBatchId() { + return batchId; + } + + /** + * @return Possible overall statuses: + *
      + *
    • + *

      ENQUEUED - The request has been received and a task has been enqueued for processing

      + *
    • + *
    • + *

      IN_PROGRESS - The enqueued task is being processed

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - The task has been processed, but not all objects were written successfully

      + *
    • + *
    • + *

      SUCCESS - The task has been processed, and all objects were written successfully

      + *
    • + *
    • + *

      FAILED - The task has been processed, but ran into an error while processing

      + *
    • + *
    • + *

      RATE_LIMITED - The request was received but ran into rate limits while processing. The rate limited objects are being retried.

      + *
    • + *
    • + *

      ENQUEUED - ENQUEUED

      + *
    • + *
    • + *

      IN_PROGRESS - IN_PROGRESS

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - PARTIAL_SUCCESS

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILED - FAILED

      + *
    • + *
    • + *

      RATE_LIMITED - RATE_LIMITED

      + *
    • + *
    + */ + @JsonProperty("status") + public BatchObjectsResponseStatus getStatus() { + return status; + } + + /** + * @return The total number of objects in the batch. + */ + @JsonProperty("total_count") + public int getTotalCount() { + return totalCount; + } + + @JsonProperty("objects") + public List getObjects() { + return objects; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BatchObjectsResponse && equalTo((BatchObjectsResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(BatchObjectsResponse other) { + return batchId.equals(other.batchId) + && status.equals(other.status) + && totalCount == other.totalCount + && objects.equals(other.objects); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.batchId, this.status, this.totalCount, this.objects); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BatchIdStage builder() { + return new Builder(); + } + + public interface BatchIdStage { + /** + *

    The ID of the batch.

    + */ + StatusStage batchId(@NotNull String batchId); + + Builder from(BatchObjectsResponse other); + } + + public interface StatusStage { + /** + *

    Possible overall statuses:

    + *
      + *
    • + *

      ENQUEUED - The request has been received and a task has been enqueued for processing

      + *
    • + *
    • + *

      IN_PROGRESS - The enqueued task is being processed

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - The task has been processed, but not all objects were written successfully

      + *
    • + *
    • + *

      SUCCESS - The task has been processed, and all objects were written successfully

      + *
    • + *
    • + *

      FAILED - The task has been processed, but ran into an error while processing

      + *
    • + *
    • + *

      RATE_LIMITED - The request was received but ran into rate limits while processing. The rate limited objects are being retried.

      + *
    • + *
    • + *

      ENQUEUED - ENQUEUED

      + *
    • + *
    • + *

      IN_PROGRESS - IN_PROGRESS

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - PARTIAL_SUCCESS

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILED - FAILED

      + *
    • + *
    • + *

      RATE_LIMITED - RATE_LIMITED

      + *
    • + *
    + */ + TotalCountStage status(@NotNull BatchObjectsResponseStatus status); + } + + public interface TotalCountStage { + /** + *

    The total number of objects in the batch.

    + */ + _FinalStage totalCount(int totalCount); + } + + public interface _FinalStage { + BatchObjectsResponse build(); + + _FinalStage objects(List objects); + + _FinalStage addObjects(BatchObject objects); + + _FinalStage addAllObjects(List objects); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BatchIdStage, StatusStage, TotalCountStage, _FinalStage { + private String batchId; + + private BatchObjectsResponseStatus status; + + private int totalCount; + + private List objects = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(BatchObjectsResponse other) { + batchId(other.getBatchId()); + status(other.getStatus()); + totalCount(other.getTotalCount()); + objects(other.getObjects()); + return this; + } + + /** + *

    The ID of the batch.

    + *

    The ID of the batch.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("batch_id") + public StatusStage batchId(@NotNull String batchId) { + this.batchId = batchId; + return this; + } + + /** + *

    Possible overall statuses:

    + *
      + *
    • + *

      ENQUEUED - The request has been received and a task has been enqueued for processing

      + *
    • + *
    • + *

      IN_PROGRESS - The enqueued task is being processed

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - The task has been processed, but not all objects were written successfully

      + *
    • + *
    • + *

      SUCCESS - The task has been processed, and all objects were written successfully

      + *
    • + *
    • + *

      FAILED - The task has been processed, but ran into an error while processing

      + *
    • + *
    • + *

      RATE_LIMITED - The request was received but ran into rate limits while processing. The rate limited objects are being retried.

      + *
    • + *
    • + *

      ENQUEUED - ENQUEUED

      + *
    • + *
    • + *

      IN_PROGRESS - IN_PROGRESS

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - PARTIAL_SUCCESS

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILED - FAILED

      + *
    • + *
    • + *

      RATE_LIMITED - RATE_LIMITED

      + *
    • + *
    + *

    Possible overall statuses:

    + *
      + *
    • + *

      ENQUEUED - The request has been received and a task has been enqueued for processing

      + *
    • + *
    • + *

      IN_PROGRESS - The enqueued task is being processed

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - The task has been processed, but not all objects were written successfully

      + *
    • + *
    • + *

      SUCCESS - The task has been processed, and all objects were written successfully

      + *
    • + *
    • + *

      FAILED - The task has been processed, but ran into an error while processing

      + *
    • + *
    • + *

      RATE_LIMITED - The request was received but ran into rate limits while processing. The rate limited objects are being retried.

      + *
    • + *
    • + *

      ENQUEUED - ENQUEUED

      + *
    • + *
    • + *

      IN_PROGRESS - IN_PROGRESS

      + *
    • + *
    • + *

      PARTIAL_SUCCESS - PARTIAL_SUCCESS

      + *
    • + *
    • + *

      SUCCESS - SUCCESS

      + *
    • + *
    • + *

      FAILED - FAILED

      + *
    • + *
    • + *

      RATE_LIMITED - RATE_LIMITED

      + *
    • + *
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public TotalCountStage status(@NotNull BatchObjectsResponseStatus status) { + this.status = status; + return this; + } + + /** + *

    The total number of objects in the batch.

    + *

    The total number of objects in the batch.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("total_count") + public _FinalStage totalCount(int totalCount) { + this.totalCount = totalCount; + return this; + } + + @java.lang.Override + public _FinalStage addAllObjects(List objects) { + if (objects != null) { + this.objects.addAll(objects); + } + return this; + } + + @java.lang.Override + public _FinalStage addObjects(BatchObject objects) { + this.objects.add(objects); + return this; + } + + @java.lang.Override + @JsonSetter(value = "objects", nulls = Nulls.SKIP) + public _FinalStage objects(List objects) { + this.objects.clear(); + if (objects != null) { + this.objects.addAll(objects); + } + return this; + } + + @java.lang.Override + public BatchObjectsResponse build() { + return new BatchObjectsResponse(batchId, status, totalCount, objects, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BatchObjectsResponseStatus.java b/src/main/java/com/merge/api/accounting/types/BatchObjectsResponseStatus.java new file mode 100644 index 000000000..b94e04c2c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BatchObjectsResponseStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = BatchObjectsResponseStatus.Deserializer.class) +public final class BatchObjectsResponseStatus { + private final Object value; + + private final int type; + + private BatchObjectsResponseStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((BatchObjectsResponseStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof BatchObjectsResponseStatus && equalTo((BatchObjectsResponseStatus) other); + } + + private boolean equalTo(BatchObjectsResponseStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static BatchObjectsResponseStatus of(BatchObjectsResponseStatusEnum value) { + return new BatchObjectsResponseStatus(value, 0); + } + + public static BatchObjectsResponseStatus of(String value) { + return new BatchObjectsResponseStatus(value, 1); + } + + public interface Visitor { + T visit(BatchObjectsResponseStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(BatchObjectsResponseStatus.class); + } + + @java.lang.Override + public BatchObjectsResponseStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, BatchObjectsResponseStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BatchObjectsResponseStatusEnum.java b/src/main/java/com/merge/api/accounting/types/BatchObjectsResponseStatusEnum.java new file mode 100644 index 000000000..03321d73a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BatchObjectsResponseStatusEnum.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BatchObjectsResponseStatusEnum { + public static final BatchObjectsResponseStatusEnum PARTIAL_SUCCESS = + new BatchObjectsResponseStatusEnum(Value.PARTIAL_SUCCESS, "PARTIAL_SUCCESS"); + + public static final BatchObjectsResponseStatusEnum ENQUEUED = + new BatchObjectsResponseStatusEnum(Value.ENQUEUED, "ENQUEUED"); + + public static final BatchObjectsResponseStatusEnum IN_PROGRESS = + new BatchObjectsResponseStatusEnum(Value.IN_PROGRESS, "IN_PROGRESS"); + + public static final BatchObjectsResponseStatusEnum RATE_LIMITED = + new BatchObjectsResponseStatusEnum(Value.RATE_LIMITED, "RATE_LIMITED"); + + public static final BatchObjectsResponseStatusEnum SUCCESS = + new BatchObjectsResponseStatusEnum(Value.SUCCESS, "SUCCESS"); + + public static final BatchObjectsResponseStatusEnum FAILED = + new BatchObjectsResponseStatusEnum(Value.FAILED, "FAILED"); + + private final Value value; + + private final String string; + + BatchObjectsResponseStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof BatchObjectsResponseStatusEnum + && this.string.equals(((BatchObjectsResponseStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PARTIAL_SUCCESS: + return visitor.visitPartialSuccess(); + case ENQUEUED: + return visitor.visitEnqueued(); + case IN_PROGRESS: + return visitor.visitInProgress(); + case RATE_LIMITED: + return visitor.visitRateLimited(); + case SUCCESS: + return visitor.visitSuccess(); + case FAILED: + return visitor.visitFailed(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BatchObjectsResponseStatusEnum valueOf(String value) { + switch (value) { + case "PARTIAL_SUCCESS": + return PARTIAL_SUCCESS; + case "ENQUEUED": + return ENQUEUED; + case "IN_PROGRESS": + return IN_PROGRESS; + case "RATE_LIMITED": + return RATE_LIMITED; + case "SUCCESS": + return SUCCESS; + case "FAILED": + return FAILED; + default: + return new BatchObjectsResponseStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ENQUEUED, + + IN_PROGRESS, + + PARTIAL_SUCCESS, + + SUCCESS, + + FAILED, + + RATE_LIMITED, + + UNKNOWN + } + + public interface Visitor { + T visitEnqueued(); + + T visitInProgress(); + + T visitPartialSuccess(); + + T visitSuccess(); + + T visitFailed(); + + T visitRateLimited(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequest.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequest.java index 16101b25f..8f28b8050 100644 --- a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/CategoriesEnum.java b/src/main/java/com/merge/api/accounting/types/CategoriesEnum.java index dddcf89d1..4540b0ed3 100644 --- a/src/main/java/com/merge/api/accounting/types/CategoriesEnum.java +++ b/src/main/java/com/merge/api/accounting/types/CategoriesEnum.java @@ -11,6 +11,8 @@ public final class CategoriesEnum { public static final CategoriesEnum TICKETING = new CategoriesEnum(Value.TICKETING, "ticketing"); + public static final CategoriesEnum KNOWLEDGEBASE = new CategoriesEnum(Value.KNOWLEDGEBASE, "knowledgebase"); + public static final CategoriesEnum CRM = new CategoriesEnum(Value.CRM, "crm"); public static final CategoriesEnum FILESTORAGE = new CategoriesEnum(Value.FILESTORAGE, "filestorage"); @@ -57,6 +59,8 @@ public T visit(Visitor visitor) { return visitor.visitHris(); case TICKETING: return visitor.visitTicketing(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); case CRM: return visitor.visitCrm(); case FILESTORAGE: @@ -80,6 +84,8 @@ public static CategoriesEnum valueOf(String value) { return HRIS; case "ticketing": return TICKETING; + case "knowledgebase": + return KNOWLEDGEBASE; case "crm": return CRM; case "filestorage": @@ -110,6 +116,8 @@ public enum Value { FILESTORAGE, + KNOWLEDGEBASE, + UNKNOWN } @@ -128,6 +136,8 @@ public interface Visitor { T visitFilestorage(); + T visitKnowledgebase(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/accounting/types/CategoryEnum.java b/src/main/java/com/merge/api/accounting/types/CategoryEnum.java index 84b5677df..3a0ce0229 100644 --- a/src/main/java/com/merge/api/accounting/types/CategoryEnum.java +++ b/src/main/java/com/merge/api/accounting/types/CategoryEnum.java @@ -11,6 +11,8 @@ public final class CategoryEnum { public static final CategoryEnum TICKETING = new CategoryEnum(Value.TICKETING, "ticketing"); + public static final CategoryEnum KNOWLEDGEBASE = new CategoryEnum(Value.KNOWLEDGEBASE, "knowledgebase"); + public static final CategoryEnum CRM = new CategoryEnum(Value.CRM, "crm"); public static final CategoryEnum FILESTORAGE = new CategoryEnum(Value.FILESTORAGE, "filestorage"); @@ -56,6 +58,8 @@ public T visit(Visitor visitor) { return visitor.visitHris(); case TICKETING: return visitor.visitTicketing(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); case CRM: return visitor.visitCrm(); case FILESTORAGE: @@ -79,6 +83,8 @@ public static CategoryEnum valueOf(String value) { return HRIS; case "ticketing": return TICKETING; + case "knowledgebase": + return KNOWLEDGEBASE; case "crm": return CRM; case "filestorage": @@ -109,6 +115,8 @@ public enum Value { FILESTORAGE, + KNOWLEDGEBASE, + UNKNOWN } @@ -127,6 +135,8 @@ public interface Visitor { T visitFilestorage(); + T visitKnowledgebase(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfo.java b/src/main/java/com/merge/api/accounting/types/CompanyInfo.java index 1a963f04d..c9287bfb4 100644 --- a/src/main/java/com/merge/api/accounting/types/CompanyInfo.java +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfo.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CompanyInfo.Builder.class) public final class CompanyInfo { + private final Optional companyInfoUrl; + private final Optional id; private final Optional remoteId; @@ -41,15 +43,15 @@ public final class CompanyInfo { private final Optional fiscalYearEndDay; - private final Optional currency; + private final Optional currency; private final Optional remoteCreatedAt; private final Optional>> urls; - private final Optional> addresses; + private final Optional> addresses; - private final Optional> phoneNumbers; + private final Optional> phoneNumbers; private final Optional remoteWasDeleted; @@ -60,6 +62,7 @@ public final class CompanyInfo { private final Map additionalProperties; private CompanyInfo( + Optional companyInfoUrl, Optional id, Optional remoteId, Optional createdAt, @@ -69,15 +72,16 @@ private CompanyInfo( Optional taxNumber, Optional fiscalYearEndMonth, Optional fiscalYearEndDay, - Optional currency, + Optional currency, Optional remoteCreatedAt, Optional>> urls, - Optional> addresses, - Optional> phoneNumbers, + Optional> addresses, + Optional> phoneNumbers, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { + this.companyInfoUrl = companyInfoUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -98,6 +102,14 @@ private CompanyInfo( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the company info. + */ + @JsonProperty("company_info_url") + public Optional getCompanyInfoUrl() { + return companyInfoUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -167,8 +179,319 @@ public Optional getFiscalYearEndDay() { return fiscalYearEndDay; } + /** + * @return The currency set in the company's accounting platform. + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -189,12 +512,12 @@ public Optional>> getUrls() { } @JsonProperty("addresses") - public Optional> getAddresses() { + public Optional> getAddresses() { return addresses; } @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { + public Optional> getPhoneNumbers() { return phoneNumbers; } @@ -228,7 +551,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(CompanyInfo other) { - return id.equals(other.id) + return companyInfoUrl.equals(other.companyInfoUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -250,6 +574,7 @@ private boolean equalTo(CompanyInfo other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.companyInfoUrl, this.id, this.remoteId, this.createdAt, @@ -280,6 +605,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional companyInfoUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -298,15 +625,15 @@ public static final class Builder { private Optional fiscalYearEndDay = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional remoteCreatedAt = Optional.empty(); private Optional>> urls = Optional.empty(); - private Optional> addresses = Optional.empty(); + private Optional> addresses = Optional.empty(); - private Optional> phoneNumbers = Optional.empty(); + private Optional> phoneNumbers = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -320,6 +647,7 @@ public static final class Builder { private Builder() {} public Builder from(CompanyInfo other) { + companyInfoUrl(other.getCompanyInfoUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -340,6 +668,20 @@ public Builder from(CompanyInfo other) { return this; } + /** + *

    The 3rd party URL of the company info.

    + */ + @JsonSetter(value = "company_info_url", nulls = Nulls.SKIP) + public Builder companyInfoUrl(Optional companyInfoUrl) { + this.companyInfoUrl = companyInfoUrl; + return this; + } + + public Builder companyInfoUrl(String companyInfoUrl) { + this.companyInfoUrl = Optional.ofNullable(companyInfoUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -463,13 +805,324 @@ public Builder fiscalYearEndDay(Integer fiscalYearEndDay) { return this; } + /** + *

    The currency set in the company's accounting platform.

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(JsonNode currency) { + public Builder currency(CompanyInfoCurrency currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -503,23 +1156,23 @@ public Builder urls(List> urls) { } @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional> addresses) { + public Builder addresses(Optional> addresses) { this.addresses = addresses; return this; } - public Builder addresses(List
    addresses) { + public Builder addresses(List addresses) { this.addresses = Optional.ofNullable(addresses); return this; } @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { + public Builder phoneNumbers(Optional> phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Builder phoneNumbers(List phoneNumbers) { + public Builder phoneNumbers(List phoneNumbers) { this.phoneNumbers = Optional.ofNullable(phoneNumbers); return this; } @@ -562,6 +1215,7 @@ public Builder remoteData(List remoteData) { public CompanyInfo build() { return new CompanyInfo( + companyInfoUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfoAddressesItem.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoAddressesItem.java new file mode 100644 index 000000000..3d8d003e1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoAddressesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CompanyInfoAddressesItem.Deserializer.class) +public final class CompanyInfoAddressesItem { + private final Object value; + + private final int type; + + private CompanyInfoAddressesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Address) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyInfoAddressesItem && equalTo((CompanyInfoAddressesItem) other); + } + + private boolean equalTo(CompanyInfoAddressesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CompanyInfoAddressesItem of(String value) { + return new CompanyInfoAddressesItem(value, 0); + } + + public static CompanyInfoAddressesItem of(Address value) { + return new CompanyInfoAddressesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Address value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CompanyInfoAddressesItem.class); + } + + @java.lang.Override + public CompanyInfoAddressesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Address.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfoCurrency.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoCurrency.java new file mode 100644 index 000000000..9c6e1cc27 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CompanyInfoCurrency.Deserializer.class) +public final class CompanyInfoCurrency { + private final Object value; + + private final int type; + + private CompanyInfoCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyInfoCurrency && equalTo((CompanyInfoCurrency) other); + } + + private boolean equalTo(CompanyInfoCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CompanyInfoCurrency of(TransactionCurrencyEnum value) { + return new CompanyInfoCurrency(value, 0); + } + + public static CompanyInfoCurrency of(String value) { + return new CompanyInfoCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CompanyInfoCurrency.class); + } + + @java.lang.Override + public CompanyInfoCurrency deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java index 6ba60196d..7b0034b09 100644 --- a/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java @@ -41,6 +41,8 @@ public final class CompanyInfoListRequest { private final Optional modifiedBefore; + private final Optional name; + private final Optional pageSize; private final Optional remoteId; @@ -57,6 +59,7 @@ private CompanyInfoListRequest( Optional includeShellData, Optional modifiedAfter, Optional modifiedBefore, + Optional name, Optional pageSize, Optional remoteId, Map additionalProperties) { @@ -69,6 +72,7 @@ private CompanyInfoListRequest( this.includeShellData = includeShellData; this.modifiedAfter = modifiedAfter; this.modifiedBefore = modifiedBefore; + this.name = name; this.pageSize = pageSize; this.remoteId = remoteId; this.additionalProperties = additionalProperties; @@ -147,7 +151,15 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return If provided, will only return CompanyInfo objects with this name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -183,6 +195,7 @@ private boolean equalTo(CompanyInfoListRequest other) { && includeShellData.equals(other.includeShellData) && modifiedAfter.equals(other.modifiedAfter) && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) && pageSize.equals(other.pageSize) && remoteId.equals(other.remoteId); } @@ -199,6 +212,7 @@ public int hashCode() { this.includeShellData, this.modifiedAfter, this.modifiedBefore, + this.name, this.pageSize, this.remoteId); } @@ -232,6 +246,8 @@ public static final class Builder { private Optional modifiedBefore = Optional.empty(); + private Optional name = Optional.empty(); + private Optional pageSize = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -251,6 +267,7 @@ public Builder from(CompanyInfoListRequest other) { includeShellData(other.getIncludeShellData()); modifiedAfter(other.getModifiedAfter()); modifiedBefore(other.getModifiedBefore()); + name(other.getName()); pageSize(other.getPageSize()); remoteId(other.getRemoteId()); return this; @@ -388,7 +405,21 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    If provided, will only return CompanyInfo objects with this name.

    + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -426,6 +457,7 @@ public CompanyInfoListRequest build() { includeShellData, modifiedAfter, modifiedBefore, + name, pageSize, remoteId, additionalProperties); diff --git a/src/main/java/com/merge/api/accounting/types/CompanyInfoPhoneNumbersItem.java b/src/main/java/com/merge/api/accounting/types/CompanyInfoPhoneNumbersItem.java new file mode 100644 index 000000000..2173bad61 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoPhoneNumbersItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CompanyInfoPhoneNumbersItem.Deserializer.class) +public final class CompanyInfoPhoneNumbersItem { + private final Object value; + + private final int type; + + private CompanyInfoPhoneNumbersItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((AccountingPhoneNumber) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompanyInfoPhoneNumbersItem && equalTo((CompanyInfoPhoneNumbersItem) other); + } + + private boolean equalTo(CompanyInfoPhoneNumbersItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CompanyInfoPhoneNumbersItem of(String value) { + return new CompanyInfoPhoneNumbersItem(value, 0); + } + + public static CompanyInfoPhoneNumbersItem of(AccountingPhoneNumber value) { + return new CompanyInfoPhoneNumbersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPhoneNumber value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CompanyInfoPhoneNumbersItem.class); + } + + @java.lang.Override + public CompanyInfoPhoneNumbersItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountingPhoneNumber.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/Contact.java b/src/main/java/com/merge/api/accounting/types/Contact.java index 4bb10bc51..fc48c323c 100644 --- a/src/main/java/com/merge/api/accounting/types/Contact.java +++ b/src/main/java/com/merge/api/accounting/types/Contact.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Contact.Builder.class) public final class Contact { + private final Optional contactUrl; + private final Optional id; private final Optional remoteId; @@ -47,11 +49,11 @@ public final class Contact { private final Optional remoteUpdatedAt; - private final Optional company; + private final Optional company; - private final Optional>> addresses; + private final Optional> addresses; - private final Optional> phoneNumbers; + private final Optional> phoneNumbers; private final Optional remoteWasDeleted; @@ -64,6 +66,7 @@ public final class Contact { private final Map additionalProperties; private Contact( + Optional contactUrl, Optional id, Optional remoteId, Optional createdAt, @@ -76,14 +79,15 @@ private Contact( Optional status, Optional currency, Optional remoteUpdatedAt, - Optional company, - Optional>> addresses, - Optional> phoneNumbers, + Optional company, + Optional> addresses, + Optional> phoneNumbers, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, Optional> remoteFields, Map additionalProperties) { + this.contactUrl = contactUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -106,6 +110,14 @@ private Contact( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the contact. + */ + @JsonProperty("contact_url") + public Optional getContactUrl() { + return contactUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -207,7 +219,7 @@ public Optional getRemoteUpdatedAt() { * @return The company the contact belongs to. */ @JsonProperty("company") - public Optional getCompany() { + public Optional getCompany() { return company; } @@ -215,7 +227,7 @@ public Optional getCompany() { * @return Address object IDs for the given Contacts object. */ @JsonProperty("addresses") - public Optional>> getAddresses() { + public Optional> getAddresses() { return addresses; } @@ -223,7 +235,7 @@ public Optional>> getAddresses() { * @return AccountingPhoneNumber object for the given Contacts object. */ @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { + public Optional> getPhoneNumbers() { return phoneNumbers; } @@ -262,7 +274,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(Contact other) { - return id.equals(other.id) + return contactUrl.equals(other.contactUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -286,6 +299,7 @@ private boolean equalTo(Contact other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.contactUrl, this.id, this.remoteId, this.createdAt, @@ -318,6 +332,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional contactUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -342,11 +358,11 @@ public static final class Builder { private Optional remoteUpdatedAt = Optional.empty(); - private Optional company = Optional.empty(); + private Optional company = Optional.empty(); - private Optional>> addresses = Optional.empty(); + private Optional> addresses = Optional.empty(); - private Optional> phoneNumbers = Optional.empty(); + private Optional> phoneNumbers = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -362,6 +378,7 @@ public static final class Builder { private Builder() {} public Builder from(Contact other) { + contactUrl(other.getContactUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -384,6 +401,20 @@ public Builder from(Contact other) { return this; } + /** + *

    The 3rd party URL of the contact.

    + */ + @JsonSetter(value = "contact_url", nulls = Nulls.SKIP) + public Builder contactUrl(Optional contactUrl) { + this.contactUrl = contactUrl; + return this; + } + + public Builder contactUrl(String contactUrl) { + this.contactUrl = Optional.ofNullable(contactUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -557,12 +588,12 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { *

    The company the contact belongs to.

    */ @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { + public Builder company(Optional company) { this.company = company; return this; } - public Builder company(String company) { + public Builder company(ContactCompany company) { this.company = Optional.ofNullable(company); return this; } @@ -571,12 +602,12 @@ public Builder company(String company) { *

    Address object IDs for the given Contacts object.

    */ @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional>> addresses) { + public Builder addresses(Optional> addresses) { this.addresses = addresses; return this; } - public Builder addresses(List> addresses) { + public Builder addresses(List addresses) { this.addresses = Optional.ofNullable(addresses); return this; } @@ -585,12 +616,12 @@ public Builder addresses(List> addresses) { *

    AccountingPhoneNumber object for the given Contacts object.

    */ @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { + public Builder phoneNumbers(Optional> phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Builder phoneNumbers(List phoneNumbers) { + public Builder phoneNumbers(List phoneNumbers) { this.phoneNumbers = Optional.ofNullable(phoneNumbers); return this; } @@ -644,6 +675,7 @@ public Builder remoteFields(List remoteFields) { public Contact build() { return new Contact( + contactUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/ContactCompany.java b/src/main/java/com/merge/api/accounting/types/ContactCompany.java new file mode 100644 index 000000000..5c2e297f5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactCompany.Deserializer.class) +public final class ContactCompany { + private final Object value; + + private final int type; + + private ContactCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactCompany && equalTo((ContactCompany) other); + } + + private boolean equalTo(ContactCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactCompany of(String value) { + return new ContactCompany(value, 0); + } + + public static ContactCompany of(CompanyInfo value) { + return new ContactCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactCompany.class); + } + + @java.lang.Override + public ContactCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactPhoneNumbersItem.java b/src/main/java/com/merge/api/accounting/types/ContactPhoneNumbersItem.java new file mode 100644 index 000000000..1444153cd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactPhoneNumbersItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactPhoneNumbersItem.Deserializer.class) +public final class ContactPhoneNumbersItem { + private final Object value; + + private final int type; + + private ContactPhoneNumbersItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((AccountingPhoneNumber) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactPhoneNumbersItem && equalTo((ContactPhoneNumbersItem) other); + } + + private boolean equalTo(ContactPhoneNumbersItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactPhoneNumbersItem of(String value) { + return new ContactPhoneNumbersItem(value, 0); + } + + public static ContactPhoneNumbersItem of(AccountingPhoneNumber value) { + return new ContactPhoneNumbersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPhoneNumber value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactPhoneNumbersItem.class); + } + + @java.lang.Override + public ContactPhoneNumbersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountingPhoneNumber.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactRequest.java b/src/main/java/com/merge/api/accounting/types/ContactRequest.java index b7fc0a8fc..70c427999 100644 --- a/src/main/java/com/merge/api/accounting/types/ContactRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactRequest.java @@ -22,6 +22,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ContactRequest.Builder.class) public final class ContactRequest { + private final Optional contactUrl; + private final Optional name; private final Optional isSupplier; @@ -36,11 +38,11 @@ public final class ContactRequest { private final Optional currency; - private final Optional company; + private final Optional company; - private final Optional>> addresses; + private final Optional> addresses; - private final Optional> phoneNumbers; + private final Optional> phoneNumbers; private final Optional> integrationParams; @@ -51,6 +53,7 @@ public final class ContactRequest { private final Map additionalProperties; private ContactRequest( + Optional contactUrl, Optional name, Optional isSupplier, Optional isCustomer, @@ -58,13 +61,14 @@ private ContactRequest( Optional taxNumber, Optional status, Optional currency, - Optional company, - Optional>> addresses, - Optional> phoneNumbers, + Optional company, + Optional> addresses, + Optional> phoneNumbers, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, Map additionalProperties) { + this.contactUrl = contactUrl; this.name = name; this.isSupplier = isSupplier; this.isCustomer = isCustomer; @@ -81,6 +85,14 @@ private ContactRequest( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the contact. + */ + @JsonProperty("contact_url") + public Optional getContactUrl() { + return contactUrl; + } + /** * @return The contact's name. */ @@ -145,7 +157,7 @@ public Optional getCurrency() { * @return The company the contact belongs to. */ @JsonProperty("company") - public Optional getCompany() { + public Optional getCompany() { return company; } @@ -153,7 +165,7 @@ public Optional getCompany() { * @return Address object IDs for the given Contacts object. */ @JsonProperty("addresses") - public Optional>> getAddresses() { + public Optional> getAddresses() { return addresses; } @@ -161,7 +173,7 @@ public Optional>> getAddresses() { * @return AccountingPhoneNumber object for the given Contacts object. */ @JsonProperty("phone_numbers") - public Optional> getPhoneNumbers() { + public Optional> getPhoneNumbers() { return phoneNumbers; } @@ -192,7 +204,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(ContactRequest other) { - return name.equals(other.name) + return contactUrl.equals(other.contactUrl) + && name.equals(other.name) && isSupplier.equals(other.isSupplier) && isCustomer.equals(other.isCustomer) && emailAddress.equals(other.emailAddress) @@ -210,6 +223,7 @@ private boolean equalTo(ContactRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.contactUrl, this.name, this.isSupplier, this.isCustomer, @@ -236,6 +250,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional contactUrl = Optional.empty(); + private Optional name = Optional.empty(); private Optional isSupplier = Optional.empty(); @@ -250,11 +266,11 @@ public static final class Builder { private Optional currency = Optional.empty(); - private Optional company = Optional.empty(); + private Optional company = Optional.empty(); - private Optional>> addresses = Optional.empty(); + private Optional> addresses = Optional.empty(); - private Optional> phoneNumbers = Optional.empty(); + private Optional> phoneNumbers = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -268,6 +284,7 @@ public static final class Builder { private Builder() {} public Builder from(ContactRequest other) { + contactUrl(other.getContactUrl()); name(other.getName()); isSupplier(other.getIsSupplier()); isCustomer(other.getIsCustomer()); @@ -284,6 +301,20 @@ public Builder from(ContactRequest other) { return this; } + /** + *

    The 3rd party URL of the contact.

    + */ + @JsonSetter(value = "contact_url", nulls = Nulls.SKIP) + public Builder contactUrl(Optional contactUrl) { + this.contactUrl = contactUrl; + return this; + } + + public Builder contactUrl(String contactUrl) { + this.contactUrl = Optional.ofNullable(contactUrl); + return this; + } + /** *

    The contact's name.

    */ @@ -390,12 +421,12 @@ public Builder currency(String currency) { *

    The company the contact belongs to.

    */ @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { + public Builder company(Optional company) { this.company = company; return this; } - public Builder company(String company) { + public Builder company(ContactRequestCompany company) { this.company = Optional.ofNullable(company); return this; } @@ -404,12 +435,12 @@ public Builder company(String company) { *

    Address object IDs for the given Contacts object.

    */ @JsonSetter(value = "addresses", nulls = Nulls.SKIP) - public Builder addresses(Optional>> addresses) { + public Builder addresses(Optional> addresses) { this.addresses = addresses; return this; } - public Builder addresses(List> addresses) { + public Builder addresses(List addresses) { this.addresses = Optional.ofNullable(addresses); return this; } @@ -418,12 +449,12 @@ public Builder addresses(List> addresses) *

    AccountingPhoneNumber object for the given Contacts object.

    */ @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) - public Builder phoneNumbers(Optional> phoneNumbers) { + public Builder phoneNumbers(Optional> phoneNumbers) { this.phoneNumbers = phoneNumbers; return this; } - public Builder phoneNumbers(List phoneNumbers) { + public Builder phoneNumbers(List phoneNumbers) { this.phoneNumbers = Optional.ofNullable(phoneNumbers); return this; } @@ -463,6 +494,7 @@ public Builder remoteFields(List remoteFields) { public ContactRequest build() { return new ContactRequest( + contactUrl, name, isSupplier, isCustomer, diff --git a/src/main/java/com/merge/api/accounting/types/ContactRequestCompany.java b/src/main/java/com/merge/api/accounting/types/ContactRequestCompany.java new file mode 100644 index 000000000..ad256b825 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactRequestCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactRequestCompany.Deserializer.class) +public final class ContactRequestCompany { + private final Object value; + + private final int type; + + private ContactRequestCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequestCompany && equalTo((ContactRequestCompany) other); + } + + private boolean equalTo(ContactRequestCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactRequestCompany of(String value) { + return new ContactRequestCompany(value, 0); + } + + public static ContactRequestCompany of(CompanyInfo value) { + return new ContactRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactRequestCompany.class); + } + + @java.lang.Override + public ContactRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactRequestPhoneNumbersItem.java b/src/main/java/com/merge/api/accounting/types/ContactRequestPhoneNumbersItem.java new file mode 100644 index 000000000..443950f06 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactRequestPhoneNumbersItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContactRequestPhoneNumbersItem.Deserializer.class) +public final class ContactRequestPhoneNumbersItem { + private final Object value; + + private final int type; + + private ContactRequestPhoneNumbersItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((AccountingPhoneNumber) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactRequestPhoneNumbersItem && equalTo((ContactRequestPhoneNumbersItem) other); + } + + private boolean equalTo(ContactRequestPhoneNumbersItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContactRequestPhoneNumbersItem of(String value) { + return new ContactRequestPhoneNumbersItem(value, 0); + } + + public static ContactRequestPhoneNumbersItem of(AccountingPhoneNumber value) { + return new ContactRequestPhoneNumbersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPhoneNumber value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContactRequestPhoneNumbersItem.class); + } + + @java.lang.Override + public ContactRequestPhoneNumbersItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountingPhoneNumber.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactsListRequest.java b/src/main/java/com/merge/api/accounting/types/ContactsListRequest.java index 57e892115..98f731a01 100644 --- a/src/main/java/com/merge/api/accounting/types/ContactsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactsListRequest.java @@ -231,7 +231,7 @@ public Optional getName() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -625,7 +625,7 @@ public Builder name(String name) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java index 628a16ad6..cde8b36e1 100644 --- a/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/accounting/types/CreateFieldMappingRequest.java index 1769cbb66..dea4da4da 100644 --- a/src/main/java/com/merge/api/accounting/types/CreateFieldMappingRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreateFieldMappingRequest.java @@ -26,6 +26,8 @@ public final class CreateFieldMappingRequest { private final Optional excludeRemoteFieldMetadata; + private final Optional remoteDataIterationCount; + private final String targetFieldName; private final String targetFieldDescription; @@ -38,24 +40,34 @@ public final class CreateFieldMappingRequest { private final String commonModelName; + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + private final Map additionalProperties; private CreateFieldMappingRequest( Optional excludeRemoteFieldMetadata, + Optional remoteDataIterationCount, String targetFieldName, String targetFieldDescription, List remoteFieldTraversalPath, String remoteMethod, String remoteUrlPath, String commonModelName, + Optional jmesPath, + Optional advancedMappingExpression, Map additionalProperties) { this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.remoteDataIterationCount = remoteDataIterationCount; this.targetFieldName = targetFieldName; this.targetFieldDescription = targetFieldDescription; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; this.commonModelName = commonModelName; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; this.additionalProperties = additionalProperties; } @@ -67,6 +79,14 @@ public Optional getExcludeRemoteFieldMetadata() { return excludeRemoteFieldMetadata; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The name of the target field you want this remote field to map to. */ @@ -115,6 +135,22 @@ public String getCommonModelName() { return commonModelName; } + /** + * @return DEPRECATED: Use 'advanced_mapping_expression' instead. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + /** + * @return A JSONata expression used to transform the remote field data. + */ + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -128,24 +164,30 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateFieldMappingRequest other) { return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && remoteDataIterationCount.equals(other.remoteDataIterationCount) && targetFieldName.equals(other.targetFieldName) && targetFieldDescription.equals(other.targetFieldDescription) && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); } @java.lang.Override public int hashCode() { return Objects.hash( this.excludeRemoteFieldMetadata, + this.remoteDataIterationCount, this.targetFieldName, this.targetFieldDescription, this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath, - this.commonModelName); + this.commonModelName, + this.jmesPath, + this.advancedMappingExpression); } @java.lang.Override @@ -204,6 +246,13 @@ public interface _FinalStage { _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount); + + _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount); + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    */ @@ -212,6 +261,20 @@ public interface _FinalStage { _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); + + /** + *

    A JSONata expression used to transform the remote field data.

    + */ + _FinalStage advancedMappingExpression(Optional advancedMappingExpression); + + _FinalStage advancedMappingExpression(String advancedMappingExpression); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -232,8 +295,14 @@ public static final class Builder private String commonModelName; + private Optional advancedMappingExpression = Optional.empty(); + + private Optional jmesPath = Optional.empty(); + private List remoteFieldTraversalPath = new ArrayList<>(); + private Optional remoteDataIterationCount = Optional.empty(); + private Optional excludeRemoteFieldMetadata = Optional.empty(); @JsonAnySetter @@ -244,12 +313,15 @@ private Builder() {} @java.lang.Override public Builder from(CreateFieldMappingRequest other) { excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + remoteDataIterationCount(other.getRemoteDataIterationCount()); targetFieldName(other.getTargetFieldName()); targetFieldDescription(other.getTargetFieldDescription()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); return this; } @@ -313,6 +385,46 @@ public _FinalStage commonModelName(@NotNull String commonModelName) { return this; } + /** + *

    A JSONata expression used to transform the remote field data.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + + /** + *

    A JSONata expression used to transform the remote field data.

    + */ + @java.lang.Override + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public _FinalStage advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -348,6 +460,26 @@ public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalP return this; } + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @java.lang.Override + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + /** *

    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.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -372,12 +504,15 @@ public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFie public CreateFieldMappingRequest build() { return new CreateFieldMappingRequest( excludeRemoteFieldMetadata, + remoteDataIterationCount, targetFieldName, targetFieldDescription, remoteFieldTraversalPath, remoteMethod, remoteUrlPath, commonModelName, + jmesPath, + advancedMappingExpression, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/CreditNote.java b/src/main/java/com/merge/api/accounting/types/CreditNote.java index 9d990f8df..436e1ddf3 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNote.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNote.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CreditNote.Builder.class) public final class CreditNote { + private final Optional creditNoteUrl; + private final Optional id; private final Optional remoteId; @@ -49,7 +51,7 @@ public final class CreditNote { private final Optional inclusiveOfTax; - private final Optional> lineItems; + private final Optional> lineItems; private final Optional>> trackingCategories; @@ -76,6 +78,7 @@ public final class CreditNote { private final Map additionalProperties; private CreditNote( + Optional creditNoteUrl, Optional id, Optional remoteId, Optional createdAt, @@ -89,7 +92,7 @@ private CreditNote( Optional totalAmount, Optional remainingCredit, Optional inclusiveOfTax, - Optional> lineItems, + Optional> lineItems, Optional>> trackingCategories, Optional currency, Optional remoteCreatedAt, @@ -102,6 +105,7 @@ private CreditNote( Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { + this.creditNoteUrl = creditNoteUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -130,6 +134,14 @@ private CreditNote( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the credit note. + */ + @JsonProperty("credit_note_url") + public Optional getCreditNoteUrl() { + return creditNoteUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -237,7 +249,7 @@ public Optional getInclusiveOfTax() { } @JsonProperty("line_items") - public Optional> getLineItems() { + public Optional> getLineItems() { return lineItems; } @@ -640,7 +652,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreditNote other) { - return id.equals(other.id) + return creditNoteUrl.equals(other.creditNoteUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -670,6 +683,7 @@ private boolean equalTo(CreditNote other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.creditNoteUrl, this.id, this.remoteId, this.createdAt, @@ -708,6 +722,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional creditNoteUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -734,7 +750,7 @@ public static final class Builder { private Optional inclusiveOfTax = Optional.empty(); - private Optional> lineItems = Optional.empty(); + private Optional> lineItems = Optional.empty(); private Optional>> trackingCategories = Optional.empty(); @@ -764,6 +780,7 @@ public static final class Builder { private Builder() {} public Builder from(CreditNote other) { + creditNoteUrl(other.getCreditNoteUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -792,6 +809,20 @@ public Builder from(CreditNote other) { return this; } + /** + *

    The 3rd party URL of the credit note.

    + */ + @JsonSetter(value = "credit_note_url", nulls = Nulls.SKIP) + public Builder creditNoteUrl(Optional creditNoteUrl) { + this.creditNoteUrl = creditNoteUrl; + return this; + } + + public Builder creditNoteUrl(String creditNoteUrl) { + this.creditNoteUrl = Optional.ofNullable(creditNoteUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -977,12 +1008,12 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { } @JsonSetter(value = "line_items", nulls = Nulls.SKIP) - public Builder lineItems(Optional> lineItems) { + public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; return this; } - public Builder lineItems(List lineItems) { + public Builder lineItems(List lineItems) { this.lineItems = Optional.ofNullable(lineItems); return this; } @@ -1443,6 +1474,7 @@ public Builder remoteData(List remoteData) { public CreditNote build() { return new CreditNote( + creditNoteUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemsItem.java b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemsItem.java new file mode 100644 index 000000000..7313ba742 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CreditNoteLineItemsItem.Deserializer.class) +public final class CreditNoteLineItemsItem { + private final Object value; + + private final int type; + + private CreditNoteLineItemsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CreditNoteLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreditNoteLineItemsItem && equalTo((CreditNoteLineItemsItem) other); + } + + private boolean equalTo(CreditNoteLineItemsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CreditNoteLineItemsItem of(String value) { + return new CreditNoteLineItemsItem(value, 0); + } + + public static CreditNoteLineItemsItem of(CreditNoteLineItem value) { + return new CreditNoteLineItemsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CreditNoteLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CreditNoteLineItemsItem.class); + } + + @java.lang.Override + public CreditNoteLineItemsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreditNoteLineItem.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteRequestLineItemsItem.java b/src/main/java/com/merge/api/accounting/types/CreditNoteRequestLineItemsItem.java index 3da640257..8c2ab0353 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNoteRequestLineItemsItem.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteRequestLineItemsItem.java @@ -34,7 +34,7 @@ public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((CreditNoteLineItemRequest) this.value); + return visitor.visit((CreditNoteLineItem) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -63,14 +63,14 @@ public static CreditNoteRequestLineItemsItem of(String value) { return new CreditNoteRequestLineItemsItem(value, 0); } - public static CreditNoteRequestLineItemsItem of(CreditNoteLineItemRequest value) { + public static CreditNoteRequestLineItemsItem of(CreditNoteLineItem value) { return new CreditNoteRequestLineItemsItem(value, 1); } public interface Visitor { T visit(String value); - T visit(CreditNoteLineItemRequest value); + T visit(CreditNoteLineItem value); } static final class Deserializer extends StdDeserializer { @@ -87,7 +87,7 @@ public CreditNoteRequestLineItemsItem deserialize(JsonParser p, DeserializationC } catch (RuntimeException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreditNoteLineItemRequest.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CreditNoteLineItem.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/accounting/types/CreditNotesListRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequest.java index 99bb157a2..a2a1ca98e 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNotesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequest.java @@ -175,7 +175,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -487,7 +487,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/Employee.java b/src/main/java/com/merge/api/accounting/types/Employee.java index f656241dd..62691e612 100644 --- a/src/main/java/com/merge/api/accounting/types/Employee.java +++ b/src/main/java/com/merge/api/accounting/types/Employee.java @@ -24,6 +24,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Employee.Builder.class) public final class Employee { + private final Optional employeeUrl; + private final Optional id; private final Optional remoteId; @@ -55,6 +57,7 @@ public final class Employee { private final Map additionalProperties; private Employee( + Optional employeeUrl, Optional id, Optional remoteId, Optional createdAt, @@ -70,6 +73,7 @@ private Employee( Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { + this.employeeUrl = employeeUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -87,6 +91,14 @@ private Employee( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the employee. + */ + @JsonProperty("employee_url") + public Optional getEmployeeUrl() { + return employeeUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -206,7 +218,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(Employee other) { - return id.equals(other.id) + return employeeUrl.equals(other.employeeUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -225,6 +238,7 @@ private boolean equalTo(Employee other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.employeeUrl, this.id, this.remoteId, this.createdAt, @@ -266,6 +280,13 @@ public interface StatusStage { public interface _FinalStage { Employee build(); + /** + *

    The 3rd party URL of the employee.

    + */ + _FinalStage employeeUrl(Optional employeeUrl); + + _FinalStage employeeUrl(String employeeUrl); + _FinalStage id(Optional id); _FinalStage id(String id); @@ -379,6 +400,8 @@ public static final class Builder implements StatusStage, _FinalStage { private Optional id = Optional.empty(); + private Optional employeeUrl = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -386,6 +409,7 @@ private Builder() {} @java.lang.Override public Builder from(Employee other) { + employeeUrl(other.getEmployeeUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -662,9 +686,30 @@ public _FinalStage id(Optional id) { return this; } + /** + *

    The 3rd party URL of the employee.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage employeeUrl(String employeeUrl) { + this.employeeUrl = Optional.ofNullable(employeeUrl); + return this; + } + + /** + *

    The 3rd party URL of the employee.

    + */ + @java.lang.Override + @JsonSetter(value = "employee_url", nulls = Nulls.SKIP) + public _FinalStage employeeUrl(Optional employeeUrl) { + this.employeeUrl = employeeUrl; + return this; + } + @java.lang.Override public Employee build() { return new Employee( + employeeUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java b/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java index f8a8d7165..a77ae38e4 100644 --- a/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -24,6 +25,12 @@ public final class EmployeesListRequest { private final Optional> expand; + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + private final Optional cursor; private final Optional includeDeletedData; @@ -32,24 +39,42 @@ public final class EmployeesListRequest { private final Optional includeShellData; + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + private final Optional pageSize; + private final Optional remoteId; + private final Map additionalProperties; private EmployeesListRequest( Optional> expand, + Optional companyId, + Optional createdAfter, + Optional createdBefore, Optional cursor, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, Optional pageSize, + Optional remoteId, Map additionalProperties) { this.expand = expand; + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; this.cursor = cursor; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; this.pageSize = pageSize; + this.remoteId = remoteId; this.additionalProperties = additionalProperties; } @@ -61,6 +86,30 @@ public Optional> getExpand() { return expand; } + /** + * @return If provided, will only return employees for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + /** * @return The pagination cursor value. */ @@ -94,13 +143,37 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { return pageSize; } + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -114,22 +187,34 @@ public Map getAdditionalProperties() { private boolean equalTo(EmployeesListRequest other) { return expand.equals(other.expand) + && companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) - && pageSize.equals(other.pageSize); + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); } @java.lang.Override public int hashCode() { return Objects.hash( this.expand, + this.companyId, + this.createdAfter, + this.createdBefore, this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, - this.pageSize); + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); } @java.lang.Override @@ -145,6 +230,12 @@ public static Builder builder() { public static final class Builder { private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + private Optional cursor = Optional.empty(); private Optional includeDeletedData = Optional.empty(); @@ -153,8 +244,14 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + private Optional pageSize = Optional.empty(); + private Optional remoteId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -162,11 +259,17 @@ private Builder() {} public Builder from(EmployeesListRequest other) { expand(other.getExpand()); + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); return this; } @@ -189,6 +292,48 @@ public Builder expand(String expand) { return this; } + /** + *

    If provided, will only return employees for this company.

    + */ + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + /** *

    The pagination cursor value.

    */ @@ -246,7 +391,35 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

    Number of results to return per page.

    + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -259,14 +432,34 @@ public Builder pageSize(Integer pageSize) { return this; } + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + public EmployeesListRequest build() { return new EmployeesListRequest( expand, + companyId, + createdAfter, + createdBefore, cursor, includeDeletedData, includeRemoteData, includeShellData, + modifiedAfter, + modifiedBefore, pageSize, + remoteId, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java index ea6ef7f0f..35f196490 100644 --- a/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java @@ -51,6 +51,12 @@ public final class EndUserDetailsRequest { private final Optional> integrationSpecificConfig; + private final Optional completedAccountInitialScreen; + + private final Optional linkedDestinationId; + + private final Optional credentialId; + private final Map additionalProperties; private EndUserDetailsRequest( @@ -68,6 +74,9 @@ private EndUserDetailsRequest( Optional language, Optional areSyncsDisabled, Optional> integrationSpecificConfig, + Optional completedAccountInitialScreen, + Optional linkedDestinationId, + Optional credentialId, Map additionalProperties) { this.endUserEmailAddress = endUserEmailAddress; this.endUserOrganizationName = endUserOrganizationName; @@ -82,6 +91,9 @@ private EndUserDetailsRequest( this.language = language; this.areSyncsDisabled = areSyncsDisabled; this.integrationSpecificConfig = integrationSpecificConfig; + this.completedAccountInitialScreen = completedAccountInitialScreen; + this.linkedDestinationId = linkedDestinationId; + this.credentialId = credentialId; this.additionalProperties = additionalProperties; } @@ -194,6 +206,33 @@ public Optional> getIntegrationSpecificConfig() { return integrationSpecificConfig; } + /** + * @return When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account. + *
      + *
    • SELECTIVE_SYNC - SELECTIVE_SYNC
    • + *
    + */ + @JsonProperty("completed_account_initial_screen") + public Optional getCompletedAccountInitialScreen() { + return completedAccountInitialScreen; + } + + /** + * @return The UUID of the linked destination that you want this Linked Account to be tied to. + */ + @JsonProperty("linked_destination_id") + public Optional getLinkedDestinationId() { + return linkedDestinationId; + } + + /** + * @return The id of the credential that you want this Linked Account to be tied to. + */ + @JsonProperty("credential_id") + public Optional getCredentialId() { + return credentialId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -218,7 +257,10 @@ private boolean equalTo(EndUserDetailsRequest other) { && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) && language.equals(other.language) && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); + && integrationSpecificConfig.equals(other.integrationSpecificConfig) + && completedAccountInitialScreen.equals(other.completedAccountInitialScreen) + && linkedDestinationId.equals(other.linkedDestinationId) + && credentialId.equals(other.credentialId); } @java.lang.Override @@ -236,7 +278,10 @@ public int hashCode() { this.categoryCommonModelScopes, this.language, this.areSyncsDisabled, - this.integrationSpecificConfig); + this.integrationSpecificConfig, + this.completedAccountInitialScreen, + this.linkedDestinationId, + this.credentialId); } @java.lang.Override @@ -352,6 +397,32 @@ _FinalStage categoryCommonModelScopes( _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + /** + *

    When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

    + *
      + *
    • SELECTIVE_SYNC - SELECTIVE_SYNC
    • + *
    + */ + _FinalStage completedAccountInitialScreen( + Optional completedAccountInitialScreen); + + _FinalStage completedAccountInitialScreen( + EndUserDetailsRequestCompletedAccountInitialScreen completedAccountInitialScreen); + + /** + *

    The UUID of the linked destination that you want this Linked Account to be tied to.

    + */ + _FinalStage linkedDestinationId(Optional linkedDestinationId); + + _FinalStage linkedDestinationId(String linkedDestinationId); + + /** + *

    The id of the credential that you want this Linked Account to be tied to.

    + */ + _FinalStage credentialId(Optional credentialId); + + _FinalStage credentialId(String credentialId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -363,6 +434,13 @@ public static final class Builder private String endUserOriginId; + private Optional credentialId = Optional.empty(); + + private Optional linkedDestinationId = Optional.empty(); + + private Optional completedAccountInitialScreen = + Optional.empty(); + private Optional> integrationSpecificConfig = Optional.empty(); private Optional areSyncsDisabled = Optional.empty(); @@ -404,6 +482,9 @@ public Builder from(EndUserDetailsRequest other) { language(other.getLanguage()); areSyncsDisabled(other.getAreSyncsDisabled()); integrationSpecificConfig(other.getIntegrationSpecificConfig()); + completedAccountInitialScreen(other.getCompletedAccountInitialScreen()); + linkedDestinationId(other.getLinkedDestinationId()); + credentialId(other.getCredentialId()); return this; } @@ -443,6 +524,74 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { return this; } + /** + *

    The id of the credential that you want this Linked Account to be tied to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentialId(String credentialId) { + this.credentialId = Optional.ofNullable(credentialId); + return this; + } + + /** + *

    The id of the credential that you want this Linked Account to be tied to.

    + */ + @java.lang.Override + @JsonSetter(value = "credential_id", nulls = Nulls.SKIP) + public _FinalStage credentialId(Optional credentialId) { + this.credentialId = credentialId; + return this; + } + + /** + *

    The UUID of the linked destination that you want this Linked Account to be tied to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkedDestinationId(String linkedDestinationId) { + this.linkedDestinationId = Optional.ofNullable(linkedDestinationId); + return this; + } + + /** + *

    The UUID of the linked destination that you want this Linked Account to be tied to.

    + */ + @java.lang.Override + @JsonSetter(value = "linked_destination_id", nulls = Nulls.SKIP) + public _FinalStage linkedDestinationId(Optional linkedDestinationId) { + this.linkedDestinationId = linkedDestinationId; + return this; + } + + /** + *

    When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

    + *
      + *
    • SELECTIVE_SYNC - SELECTIVE_SYNC
    • + *
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage completedAccountInitialScreen( + EndUserDetailsRequestCompletedAccountInitialScreen completedAccountInitialScreen) { + this.completedAccountInitialScreen = Optional.ofNullable(completedAccountInitialScreen); + return this; + } + + /** + *

    When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

    + *
      + *
    • SELECTIVE_SYNC - SELECTIVE_SYNC
    • + *
    + */ + @java.lang.Override + @JsonSetter(value = "completed_account_initial_screen", nulls = Nulls.SKIP) + public _FinalStage completedAccountInitialScreen( + Optional completedAccountInitialScreen) { + this.completedAccountInitialScreen = completedAccountInitialScreen; + return this; + } + /** *

    A JSON object containing integration-specific configuration options.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -685,6 +834,9 @@ public EndUserDetailsRequest build() { language, areSyncsDisabled, integrationSpecificConfig, + completedAccountInitialScreen, + linkedDestinationId, + credentialId, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequestCompletedAccountInitialScreen.java b/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequestCompletedAccountInitialScreen.java new file mode 100644 index 000000000..7277bccdc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequestCompletedAccountInitialScreen.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EndUserDetailsRequestCompletedAccountInitialScreen.Deserializer.class) +public final class EndUserDetailsRequestCompletedAccountInitialScreen { + private final Object value; + + private final int type; + + private EndUserDetailsRequestCompletedAccountInitialScreen(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit2((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequestCompletedAccountInitialScreen + && equalTo((EndUserDetailsRequestCompletedAccountInitialScreen) other); + } + + private boolean equalTo(EndUserDetailsRequestCompletedAccountInitialScreen other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EndUserDetailsRequestCompletedAccountInitialScreen of(String value) { + return new EndUserDetailsRequestCompletedAccountInitialScreen(value, 0); + } + + public static EndUserDetailsRequestCompletedAccountInitialScreen of2(String value) { + return new EndUserDetailsRequestCompletedAccountInitialScreen(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit2(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EndUserDetailsRequestCompletedAccountInitialScreen.class); + } + + @java.lang.Override + public EndUserDetailsRequestCompletedAccountInitialScreen deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference() {})); + } catch (RuntimeException e) { + } + try { + return of2(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/accounting/types/ErrorValidationProblem.java index ba0762ffa..8fc6fb387 100644 --- a/src/main/java/com/merge/api/accounting/types/ErrorValidationProblem.java +++ b/src/main/java/com/merge/api/accounting/types/ErrorValidationProblem.java @@ -29,6 +29,12 @@ public final class ErrorValidationProblem { private final String problemType; + private final Optional blockMergeLink; + + private final Optional rawError; + + private final Optional errorCode; + private final Map additionalProperties; private ErrorValidationProblem( @@ -36,11 +42,17 @@ private ErrorValidationProblem( String title, String detail, String problemType, + Optional blockMergeLink, + Optional rawError, + Optional errorCode, Map additionalProperties) { this.source = source; this.title = title; this.detail = detail; this.problemType = problemType; + this.blockMergeLink = blockMergeLink; + this.rawError = rawError; + this.errorCode = errorCode; this.additionalProperties = additionalProperties; } @@ -64,6 +76,21 @@ public String getProblemType() { return problemType; } + @JsonProperty("block_merge_link") + public Optional getBlockMergeLink() { + return blockMergeLink; + } + + @JsonProperty("raw_error") + public Optional getRawError() { + return rawError; + } + + @JsonProperty("error_code") + public Optional getErrorCode() { + return errorCode; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -79,12 +106,22 @@ private boolean equalTo(ErrorValidationProblem other) { return source.equals(other.source) && title.equals(other.title) && detail.equals(other.detail) - && problemType.equals(other.problemType); + && problemType.equals(other.problemType) + && blockMergeLink.equals(other.blockMergeLink) + && rawError.equals(other.rawError) + && errorCode.equals(other.errorCode); } @java.lang.Override public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); + return Objects.hash( + this.source, + this.title, + this.detail, + this.problemType, + this.blockMergeLink, + this.rawError, + this.errorCode); } @java.lang.Override @@ -116,6 +153,18 @@ public interface _FinalStage { _FinalStage source(Optional source); _FinalStage source(ValidationProblemSource source); + + _FinalStage blockMergeLink(Optional blockMergeLink); + + _FinalStage blockMergeLink(Boolean blockMergeLink); + + _FinalStage rawError(Optional rawError); + + _FinalStage rawError(String rawError); + + _FinalStage errorCode(Optional errorCode); + + _FinalStage errorCode(Integer errorCode); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -126,6 +175,12 @@ public static final class Builder implements TitleStage, DetailStage, ProblemTyp private String problemType; + private Optional errorCode = Optional.empty(); + + private Optional rawError = Optional.empty(); + + private Optional blockMergeLink = Optional.empty(); + private Optional source = Optional.empty(); @JsonAnySetter @@ -139,6 +194,9 @@ public Builder from(ErrorValidationProblem other) { title(other.getTitle()); detail(other.getDetail()); problemType(other.getProblemType()); + blockMergeLink(other.getBlockMergeLink()); + rawError(other.getRawError()); + errorCode(other.getErrorCode()); return this; } @@ -163,6 +221,45 @@ public _FinalStage problemType(@NotNull String problemType) { return this; } + @java.lang.Override + public _FinalStage errorCode(Integer errorCode) { + this.errorCode = Optional.ofNullable(errorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_code", nulls = Nulls.SKIP) + public _FinalStage errorCode(Optional errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + public _FinalStage rawError(String rawError) { + this.rawError = Optional.ofNullable(rawError); + return this; + } + + @java.lang.Override + @JsonSetter(value = "raw_error", nulls = Nulls.SKIP) + public _FinalStage rawError(Optional rawError) { + this.rawError = rawError; + return this; + } + + @java.lang.Override + public _FinalStage blockMergeLink(Boolean blockMergeLink) { + this.blockMergeLink = Optional.ofNullable(blockMergeLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "block_merge_link", nulls = Nulls.SKIP) + public _FinalStage blockMergeLink(Optional blockMergeLink) { + this.blockMergeLink = blockMergeLink; + return this; + } + @java.lang.Override public _FinalStage source(ValidationProblemSource source) { this.source = Optional.ofNullable(source); @@ -178,7 +275,8 @@ public _FinalStage source(Optional source) { @java.lang.Override public ErrorValidationProblem build() { - return new ErrorValidationProblem(source, title, detail, problemType, additionalProperties); + return new ErrorValidationProblem( + source, title, detail, problemType, blockMergeLink, rawError, errorCode, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseBatchItemRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseBatchItemRequest.java new file mode 100644 index 000000000..762ac9bab --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseBatchItemRequest.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseBatchItemRequest.Builder.class) +public final class ExpenseBatchItemRequest { + private final String itemId; + + private final ExpenseRequest payload; + + private final Map additionalProperties; + + private ExpenseBatchItemRequest(String itemId, ExpenseRequest payload, Map additionalProperties) { + this.itemId = itemId; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party item ID for this model in the bulk create request + */ + @JsonProperty("item_id") + public String getItemId() { + return itemId; + } + + @JsonProperty("payload") + public ExpenseRequest getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseBatchItemRequest && equalTo((ExpenseBatchItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseBatchItemRequest other) { + return itemId.equals(other.itemId) && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemId, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ItemIdStage builder() { + return new Builder(); + } + + public interface ItemIdStage { + /** + *

    The third-party item ID for this model in the bulk create request

    + */ + PayloadStage itemId(@NotNull String itemId); + + Builder from(ExpenseBatchItemRequest other); + } + + public interface PayloadStage { + _FinalStage payload(@NotNull ExpenseRequest payload); + } + + public interface _FinalStage { + ExpenseBatchItemRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ItemIdStage, PayloadStage, _FinalStage { + private String itemId; + + private ExpenseRequest payload; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ExpenseBatchItemRequest other) { + itemId(other.getItemId()); + payload(other.getPayload()); + return this; + } + + /** + *

    The third-party item ID for this model in the bulk create request

    + *

    The third-party item ID for this model in the bulk create request

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("item_id") + public PayloadStage itemId(@NotNull String itemId) { + this.itemId = itemId; + return this; + } + + @java.lang.Override + @JsonSetter("payload") + public _FinalStage payload(@NotNull ExpenseRequest payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public ExpenseBatchItemRequest build() { + return new ExpenseBatchItemRequest(itemId, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseBulkRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseBulkRequest.java new file mode 100644 index 000000000..c24c44689 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseBulkRequest.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseBulkRequest.Builder.class) +public final class ExpenseBulkRequest { + private final List batchItems; + + private final Map additionalProperties; + + private ExpenseBulkRequest(List batchItems, Map additionalProperties) { + this.batchItems = batchItems; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("batch_items") + public List getBatchItems() { + return batchItems; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseBulkRequest && equalTo((ExpenseBulkRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseBulkRequest other) { + return batchItems.equals(other.batchItems); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.batchItems); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List batchItems = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseBulkRequest other) { + batchItems(other.getBatchItems()); + return this; + } + + @JsonSetter(value = "batch_items", nulls = Nulls.SKIP) + public Builder batchItems(List batchItems) { + this.batchItems.clear(); + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public Builder addBatchItems(ExpenseBatchItemRequest batchItems) { + this.batchItems.add(batchItems); + return this; + } + + public Builder addAllBatchItems(List batchItems) { + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public ExpenseBulkRequest build() { + return new ExpenseBulkRequest(batchItems, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseLine.java b/src/main/java/com/merge/api/accounting/types/ExpenseLine.java index 45d40fbd7..8c58472c0 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpenseLine.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLine.java @@ -42,7 +42,7 @@ public final class ExpenseLine { private final Optional employee; - private final Optional currency; + private final Optional currency; private final Optional account; @@ -56,6 +56,10 @@ public final class ExpenseLine { private final Optional taxRate; + private final Optional quantity; + + private final Optional unitPrice; + private final Optional remoteWasDeleted; private final Map additionalProperties; @@ -71,13 +75,15 @@ private ExpenseLine( Optional>> trackingCategories, Optional company, Optional employee, - Optional currency, + Optional currency, Optional account, Optional contact, Optional project, Optional description, Optional exchangeRate, Optional taxRate, + Optional quantity, + Optional unitPrice, Optional remoteWasDeleted, Map additionalProperties) { this.id = id; @@ -97,6 +103,8 @@ private ExpenseLine( this.description = description; this.exchangeRate = exchangeRate; this.taxRate = taxRate; + this.quantity = quantity; + this.unitPrice = unitPrice; this.remoteWasDeleted = remoteWasDeleted; this.additionalProperties = additionalProperties; } @@ -487,7 +495,7 @@ public Optional getEmployee() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -536,6 +544,22 @@ public Optional getTaxRate() { return taxRate; } + /** + * @return Number of items for the expense line. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return Unit price of the item for the expense line. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + /** * @return 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. */ @@ -573,6 +597,8 @@ private boolean equalTo(ExpenseLine other) { && description.equals(other.description) && exchangeRate.equals(other.exchangeRate) && taxRate.equals(other.taxRate) + && quantity.equals(other.quantity) + && unitPrice.equals(other.unitPrice) && remoteWasDeleted.equals(other.remoteWasDeleted); } @@ -596,6 +622,8 @@ public int hashCode() { this.description, this.exchangeRate, this.taxRate, + this.quantity, + this.unitPrice, this.remoteWasDeleted); } @@ -630,7 +658,7 @@ public static final class Builder { private Optional employee = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional account = Optional.empty(); @@ -644,6 +672,10 @@ public static final class Builder { private Optional taxRate = Optional.empty(); + private Optional quantity = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + private Optional remoteWasDeleted = Optional.empty(); @JsonAnySetter @@ -669,6 +701,8 @@ public Builder from(ExpenseLine other) { description(other.getDescription()); exchangeRate(other.getExchangeRate()); taxRate(other.getTaxRate()); + quantity(other.getQuantity()); + unitPrice(other.getUnitPrice()); remoteWasDeleted(other.getRemoteWasDeleted()); return this; } @@ -1120,12 +1154,12 @@ public Builder employee(ExpenseLineEmployee employee) { * */ @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(TransactionCurrencyEnum currency) { + public Builder currency(ExpenseLineCurrency currency) { this.currency = Optional.ofNullable(currency); return this; } @@ -1211,6 +1245,34 @@ public Builder taxRate(String taxRate) { return this; } + /** + *

    Number of items for the expense line.

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + *

    Unit price of the item for the expense line.

    + */ + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(String unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + /** *

    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.

    */ @@ -1244,6 +1306,8 @@ public ExpenseLine build() { description, exchangeRate, taxRate, + quantity, + unitPrice, remoteWasDeleted, additionalProperties); } diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseLineCurrency.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineCurrency.java new file mode 100644 index 000000000..33fe65a21 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseLineCurrency.Deserializer.class) +public final class ExpenseLineCurrency { + private final Object value; + + private final int type; + + private ExpenseLineCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseLineCurrency && equalTo((ExpenseLineCurrency) other); + } + + private boolean equalTo(ExpenseLineCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseLineCurrency of(TransactionCurrencyEnum value) { + return new ExpenseLineCurrency(value, 0); + } + + public static ExpenseLineCurrency of(String value) { + return new ExpenseLineCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseLineCurrency.class); + } + + @java.lang.Override + public ExpenseLineCurrency deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java index 85bc8ad6d..3c129106f 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java @@ -50,6 +50,10 @@ public final class ExpenseLineRequest { private final Optional taxRate; + private final Optional quantity; + + private final Optional unitPrice; + private final Optional> integrationParams; private final Optional> linkedAccountParams; @@ -73,6 +77,8 @@ private ExpenseLineRequest( Optional description, Optional exchangeRate, Optional taxRate, + Optional quantity, + Optional unitPrice, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -91,6 +97,8 @@ private ExpenseLineRequest( this.description = description; this.exchangeRate = exchangeRate; this.taxRate = taxRate; + this.quantity = quantity; + this.unitPrice = unitPrice; this.integrationParams = integrationParams; this.linkedAccountParams = linkedAccountParams; this.remoteFields = remoteFields; @@ -511,6 +519,22 @@ public Optional getTaxRate() { return taxRate; } + /** + * @return Number of items for the expense line. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return Unit price of the item for the expense line. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + @JsonProperty("integration_params") public Optional> getIntegrationParams() { return integrationParams; @@ -552,6 +576,8 @@ private boolean equalTo(ExpenseLineRequest other) { && description.equals(other.description) && exchangeRate.equals(other.exchangeRate) && taxRate.equals(other.taxRate) + && quantity.equals(other.quantity) + && unitPrice.equals(other.unitPrice) && integrationParams.equals(other.integrationParams) && linkedAccountParams.equals(other.linkedAccountParams) && remoteFields.equals(other.remoteFields); @@ -574,6 +600,8 @@ public int hashCode() { this.description, this.exchangeRate, this.taxRate, + this.quantity, + this.unitPrice, this.integrationParams, this.linkedAccountParams, this.remoteFields); @@ -619,6 +647,10 @@ public static final class Builder { private Optional taxRate = Optional.empty(); + private Optional quantity = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + private Optional> integrationParams = Optional.empty(); private Optional> linkedAccountParams = Optional.empty(); @@ -645,6 +677,8 @@ public Builder from(ExpenseLineRequest other) { description(other.getDescription()); exchangeRate(other.getExchangeRate()); taxRate(other.getTaxRate()); + quantity(other.getQuantity()); + unitPrice(other.getUnitPrice()); integrationParams(other.getIntegrationParams()); linkedAccountParams(other.getLinkedAccountParams()); remoteFields(other.getRemoteFields()); @@ -1150,6 +1184,34 @@ public Builder taxRate(String taxRate) { return this; } + /** + *

    Number of items for the expense line.

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + *

    Unit price of the item for the expense line.

    + */ + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(String unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1199,6 +1261,8 @@ public ExpenseLineRequest build() { description, exchangeRate, taxRate, + quantity, + unitPrice, integrationParams, linkedAccountParams, remoteFields, diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReport.java b/src/main/java/com/merge/api/accounting/types/ExpenseReport.java new file mode 100644 index 000000000..f3005363f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReport.java @@ -0,0 +1,1326 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReport.Builder.class) +public final class ExpenseReport { + private final Optional expenseReportUrl; + + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional reportDate; + + private final Optional reportIdentifier; + + private final Optional employee; + + private final Optional status; + + private final Optional totalAmount; + + private final Optional> lines; + + private final Optional currency; + + private final Optional description; + + private final Optional accountingPeriod; + + private final Optional company; + + private final List trackingCategories; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ExpenseReport( + Optional expenseReportUrl, + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional reportDate, + Optional reportIdentifier, + Optional employee, + Optional status, + Optional totalAmount, + Optional> lines, + Optional currency, + Optional description, + Optional accountingPeriod, + Optional company, + List trackingCategories, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.expenseReportUrl = expenseReportUrl; + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.reportDate = reportDate; + this.reportIdentifier = reportIdentifier; + this.employee = employee; + this.status = status; + this.totalAmount = totalAmount; + this.lines = lines; + this.currency = currency; + this.description = description; + this.accountingPeriod = accountingPeriod; + this.company = company; + this.trackingCategories = trackingCategories; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The 3rd party URL of the expense report. + */ + @JsonProperty("expense_report_url") + public Optional getExpenseReportUrl() { + return expenseReportUrl; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The date of the expense report. + */ + @JsonProperty("report_date") + public Optional getReportDate() { + return reportDate; + } + + /** + * @return Human-readable expense report identifier. + */ + @JsonProperty("report_identifier") + public Optional getReportIdentifier() { + return reportIdentifier; + } + + /** + * @return Identifier for the employee who submitted or is associated with the expense report + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return Overall status of the expense report. One of DRAFT, SUBMITTED, APPROVED, REJECTED + *
      + *
    • DRAFT - DRAFT
    • + *
    • SUBMITTED - SUBMITTED
    • + *
    • APPROVED - APPROVED
    • + *
    • REJECTED - REJECTED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Total amount of the expense report + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + /** + * @return Currency code for the expense report + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return A brief description or purpose for the expense report + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The accounting period the report was posted in + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return The subsidiary that the expense report is created in + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The related tracking categories associated with the expense report + */ + @JsonProperty("tracking_categories") + public List getTrackingCategories() { + return trackingCategories; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReport && equalTo((ExpenseReport) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReport other) { + return expenseReportUrl.equals(other.expenseReportUrl) + && id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && reportDate.equals(other.reportDate) + && reportIdentifier.equals(other.reportIdentifier) + && employee.equals(other.employee) + && status.equals(other.status) + && totalAmount.equals(other.totalAmount) + && lines.equals(other.lines) + && currency.equals(other.currency) + && description.equals(other.description) + && accountingPeriod.equals(other.accountingPeriod) + && company.equals(other.company) + && trackingCategories.equals(other.trackingCategories) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expenseReportUrl, + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.reportDate, + this.reportIdentifier, + this.employee, + this.status, + this.totalAmount, + this.lines, + this.currency, + this.description, + this.accountingPeriod, + this.company, + this.trackingCategories, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional expenseReportUrl = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional reportDate = Optional.empty(); + + private Optional reportIdentifier = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional company = Optional.empty(); + + private List trackingCategories = new ArrayList<>(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReport other) { + expenseReportUrl(other.getExpenseReportUrl()); + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + reportDate(other.getReportDate()); + reportIdentifier(other.getReportIdentifier()); + employee(other.getEmployee()); + status(other.getStatus()); + totalAmount(other.getTotalAmount()); + lines(other.getLines()); + currency(other.getCurrency()); + description(other.getDescription()); + accountingPeriod(other.getAccountingPeriod()); + company(other.getCompany()); + trackingCategories(other.getTrackingCategories()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The 3rd party URL of the expense report.

    + */ + @JsonSetter(value = "expense_report_url", nulls = Nulls.SKIP) + public Builder expenseReportUrl(Optional expenseReportUrl) { + this.expenseReportUrl = expenseReportUrl; + return this; + } + + public Builder expenseReportUrl(String expenseReportUrl) { + this.expenseReportUrl = Optional.ofNullable(expenseReportUrl); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    The date of the expense report.

    + */ + @JsonSetter(value = "report_date", nulls = Nulls.SKIP) + public Builder reportDate(Optional reportDate) { + this.reportDate = reportDate; + return this; + } + + public Builder reportDate(OffsetDateTime reportDate) { + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + *

    Human-readable expense report identifier.

    + */ + @JsonSetter(value = "report_identifier", nulls = Nulls.SKIP) + public Builder reportIdentifier(Optional reportIdentifier) { + this.reportIdentifier = reportIdentifier; + return this; + } + + public Builder reportIdentifier(String reportIdentifier) { + this.reportIdentifier = Optional.ofNullable(reportIdentifier); + return this; + } + + /** + *

    Identifier for the employee who submitted or is associated with the expense report

    + */ + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseReportEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + /** + *

    Overall status of the expense report. One of DRAFT, SUBMITTED, APPROVED, REJECTED

    + *
      + *
    • DRAFT - DRAFT
    • + *
    • SUBMITTED - SUBMITTED
    • + *
    • APPROVED - APPROVED
    • + *
    • REJECTED - REJECTED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ExpenseReportStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    Total amount of the expense report

    + */ + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + /** + *

    Currency code for the expense report

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseReportCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    A brief description or purpose for the expense report

    + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The accounting period the report was posted in

    + */ + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(ExpenseReportAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + /** + *

    The subsidiary that the expense report is created in

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ExpenseReportCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    The related tracking categories associated with the expense report

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(List trackingCategories) { + this.trackingCategories.clear(); + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + public Builder addTrackingCategories(String trackingCategories) { + this.trackingCategories.add(trackingCategories); + return this; + } + + public Builder addAllTrackingCategories(List trackingCategories) { + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ExpenseReport build() { + return new ExpenseReport( + expenseReportUrl, + id, + remoteId, + createdAt, + modifiedAt, + reportDate, + reportIdentifier, + employee, + status, + totalAmount, + lines, + currency, + description, + accountingPeriod, + company, + trackingCategories, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportAccountingPeriod.java similarity index 68% rename from src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccountingPeriod.java rename to src/main/java/com/merge/api/accounting/types/ExpenseReportAccountingPeriod.java index 47d197ad0..88fa72fa6 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportAccountingPeriod.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = PatchedPaymentRequestAccountingPeriod.Deserializer.class) -public final class PatchedPaymentRequestAccountingPeriod { +@JsonDeserialize(using = ExpenseReportAccountingPeriod.Deserializer.class) +public final class ExpenseReportAccountingPeriod { private final Object value; private final int type; - private PatchedPaymentRequestAccountingPeriod(Object value, int type) { + private ExpenseReportAccountingPeriod(Object value, int type) { this.value = value; this.type = type; } @@ -42,11 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof PatchedPaymentRequestAccountingPeriod - && equalTo((PatchedPaymentRequestAccountingPeriod) other); + return other instanceof ExpenseReportAccountingPeriod && equalTo((ExpenseReportAccountingPeriod) other); } - private boolean equalTo(PatchedPaymentRequestAccountingPeriod other) { + private boolean equalTo(ExpenseReportAccountingPeriod other) { return value.equals(other.value); } @@ -60,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static PatchedPaymentRequestAccountingPeriod of(String value) { - return new PatchedPaymentRequestAccountingPeriod(value, 0); + public static ExpenseReportAccountingPeriod of(String value) { + return new ExpenseReportAccountingPeriod(value, 0); } - public static PatchedPaymentRequestAccountingPeriod of(AccountingPeriod value) { - return new PatchedPaymentRequestAccountingPeriod(value, 1); + public static ExpenseReportAccountingPeriod of(AccountingPeriod value) { + return new ExpenseReportAccountingPeriod(value, 1); } public interface Visitor { @@ -74,13 +73,13 @@ public interface Visitor { T visit(AccountingPeriod value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(PatchedPaymentRequestAccountingPeriod.class); + super(ExpenseReportAccountingPeriod.class); } @java.lang.Override - public PatchedPaymentRequestAccountingPeriod deserialize(JsonParser p, DeserializationContext context) + public ExpenseReportAccountingPeriod deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportCompany.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportCompany.java new file mode 100644 index 000000000..60c314032 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportCompany.Deserializer.class) +public final class ExpenseReportCompany { + private final Object value; + + private final int type; + + private ExpenseReportCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportCompany && equalTo((ExpenseReportCompany) other); + } + + private boolean equalTo(ExpenseReportCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportCompany of(String value) { + return new ExpenseReportCompany(value, 0); + } + + public static ExpenseReportCompany of(CompanyInfo value) { + return new ExpenseReportCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportCompany.class); + } + + @java.lang.Override + public ExpenseReportCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportCurrency.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportCurrency.java new file mode 100644 index 000000000..7f7729a74 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportCurrency.Deserializer.class) +public final class ExpenseReportCurrency { + private final Object value; + + private final int type; + + private ExpenseReportCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportCurrency && equalTo((ExpenseReportCurrency) other); + } + + private boolean equalTo(ExpenseReportCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportCurrency of(TransactionCurrencyEnum value) { + return new ExpenseReportCurrency(value, 0); + } + + public static ExpenseReportCurrency of(String value) { + return new ExpenseReportCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportCurrency.class); + } + + @java.lang.Override + public ExpenseReportCurrency deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemEmployee.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportEmployee.java similarity index 72% rename from src/main/java/com/merge/api/accounting/types/InvoiceLineItemEmployee.java rename to src/main/java/com/merge/api/accounting/types/ExpenseReportEmployee.java index 2a520b08b..88e201375 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportEmployee.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = InvoiceLineItemEmployee.Deserializer.class) -public final class InvoiceLineItemEmployee { +@JsonDeserialize(using = ExpenseReportEmployee.Deserializer.class) +public final class ExpenseReportEmployee { private final Object value; private final int type; - private InvoiceLineItemEmployee(Object value, int type) { + private ExpenseReportEmployee(Object value, int type) { this.value = value; this.type = type; } @@ -42,10 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof InvoiceLineItemEmployee && equalTo((InvoiceLineItemEmployee) other); + return other instanceof ExpenseReportEmployee && equalTo((ExpenseReportEmployee) other); } - private boolean equalTo(InvoiceLineItemEmployee other) { + private boolean equalTo(ExpenseReportEmployee other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static InvoiceLineItemEmployee of(String value) { - return new InvoiceLineItemEmployee(value, 0); + public static ExpenseReportEmployee of(String value) { + return new ExpenseReportEmployee(value, 0); } - public static InvoiceLineItemEmployee of(Employee value) { - return new InvoiceLineItemEmployee(value, 1); + public static ExpenseReportEmployee of(Employee value) { + return new ExpenseReportEmployee(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(Employee value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(InvoiceLineItemEmployee.class); + super(ExpenseReportEmployee.class); } @java.lang.Override - public InvoiceLineItemEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { + public ExpenseReportEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportEndpointRequest.java new file mode 100644 index 000000000..9576ffdb9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportEndpointRequest.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportEndpointRequest.Builder.class) +public final class ExpenseReportEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ExpenseReportRequest model; + + private final Map additionalProperties; + + private ExpenseReportEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ExpenseReportRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ExpenseReportRequest getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportEndpointRequest && equalTo((ExpenseReportEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ExpenseReportRequest model); + + Builder from(ExpenseReportEndpointRequest other); + } + + public interface _FinalStage { + ExpenseReportEndpointRequest build(); + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ExpenseReportRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ExpenseReportEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull ExpenseReportRequest model) { + this.model = model; + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public ExpenseReportEndpointRequest build() { + return new ExpenseReportEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLine.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLine.java new file mode 100644 index 000000000..ec6c74f30 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLine.java @@ -0,0 +1,1435 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportLine.Builder.class) +public final class ExpenseReportLine { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional account; + + private final Optional description; + + private final Optional expenseDate; + + private final Optional amount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional isBillable; + + private final List trackingCategories; + + private final Optional employee; + + private final Optional project; + + private final Optional company; + + private final Optional contact; + + private final Optional quantity; + + private final Optional unitPrice; + + private final Optional nonReimbursable; + + private final Optional taxAmount; + + private final Optional inclusiveOfTax; + + private final Optional taxRate; + + private final Optional remoteWasDeleted; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ExpenseReportLine( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional account, + Optional description, + Optional expenseDate, + Optional amount, + Optional currency, + Optional exchangeRate, + Optional isBillable, + List trackingCategories, + Optional employee, + Optional project, + Optional company, + Optional contact, + Optional quantity, + Optional unitPrice, + Optional nonReimbursable, + Optional taxAmount, + Optional inclusiveOfTax, + Optional taxRate, + Optional remoteWasDeleted, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.account = account; + this.description = description; + this.expenseDate = expenseDate; + this.amount = amount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.isBillable = isBillable; + this.trackingCategories = trackingCategories; + this.employee = employee; + this.project = project; + this.company = company; + this.contact = contact; + this.quantity = quantity; + this.unitPrice = unitPrice; + this.nonReimbursable = nonReimbursable; + this.taxAmount = taxAmount; + this.inclusiveOfTax = inclusiveOfTax; + this.taxRate = taxRate; + this.remoteWasDeleted = remoteWasDeleted; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return Description of the individual expense. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The date the individual expense was incurred. + */ + @JsonProperty("expense_date") + public Optional getExpenseDate() { + return expenseDate; + } + + /** + * @return The amount of the expense for the line item. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return Currency of the expense line (if different from the report currency). + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return Exchange rate used if the line item is in a foreign currency. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return Whether the expense line is billable to a client or project. + */ + @JsonProperty("is_billable") + public Optional getIsBillable() { + return isBillable; + } + + /** + * @return The related tracking categories associated with the expense report (Department, Location, Class, Expense Category) + */ + @JsonProperty("tracking_categories") + public List getTrackingCategories() { + return trackingCategories; + } + + /** + * @return Identifier for the employee who submitted or is associated with the expense report + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + @JsonProperty("project") + public Optional getProject() { + return project; + } + + /** + * @return The subsidiary that the expense report is created in + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return Quantity for the expense line (e.g., miles driven, items purchased). + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return Price per unit for the expense line (if applicable). + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return Whether the expense line is non-reimbursable (e.g., paid via company card). + */ + @JsonProperty("non_reimbursable") + public Optional getNonReimbursable() { + return nonReimbursable; + } + + /** + * @return Tax amount applicable for the line item. + */ + @JsonProperty("tax_amount") + public Optional getTaxAmount() { + return taxAmount; + } + + /** + * @return Whether the amount is inclusive of tax. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLine && equalTo((ExpenseReportLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportLine other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && account.equals(other.account) + && description.equals(other.description) + && expenseDate.equals(other.expenseDate) + && amount.equals(other.amount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && isBillable.equals(other.isBillable) + && trackingCategories.equals(other.trackingCategories) + && employee.equals(other.employee) + && project.equals(other.project) + && company.equals(other.company) + && contact.equals(other.contact) + && quantity.equals(other.quantity) + && unitPrice.equals(other.unitPrice) + && nonReimbursable.equals(other.nonReimbursable) + && taxAmount.equals(other.taxAmount) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && taxRate.equals(other.taxRate) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.account, + this.description, + this.expenseDate, + this.amount, + this.currency, + this.exchangeRate, + this.isBillable, + this.trackingCategories, + this.employee, + this.project, + this.company, + this.contact, + this.quantity, + this.unitPrice, + this.nonReimbursable, + this.taxAmount, + this.inclusiveOfTax, + this.taxRate, + this.remoteWasDeleted, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional expenseDate = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional isBillable = Optional.empty(); + + private List trackingCategories = new ArrayList<>(); + + private Optional employee = Optional.empty(); + + private Optional project = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional nonReimbursable = Optional.empty(); + + private Optional taxAmount = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportLine other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + account(other.getAccount()); + description(other.getDescription()); + expenseDate(other.getExpenseDate()); + amount(other.getAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + isBillable(other.getIsBillable()); + trackingCategories(other.getTrackingCategories()); + employee(other.getEmployee()); + project(other.getProject()); + company(other.getCompany()); + contact(other.getContact()); + quantity(other.getQuantity()); + unitPrice(other.getUnitPrice()); + nonReimbursable(other.getNonReimbursable()); + taxAmount(other.getTaxAmount()); + inclusiveOfTax(other.getInclusiveOfTax()); + taxRate(other.getTaxRate()); + remoteWasDeleted(other.getRemoteWasDeleted()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ExpenseReportLineAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + /** + *

    Description of the individual expense.

    + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The date the individual expense was incurred.

    + */ + @JsonSetter(value = "expense_date", nulls = Nulls.SKIP) + public Builder expenseDate(Optional expenseDate) { + this.expenseDate = expenseDate; + return this; + } + + public Builder expenseDate(OffsetDateTime expenseDate) { + this.expenseDate = Optional.ofNullable(expenseDate); + return this; + } + + /** + *

    The amount of the expense for the line item.

    + */ + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + *

    Currency of the expense line (if different from the report currency).

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseReportLineCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    Exchange rate used if the line item is in a foreign currency.

    + */ + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + /** + *

    Whether the expense line is billable to a client or project.

    + */ + @JsonSetter(value = "is_billable", nulls = Nulls.SKIP) + public Builder isBillable(Optional isBillable) { + this.isBillable = isBillable; + return this; + } + + public Builder isBillable(Boolean isBillable) { + this.isBillable = Optional.ofNullable(isBillable); + return this; + } + + /** + *

    The related tracking categories associated with the expense report (Department, Location, Class, Expense Category)

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(List trackingCategories) { + this.trackingCategories.clear(); + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + public Builder addTrackingCategories(String trackingCategories) { + this.trackingCategories.add(trackingCategories); + return this; + } + + public Builder addAllTrackingCategories(List trackingCategories) { + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + /** + *

    Identifier for the employee who submitted or is associated with the expense report

    + */ + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseReportLineEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "project", nulls = Nulls.SKIP) + public Builder project(Optional project) { + this.project = project; + return this; + } + + public Builder project(ExpenseReportLineProject project) { + this.project = Optional.ofNullable(project); + return this; + } + + /** + *

    The subsidiary that the expense report is created in

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ExpenseReportLineCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(ExpenseReportLineContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + /** + *

    Quantity for the expense line (e.g., miles driven, items purchased).

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(Double quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + *

    Price per unit for the expense line (if applicable).

    + */ + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(Double unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + *

    Whether the expense line is non-reimbursable (e.g., paid via company card).

    + */ + @JsonSetter(value = "non_reimbursable", nulls = Nulls.SKIP) + public Builder nonReimbursable(Optional nonReimbursable) { + this.nonReimbursable = nonReimbursable; + return this; + } + + public Builder nonReimbursable(Boolean nonReimbursable) { + this.nonReimbursable = Optional.ofNullable(nonReimbursable); + return this; + } + + /** + *

    Tax amount applicable for the line item.

    + */ + @JsonSetter(value = "tax_amount", nulls = Nulls.SKIP) + public Builder taxAmount(Optional taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + public Builder taxAmount(Double taxAmount) { + this.taxAmount = Optional.ofNullable(taxAmount); + return this; + } + + /** + *

    Whether the amount is inclusive of tax.

    + */ + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(ExpenseReportLineTaxRate taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ExpenseReportLine build() { + return new ExpenseReportLine( + id, + remoteId, + createdAt, + modifiedAt, + account, + description, + expenseDate, + amount, + currency, + exchangeRate, + isBillable, + trackingCategories, + employee, + project, + company, + contact, + quantity, + unitPrice, + nonReimbursable, + taxAmount, + inclusiveOfTax, + taxRate, + remoteWasDeleted, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineAccount.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineAccount.java new file mode 100644 index 000000000..d6970196a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineAccount.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineAccount.Deserializer.class) +public final class ExpenseReportLineAccount { + private final Object value; + + private final int type; + + private ExpenseReportLineAccount(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Account) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineAccount && equalTo((ExpenseReportLineAccount) other); + } + + private boolean equalTo(ExpenseReportLineAccount other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineAccount of(String value) { + return new ExpenseReportLineAccount(value, 0); + } + + public static ExpenseReportLineAccount of(Account value) { + return new ExpenseReportLineAccount(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Account value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineAccount.class); + } + + @java.lang.Override + public ExpenseReportLineAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Account.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineCompany.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineCompany.java new file mode 100644 index 000000000..bdfdd7384 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineCompany.Deserializer.class) +public final class ExpenseReportLineCompany { + private final Object value; + + private final int type; + + private ExpenseReportLineCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineCompany && equalTo((ExpenseReportLineCompany) other); + } + + private boolean equalTo(ExpenseReportLineCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineCompany of(String value) { + return new ExpenseReportLineCompany(value, 0); + } + + public static ExpenseReportLineCompany of(CompanyInfo value) { + return new ExpenseReportLineCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineCompany.class); + } + + @java.lang.Override + public ExpenseReportLineCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TaxRateTaxComponentsItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineContact.java similarity index 70% rename from src/main/java/com/merge/api/accounting/types/TaxRateTaxComponentsItem.java rename to src/main/java/com/merge/api/accounting/types/ExpenseReportLineContact.java index adc7cfc09..25b007698 100644 --- a/src/main/java/com/merge/api/accounting/types/TaxRateTaxComponentsItem.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineContact.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = TaxRateTaxComponentsItem.Deserializer.class) -public final class TaxRateTaxComponentsItem { +@JsonDeserialize(using = ExpenseReportLineContact.Deserializer.class) +public final class ExpenseReportLineContact { private final Object value; private final int type; - private TaxRateTaxComponentsItem(Object value, int type) { + private ExpenseReportLineContact(Object value, int type) { this.value = value; this.type = type; } @@ -34,7 +34,7 @@ public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((TaxComponent) this.value); + return visitor.visit((Contact) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -42,10 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TaxRateTaxComponentsItem && equalTo((TaxRateTaxComponentsItem) other); + return other instanceof ExpenseReportLineContact && equalTo((ExpenseReportLineContact) other); } - private boolean equalTo(TaxRateTaxComponentsItem other) { + private boolean equalTo(ExpenseReportLineContact other) { return value.equals(other.value); } @@ -59,34 +59,34 @@ public String toString() { return this.value.toString(); } - public static TaxRateTaxComponentsItem of(String value) { - return new TaxRateTaxComponentsItem(value, 0); + public static ExpenseReportLineContact of(String value) { + return new ExpenseReportLineContact(value, 0); } - public static TaxRateTaxComponentsItem of(TaxComponent value) { - return new TaxRateTaxComponentsItem(value, 1); + public static ExpenseReportLineContact of(Contact value) { + return new ExpenseReportLineContact(value, 1); } public interface Visitor { T visit(String value); - T visit(TaxComponent value); + T visit(Contact value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(TaxRateTaxComponentsItem.class); + super(ExpenseReportLineContact.class); } @java.lang.Override - public TaxRateTaxComponentsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + public ExpenseReportLineContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (RuntimeException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaxComponent.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Contact.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineCurrency.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineCurrency.java new file mode 100644 index 000000000..00138b454 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineCurrency.Deserializer.class) +public final class ExpenseReportLineCurrency { + private final Object value; + + private final int type; + + private ExpenseReportLineCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineCurrency && equalTo((ExpenseReportLineCurrency) other); + } + + private boolean equalTo(ExpenseReportLineCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineCurrency of(TransactionCurrencyEnum value) { + return new ExpenseReportLineCurrency(value, 0); + } + + public static ExpenseReportLineCurrency of(String value) { + return new ExpenseReportLineCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineCurrency.class); + } + + @java.lang.Override + public ExpenseReportLineCurrency deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineEmployee.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineEmployee.java new file mode 100644 index 000000000..3054d30e7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineEmployee.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineEmployee.Deserializer.class) +public final class ExpenseReportLineEmployee { + private final Object value; + + private final int type; + + private ExpenseReportLineEmployee(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineEmployee && equalTo((ExpenseReportLineEmployee) other); + } + + private boolean equalTo(ExpenseReportLineEmployee other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineEmployee of(String value) { + return new ExpenseReportLineEmployee(value, 0); + } + + public static ExpenseReportLineEmployee of(Employee value) { + return new ExpenseReportLineEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineEmployee.class); + } + + @java.lang.Override + public ExpenseReportLineEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Employee.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineProject.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineProject.java new file mode 100644 index 000000000..82a3afa0a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineProject.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineProject.Deserializer.class) +public final class ExpenseReportLineProject { + private final Object value; + + private final int type; + + private ExpenseReportLineProject(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Project) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineProject && equalTo((ExpenseReportLineProject) other); + } + + private boolean equalTo(ExpenseReportLineProject other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineProject of(String value) { + return new ExpenseReportLineProject(value, 0); + } + + public static ExpenseReportLineProject of(Project value) { + return new ExpenseReportLineProject(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Project value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineProject.class); + } + + @java.lang.Override + public ExpenseReportLineProject deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Project.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequest.java new file mode 100644 index 000000000..3eea423b3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequest.java @@ -0,0 +1,1366 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportLineRequest.Builder.class) +public final class ExpenseReportLineRequest { + private final Optional remoteId; + + private final Optional account; + + private final Optional description; + + private final Optional expenseDate; + + private final Optional amount; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional isBillable; + + private final List trackingCategories; + + private final Optional employee; + + private final Optional project; + + private final Optional company; + + private final Optional contact; + + private final Optional quantity; + + private final Optional unitPrice; + + private final Optional nonReimbursable; + + private final Optional taxAmount; + + private final Optional inclusiveOfTax; + + private final Optional taxRate; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ExpenseReportLineRequest( + Optional remoteId, + Optional account, + Optional description, + Optional expenseDate, + Optional amount, + Optional currency, + Optional exchangeRate, + Optional isBillable, + List trackingCategories, + Optional employee, + Optional project, + Optional company, + Optional contact, + Optional quantity, + Optional unitPrice, + Optional nonReimbursable, + Optional taxAmount, + Optional inclusiveOfTax, + Optional taxRate, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.account = account; + this.description = description; + this.expenseDate = expenseDate; + this.amount = amount; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.isBillable = isBillable; + this.trackingCategories = trackingCategories; + this.employee = employee; + this.project = project; + this.company = company; + this.contact = contact; + this.quantity = quantity; + this.unitPrice = unitPrice; + this.nonReimbursable = nonReimbursable; + this.taxAmount = taxAmount; + this.inclusiveOfTax = inclusiveOfTax; + this.taxRate = taxRate; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @JsonProperty("account") + public Optional getAccount() { + return account; + } + + /** + * @return Description of the individual expense. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The date the individual expense was incurred. + */ + @JsonProperty("expense_date") + public Optional getExpenseDate() { + return expenseDate; + } + + /** + * @return The amount of the expense for the line item. + */ + @JsonProperty("amount") + public Optional getAmount() { + return amount; + } + + /** + * @return Currency of the expense line (if different from the report currency). + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return Exchange rate used if the line item is in a foreign currency. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return Whether the expense line is billable to a client or project. + */ + @JsonProperty("is_billable") + public Optional getIsBillable() { + return isBillable; + } + + /** + * @return The related tracking categories associated with the expense report (Department, Location, Class, Expense Category) + */ + @JsonProperty("tracking_categories") + public List getTrackingCategories() { + return trackingCategories; + } + + /** + * @return Identifier for the employee who submitted or is associated with the expense report + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + @JsonProperty("project") + public Optional getProject() { + return project; + } + + /** + * @return The subsidiary that the expense report is created in + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + + /** + * @return Quantity for the expense line (e.g., miles driven, items purchased). + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return Price per unit for the expense line (if applicable). + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return Whether the expense line is non-reimbursable (e.g., paid via company card). + */ + @JsonProperty("non_reimbursable") + public Optional getNonReimbursable() { + return nonReimbursable; + } + + /** + * @return Tax amount applicable for the line item. + */ + @JsonProperty("tax_amount") + public Optional getTaxAmount() { + return taxAmount; + } + + /** + * @return Whether the amount is inclusive of tax. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineRequest && equalTo((ExpenseReportLineRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportLineRequest other) { + return remoteId.equals(other.remoteId) + && account.equals(other.account) + && description.equals(other.description) + && expenseDate.equals(other.expenseDate) + && amount.equals(other.amount) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && isBillable.equals(other.isBillable) + && trackingCategories.equals(other.trackingCategories) + && employee.equals(other.employee) + && project.equals(other.project) + && company.equals(other.company) + && contact.equals(other.contact) + && quantity.equals(other.quantity) + && unitPrice.equals(other.unitPrice) + && nonReimbursable.equals(other.nonReimbursable) + && taxAmount.equals(other.taxAmount) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && taxRate.equals(other.taxRate) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.account, + this.description, + this.expenseDate, + this.amount, + this.currency, + this.exchangeRate, + this.isBillable, + this.trackingCategories, + this.employee, + this.project, + this.company, + this.contact, + this.quantity, + this.unitPrice, + this.nonReimbursable, + this.taxAmount, + this.inclusiveOfTax, + this.taxRate, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteId = Optional.empty(); + + private Optional account = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional expenseDate = Optional.empty(); + + private Optional amount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional isBillable = Optional.empty(); + + private List trackingCategories = new ArrayList<>(); + + private Optional employee = Optional.empty(); + + private Optional project = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional contact = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional nonReimbursable = Optional.empty(); + + private Optional taxAmount = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportLineRequest other) { + remoteId(other.getRemoteId()); + account(other.getAccount()); + description(other.getDescription()); + expenseDate(other.getExpenseDate()); + amount(other.getAmount()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + isBillable(other.getIsBillable()); + trackingCategories(other.getTrackingCategories()); + employee(other.getEmployee()); + project(other.getProject()); + company(other.getCompany()); + contact(other.getContact()); + quantity(other.getQuantity()); + unitPrice(other.getUnitPrice()); + nonReimbursable(other.getNonReimbursable()); + taxAmount(other.getTaxAmount()); + inclusiveOfTax(other.getInclusiveOfTax()); + taxRate(other.getTaxRate()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public Builder account(Optional account) { + this.account = account; + return this; + } + + public Builder account(ExpenseReportLineRequestAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + /** + *

    Description of the individual expense.

    + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The date the individual expense was incurred.

    + */ + @JsonSetter(value = "expense_date", nulls = Nulls.SKIP) + public Builder expenseDate(Optional expenseDate) { + this.expenseDate = expenseDate; + return this; + } + + public Builder expenseDate(OffsetDateTime expenseDate) { + this.expenseDate = Optional.ofNullable(expenseDate); + return this; + } + + /** + *

    The amount of the expense for the line item.

    + */ + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public Builder amount(Optional amount) { + this.amount = amount; + return this; + } + + public Builder amount(Double amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + *

    Currency of the expense line (if different from the report currency).

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseReportLineRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    Exchange rate used if the line item is in a foreign currency.

    + */ + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + /** + *

    Whether the expense line is billable to a client or project.

    + */ + @JsonSetter(value = "is_billable", nulls = Nulls.SKIP) + public Builder isBillable(Optional isBillable) { + this.isBillable = isBillable; + return this; + } + + public Builder isBillable(Boolean isBillable) { + this.isBillable = Optional.ofNullable(isBillable); + return this; + } + + /** + *

    The related tracking categories associated with the expense report (Department, Location, Class, Expense Category)

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(List trackingCategories) { + this.trackingCategories.clear(); + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + public Builder addTrackingCategories(String trackingCategories) { + this.trackingCategories.add(trackingCategories); + return this; + } + + public Builder addAllTrackingCategories(List trackingCategories) { + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + /** + *

    Identifier for the employee who submitted or is associated with the expense report

    + */ + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseReportLineRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @JsonSetter(value = "project", nulls = Nulls.SKIP) + public Builder project(Optional project) { + this.project = project; + return this; + } + + public Builder project(ExpenseReportLineRequestProject project) { + this.project = Optional.ofNullable(project); + return this; + } + + /** + *

    The subsidiary that the expense report is created in

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ExpenseReportLineRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(ExpenseReportLineRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + /** + *

    Quantity for the expense line (e.g., miles driven, items purchased).

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(Double quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + *

    Price per unit for the expense line (if applicable).

    + */ + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(Double unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + *

    Whether the expense line is non-reimbursable (e.g., paid via company card).

    + */ + @JsonSetter(value = "non_reimbursable", nulls = Nulls.SKIP) + public Builder nonReimbursable(Optional nonReimbursable) { + this.nonReimbursable = nonReimbursable; + return this; + } + + public Builder nonReimbursable(Boolean nonReimbursable) { + this.nonReimbursable = Optional.ofNullable(nonReimbursable); + return this; + } + + /** + *

    Tax amount applicable for the line item.

    + */ + @JsonSetter(value = "tax_amount", nulls = Nulls.SKIP) + public Builder taxAmount(Optional taxAmount) { + this.taxAmount = taxAmount; + return this; + } + + public Builder taxAmount(Double taxAmount) { + this.taxAmount = Optional.ofNullable(taxAmount); + return this; + } + + /** + *

    Whether the amount is inclusive of tax.

    + */ + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(ExpenseReportLineRequestTaxRate taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ExpenseReportLineRequest build() { + return new ExpenseReportLineRequest( + remoteId, + account, + description, + expenseDate, + amount, + currency, + exchangeRate, + isBillable, + trackingCategories, + employee, + project, + company, + contact, + quantity, + unitPrice, + nonReimbursable, + taxAmount, + inclusiveOfTax, + taxRate, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccount.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestAccount.java similarity index 70% rename from src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccount.java rename to src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestAccount.java index 00a89d5db..70d083152 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAccount.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestAccount.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = PatchedPaymentRequestAccount.Deserializer.class) -public final class PatchedPaymentRequestAccount { +@JsonDeserialize(using = ExpenseReportLineRequestAccount.Deserializer.class) +public final class ExpenseReportLineRequestAccount { private final Object value; private final int type; - private PatchedPaymentRequestAccount(Object value, int type) { + private ExpenseReportLineRequestAccount(Object value, int type) { this.value = value; this.type = type; } @@ -42,10 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof PatchedPaymentRequestAccount && equalTo((PatchedPaymentRequestAccount) other); + return other instanceof ExpenseReportLineRequestAccount && equalTo((ExpenseReportLineRequestAccount) other); } - private boolean equalTo(PatchedPaymentRequestAccount other) { + private boolean equalTo(ExpenseReportLineRequestAccount other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static PatchedPaymentRequestAccount of(String value) { - return new PatchedPaymentRequestAccount(value, 0); + public static ExpenseReportLineRequestAccount of(String value) { + return new ExpenseReportLineRequestAccount(value, 0); } - public static PatchedPaymentRequestAccount of(Account value) { - return new PatchedPaymentRequestAccount(value, 1); + public static ExpenseReportLineRequestAccount of(Account value) { + return new ExpenseReportLineRequestAccount(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(Account value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(PatchedPaymentRequestAccount.class); + super(ExpenseReportLineRequestAccount.class); } @java.lang.Override - public PatchedPaymentRequestAccount deserialize(JsonParser p, DeserializationContext context) + public ExpenseReportLineRequestAccount deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestCompany.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestCompany.java new file mode 100644 index 000000000..b456e2943 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestCompany.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineRequestCompany.Deserializer.class) +public final class ExpenseReportLineRequestCompany { + private final Object value; + + private final int type; + + private ExpenseReportLineRequestCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineRequestCompany && equalTo((ExpenseReportLineRequestCompany) other); + } + + private boolean equalTo(ExpenseReportLineRequestCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineRequestCompany of(String value) { + return new ExpenseReportLineRequestCompany(value, 0); + } + + public static ExpenseReportLineRequestCompany of(CompanyInfo value) { + return new ExpenseReportLineRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineRequestCompany.class); + } + + @java.lang.Override + public ExpenseReportLineRequestCompany deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestContact.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestContact.java similarity index 70% rename from src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestContact.java rename to src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestContact.java index ffbd3f4fe..f34cf0112 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestContact.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestContact.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = PatchedPaymentRequestContact.Deserializer.class) -public final class PatchedPaymentRequestContact { +@JsonDeserialize(using = ExpenseReportLineRequestContact.Deserializer.class) +public final class ExpenseReportLineRequestContact { private final Object value; private final int type; - private PatchedPaymentRequestContact(Object value, int type) { + private ExpenseReportLineRequestContact(Object value, int type) { this.value = value; this.type = type; } @@ -42,10 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof PatchedPaymentRequestContact && equalTo((PatchedPaymentRequestContact) other); + return other instanceof ExpenseReportLineRequestContact && equalTo((ExpenseReportLineRequestContact) other); } - private boolean equalTo(PatchedPaymentRequestContact other) { + private boolean equalTo(ExpenseReportLineRequestContact other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static PatchedPaymentRequestContact of(String value) { - return new PatchedPaymentRequestContact(value, 0); + public static ExpenseReportLineRequestContact of(String value) { + return new ExpenseReportLineRequestContact(value, 0); } - public static PatchedPaymentRequestContact of(Contact value) { - return new PatchedPaymentRequestContact(value, 1); + public static ExpenseReportLineRequestContact of(Contact value) { + return new ExpenseReportLineRequestContact(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(Contact value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(PatchedPaymentRequestContact.class); + super(ExpenseReportLineRequestContact.class); } @java.lang.Override - public PatchedPaymentRequestContact deserialize(JsonParser p, DeserializationContext context) + public ExpenseReportLineRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestCurrency.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestCurrency.java new file mode 100644 index 000000000..784bd323a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestCurrency.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineRequestCurrency.Deserializer.class) +public final class ExpenseReportLineRequestCurrency { + private final Object value; + + private final int type; + + private ExpenseReportLineRequestCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineRequestCurrency && equalTo((ExpenseReportLineRequestCurrency) other); + } + + private boolean equalTo(ExpenseReportLineRequestCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineRequestCurrency of(TransactionCurrencyEnum value) { + return new ExpenseReportLineRequestCurrency(value, 0); + } + + public static ExpenseReportLineRequestCurrency of(String value) { + return new ExpenseReportLineRequestCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineRequestCurrency.class); + } + + @java.lang.Override + public ExpenseReportLineRequestCurrency deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestEmployee.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestEmployee.java new file mode 100644 index 000000000..e34889fd8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestEmployee.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineRequestEmployee.Deserializer.class) +public final class ExpenseReportLineRequestEmployee { + private final Object value; + + private final int type; + + private ExpenseReportLineRequestEmployee(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Employee) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineRequestEmployee && equalTo((ExpenseReportLineRequestEmployee) other); + } + + private boolean equalTo(ExpenseReportLineRequestEmployee other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineRequestEmployee of(String value) { + return new ExpenseReportLineRequestEmployee(value, 0); + } + + public static ExpenseReportLineRequestEmployee of(Employee value) { + return new ExpenseReportLineRequestEmployee(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Employee value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineRequestEmployee.class); + } + + @java.lang.Override + public ExpenseReportLineRequestEmployee deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Employee.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestProject.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestProject.java new file mode 100644 index 000000000..c131d0cee --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestProject.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineRequestProject.Deserializer.class) +public final class ExpenseReportLineRequestProject { + private final Object value; + + private final int type; + + private ExpenseReportLineRequestProject(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Project) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineRequestProject && equalTo((ExpenseReportLineRequestProject) other); + } + + private boolean equalTo(ExpenseReportLineRequestProject other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineRequestProject of(String value) { + return new ExpenseReportLineRequestProject(value, 0); + } + + public static ExpenseReportLineRequestProject of(Project value) { + return new ExpenseReportLineRequestProject(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Project value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineRequestProject.class); + } + + @java.lang.Override + public ExpenseReportLineRequestProject deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Project.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestTaxRate.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestTaxRate.java new file mode 100644 index 000000000..1b89e499f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineRequestTaxRate.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineRequestTaxRate.Deserializer.class) +public final class ExpenseReportLineRequestTaxRate { + private final Object value; + + private final int type; + + private ExpenseReportLineRequestTaxRate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TaxRate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineRequestTaxRate && equalTo((ExpenseReportLineRequestTaxRate) other); + } + + private boolean equalTo(ExpenseReportLineRequestTaxRate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineRequestTaxRate of(String value) { + return new ExpenseReportLineRequestTaxRate(value, 0); + } + + public static ExpenseReportLineRequestTaxRate of(TaxRate value) { + return new ExpenseReportLineRequestTaxRate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TaxRate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineRequestTaxRate.class); + } + + @java.lang.Override + public ExpenseReportLineRequestTaxRate deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaxRate.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLineTaxRate.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineTaxRate.java new file mode 100644 index 000000000..41fdce814 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLineTaxRate.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLineTaxRate.Deserializer.class) +public final class ExpenseReportLineTaxRate { + private final Object value; + + private final int type; + + private ExpenseReportLineTaxRate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TaxRate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLineTaxRate && equalTo((ExpenseReportLineTaxRate) other); + } + + private boolean equalTo(ExpenseReportLineTaxRate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLineTaxRate of(String value) { + return new ExpenseReportLineTaxRate(value, 0); + } + + public static ExpenseReportLineTaxRate of(TaxRate value) { + return new ExpenseReportLineTaxRate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TaxRate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLineTaxRate.class); + } + + @java.lang.Override + public ExpenseReportLineTaxRate deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaxRate.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportLinesItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportLinesItem.java new file mode 100644 index 000000000..cfcbf311e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportLinesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportLinesItem.Deserializer.class) +public final class ExpenseReportLinesItem { + private final Object value; + + private final int type; + + private ExpenseReportLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((ExpenseReportLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportLinesItem && equalTo((ExpenseReportLinesItem) other); + } + + private boolean equalTo(ExpenseReportLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportLinesItem of(String value) { + return new ExpenseReportLinesItem(value, 0); + } + + public static ExpenseReportLinesItem of(ExpenseReportLine value) { + return new ExpenseReportLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ExpenseReportLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportLinesItem.class); + } + + @java.lang.Override + public ExpenseReportLinesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ExpenseReportLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequest.java new file mode 100644 index 000000000..c84a1bf7d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequest.java @@ -0,0 +1,1146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportRequest.Builder.class) +public final class ExpenseReportRequest { + private final Optional expenseReportUrl; + + private final Optional reportDate; + + private final Optional reportIdentifier; + + private final Optional employee; + + private final Optional status; + + private final Optional totalAmount; + + private final Optional currency; + + private final Optional description; + + private final Optional accountingPeriod; + + private final Optional company; + + private final List trackingCategories; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ExpenseReportRequest( + Optional expenseReportUrl, + Optional reportDate, + Optional reportIdentifier, + Optional employee, + Optional status, + Optional totalAmount, + Optional currency, + Optional description, + Optional accountingPeriod, + Optional company, + List trackingCategories, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.expenseReportUrl = expenseReportUrl; + this.reportDate = reportDate; + this.reportIdentifier = reportIdentifier; + this.employee = employee; + this.status = status; + this.totalAmount = totalAmount; + this.currency = currency; + this.description = description; + this.accountingPeriod = accountingPeriod; + this.company = company; + this.trackingCategories = trackingCategories; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The 3rd party URL of the expense report. + */ + @JsonProperty("expense_report_url") + public Optional getExpenseReportUrl() { + return expenseReportUrl; + } + + /** + * @return The date of the expense report. + */ + @JsonProperty("report_date") + public Optional getReportDate() { + return reportDate; + } + + /** + * @return Human-readable expense report identifier. + */ + @JsonProperty("report_identifier") + public Optional getReportIdentifier() { + return reportIdentifier; + } + + /** + * @return Identifier for the employee who submitted or is associated with the expense report + */ + @JsonProperty("employee") + public Optional getEmployee() { + return employee; + } + + /** + * @return Overall status of the expense report. One of DRAFT, SUBMITTED, APPROVED, REJECTED + *
      + *
    • DRAFT - DRAFT
    • + *
    • SUBMITTED - SUBMITTED
    • + *
    • APPROVED - APPROVED
    • + *
    • REJECTED - REJECTED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Total amount of the expense report + */ + @JsonProperty("total_amount") + public Optional getTotalAmount() { + return totalAmount; + } + + /** + * @return Currency code for the expense report + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return A brief description or purpose for the expense report + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The accounting period the report was posted in + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + + /** + * @return The subsidiary that the expense report is created in + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The related tracking categories associated with the expense report + */ + @JsonProperty("tracking_categories") + public List getTrackingCategories() { + return trackingCategories; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportRequest && equalTo((ExpenseReportRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportRequest other) { + return expenseReportUrl.equals(other.expenseReportUrl) + && reportDate.equals(other.reportDate) + && reportIdentifier.equals(other.reportIdentifier) + && employee.equals(other.employee) + && status.equals(other.status) + && totalAmount.equals(other.totalAmount) + && currency.equals(other.currency) + && description.equals(other.description) + && accountingPeriod.equals(other.accountingPeriod) + && company.equals(other.company) + && trackingCategories.equals(other.trackingCategories) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expenseReportUrl, + this.reportDate, + this.reportIdentifier, + this.employee, + this.status, + this.totalAmount, + this.currency, + this.description, + this.accountingPeriod, + this.company, + this.trackingCategories, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional expenseReportUrl = Optional.empty(); + + private Optional reportDate = Optional.empty(); + + private Optional reportIdentifier = Optional.empty(); + + private Optional employee = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional totalAmount = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional accountingPeriod = Optional.empty(); + + private Optional company = Optional.empty(); + + private List trackingCategories = new ArrayList<>(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportRequest other) { + expenseReportUrl(other.getExpenseReportUrl()); + reportDate(other.getReportDate()); + reportIdentifier(other.getReportIdentifier()); + employee(other.getEmployee()); + status(other.getStatus()); + totalAmount(other.getTotalAmount()); + currency(other.getCurrency()); + description(other.getDescription()); + accountingPeriod(other.getAccountingPeriod()); + company(other.getCompany()); + trackingCategories(other.getTrackingCategories()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The 3rd party URL of the expense report.

    + */ + @JsonSetter(value = "expense_report_url", nulls = Nulls.SKIP) + public Builder expenseReportUrl(Optional expenseReportUrl) { + this.expenseReportUrl = expenseReportUrl; + return this; + } + + public Builder expenseReportUrl(String expenseReportUrl) { + this.expenseReportUrl = Optional.ofNullable(expenseReportUrl); + return this; + } + + /** + *

    The date of the expense report.

    + */ + @JsonSetter(value = "report_date", nulls = Nulls.SKIP) + public Builder reportDate(Optional reportDate) { + this.reportDate = reportDate; + return this; + } + + public Builder reportDate(OffsetDateTime reportDate) { + this.reportDate = Optional.ofNullable(reportDate); + return this; + } + + /** + *

    Human-readable expense report identifier.

    + */ + @JsonSetter(value = "report_identifier", nulls = Nulls.SKIP) + public Builder reportIdentifier(Optional reportIdentifier) { + this.reportIdentifier = reportIdentifier; + return this; + } + + public Builder reportIdentifier(String reportIdentifier) { + this.reportIdentifier = Optional.ofNullable(reportIdentifier); + return this; + } + + /** + *

    Identifier for the employee who submitted or is associated with the expense report

    + */ + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public Builder employee(Optional employee) { + this.employee = employee; + return this; + } + + public Builder employee(ExpenseReportRequestEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + /** + *

    Overall status of the expense report. One of DRAFT, SUBMITTED, APPROVED, REJECTED

    + *
      + *
    • DRAFT - DRAFT
    • + *
    • SUBMITTED - SUBMITTED
    • + *
    • APPROVED - APPROVED
    • + *
    • REJECTED - REJECTED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ExpenseReportRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    Total amount of the expense report

    + */ + @JsonSetter(value = "total_amount", nulls = Nulls.SKIP) + public Builder totalAmount(Optional totalAmount) { + this.totalAmount = totalAmount; + return this; + } + + public Builder totalAmount(Double totalAmount) { + this.totalAmount = Optional.ofNullable(totalAmount); + return this; + } + + /** + *

    Currency code for the expense report

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(ExpenseReportRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    A brief description or purpose for the expense report

    + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The accounting period the report was posted in

    + */ + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(ExpenseReportRequestAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + + /** + *

    The subsidiary that the expense report is created in

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ExpenseReportRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    The related tracking categories associated with the expense report

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(List trackingCategories) { + this.trackingCategories.clear(); + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + public Builder addTrackingCategories(String trackingCategories) { + this.trackingCategories.add(trackingCategories); + return this; + } + + public Builder addAllTrackingCategories(List trackingCategories) { + if (trackingCategories != null) { + this.trackingCategories.addAll(trackingCategories); + } + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ExpenseReportRequest build() { + return new ExpenseReportRequest( + expenseReportUrl, + reportDate, + reportIdentifier, + employee, + status, + totalAmount, + currency, + description, + accountingPeriod, + company, + trackingCategories, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestAccountingPeriod.java new file mode 100644 index 000000000..759039afa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestAccountingPeriod.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportRequestAccountingPeriod.Deserializer.class) +public final class ExpenseReportRequestAccountingPeriod { + private final Object value; + + private final int type; + + private ExpenseReportRequestAccountingPeriod(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportRequestAccountingPeriod + && equalTo((ExpenseReportRequestAccountingPeriod) other); + } + + private boolean equalTo(ExpenseReportRequestAccountingPeriod other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportRequestAccountingPeriod of(String value) { + return new ExpenseReportRequestAccountingPeriod(value, 0); + } + + public static ExpenseReportRequestAccountingPeriod of(AccountingPeriod value) { + return new ExpenseReportRequestAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportRequestAccountingPeriod.class); + } + + @java.lang.Override + public ExpenseReportRequestAccountingPeriod deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountingPeriod.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldRemoteFieldClass.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestCompany.java similarity index 68% rename from src/main/java/com/merge/api/accounting/types/RemoteFieldRemoteFieldClass.java rename to src/main/java/com/merge/api/accounting/types/ExpenseReportRequestCompany.java index d9f552b32..50535a2d1 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteFieldRemoteFieldClass.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestCompany.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = RemoteFieldRemoteFieldClass.Deserializer.class) -public final class RemoteFieldRemoteFieldClass { +@JsonDeserialize(using = ExpenseReportRequestCompany.Deserializer.class) +public final class ExpenseReportRequestCompany { private final Object value; private final int type; - private RemoteFieldRemoteFieldClass(Object value, int type) { + private ExpenseReportRequestCompany(Object value, int type) { this.value = value; this.type = type; } @@ -34,7 +34,7 @@ public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((RemoteFieldClass) this.value); + return visitor.visit((CompanyInfo) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -42,10 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof RemoteFieldRemoteFieldClass && equalTo((RemoteFieldRemoteFieldClass) other); + return other instanceof ExpenseReportRequestCompany && equalTo((ExpenseReportRequestCompany) other); } - private boolean equalTo(RemoteFieldRemoteFieldClass other) { + private boolean equalTo(ExpenseReportRequestCompany other) { return value.equals(other.value); } @@ -59,27 +59,27 @@ public String toString() { return this.value.toString(); } - public static RemoteFieldRemoteFieldClass of(String value) { - return new RemoteFieldRemoteFieldClass(value, 0); + public static ExpenseReportRequestCompany of(String value) { + return new ExpenseReportRequestCompany(value, 0); } - public static RemoteFieldRemoteFieldClass of(RemoteFieldClass value) { - return new RemoteFieldRemoteFieldClass(value, 1); + public static ExpenseReportRequestCompany of(CompanyInfo value) { + return new ExpenseReportRequestCompany(value, 1); } public interface Visitor { T visit(String value); - T visit(RemoteFieldClass value); + T visit(CompanyInfo value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(RemoteFieldRemoteFieldClass.class); + super(ExpenseReportRequestCompany.class); } @java.lang.Override - public RemoteFieldRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + public ExpenseReportRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { @@ -87,7 +87,7 @@ public RemoteFieldRemoteFieldClass deserialize(JsonParser p, DeserializationCont } catch (RuntimeException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestCurrency.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestCurrency.java new file mode 100644 index 000000000..fee35064d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestCurrency.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportRequestCurrency.Deserializer.class) +public final class ExpenseReportRequestCurrency { + private final Object value; + + private final int type; + + private ExpenseReportRequestCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportRequestCurrency && equalTo((ExpenseReportRequestCurrency) other); + } + + private boolean equalTo(ExpenseReportRequestCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportRequestCurrency of(TransactionCurrencyEnum value) { + return new ExpenseReportRequestCurrency(value, 0); + } + + public static ExpenseReportRequestCurrency of(String value) { + return new ExpenseReportRequestCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportRequestCurrency.class); + } + + @java.lang.Override + public ExpenseReportRequestCurrency deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequestEmployee.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestEmployee.java similarity index 70% rename from src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequestEmployee.java rename to src/main/java/com/merge/api/accounting/types/ExpenseReportRequestEmployee.java index c4deb53ff..9f30c1129 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequestEmployee.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestEmployee.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = InvoiceLineItemRequestEmployee.Deserializer.class) -public final class InvoiceLineItemRequestEmployee { +@JsonDeserialize(using = ExpenseReportRequestEmployee.Deserializer.class) +public final class ExpenseReportRequestEmployee { private final Object value; private final int type; - private InvoiceLineItemRequestEmployee(Object value, int type) { + private ExpenseReportRequestEmployee(Object value, int type) { this.value = value; this.type = type; } @@ -42,10 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof InvoiceLineItemRequestEmployee && equalTo((InvoiceLineItemRequestEmployee) other); + return other instanceof ExpenseReportRequestEmployee && equalTo((ExpenseReportRequestEmployee) other); } - private boolean equalTo(InvoiceLineItemRequestEmployee other) { + private boolean equalTo(ExpenseReportRequestEmployee other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static InvoiceLineItemRequestEmployee of(String value) { - return new InvoiceLineItemRequestEmployee(value, 0); + public static ExpenseReportRequestEmployee of(String value) { + return new ExpenseReportRequestEmployee(value, 0); } - public static InvoiceLineItemRequestEmployee of(Employee value) { - return new InvoiceLineItemRequestEmployee(value, 1); + public static ExpenseReportRequestEmployee of(Employee value) { + return new ExpenseReportRequestEmployee(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(Employee value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(InvoiceLineItemRequestEmployee.class); + super(ExpenseReportRequestEmployee.class); } @java.lang.Override - public InvoiceLineItemRequestEmployee deserialize(JsonParser p, DeserializationContext context) + public ExpenseReportRequestEmployee deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestStatus.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestStatus.java new file mode 100644 index 000000000..879d748f5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportRequestStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportRequestStatus.Deserializer.class) +public final class ExpenseReportRequestStatus { + private final Object value; + + private final int type; + + private ExpenseReportRequestStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ExpenseReportStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportRequestStatus && equalTo((ExpenseReportRequestStatus) other); + } + + private boolean equalTo(ExpenseReportRequestStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportRequestStatus of(ExpenseReportStatusEnum value) { + return new ExpenseReportRequestStatus(value, 0); + } + + public static ExpenseReportRequestStatus of(String value) { + return new ExpenseReportRequestStatus(value, 1); + } + + public interface Visitor { + T visit(ExpenseReportStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportRequestStatus.class); + } + + @java.lang.Override + public ExpenseReportRequestStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ExpenseReportStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportResponse.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportResponse.java new file mode 100644 index 000000000..59c93f87c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportResponse.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportResponse.Builder.class) +public final class ExpenseReportResponse { + private final ExpenseReport model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private ExpenseReportResponse( + ExpenseReport model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public ExpenseReport getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportResponse && equalTo((ExpenseReportResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ExpenseReport model); + + Builder from(ExpenseReportResponse other); + } + + public interface _FinalStage { + ExpenseReportResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ExpenseReport model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ExpenseReportResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull ExpenseReport model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public ExpenseReportResponse build() { + return new ExpenseReportResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportStatus.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportStatus.java new file mode 100644 index 000000000..396ebb127 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseReportStatus.Deserializer.class) +public final class ExpenseReportStatus { + private final Object value; + + private final int type; + + private ExpenseReportStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ExpenseReportStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportStatus && equalTo((ExpenseReportStatus) other); + } + + private boolean equalTo(ExpenseReportStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseReportStatus of(ExpenseReportStatusEnum value) { + return new ExpenseReportStatus(value, 0); + } + + public static ExpenseReportStatus of(String value) { + return new ExpenseReportStatus(value, 1); + } + + public interface Visitor { + T visit(ExpenseReportStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseReportStatus.class); + } + + @java.lang.Override + public ExpenseReportStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ExpenseReportStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportStatusEnum.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportStatusEnum.java new file mode 100644 index 000000000..af8eff6ea --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportStatusEnum.java @@ -0,0 +1,104 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ExpenseReportStatusEnum { + public static final ExpenseReportStatusEnum SUBMITTED = new ExpenseReportStatusEnum(Value.SUBMITTED, "SUBMITTED"); + + public static final ExpenseReportStatusEnum DRAFT = new ExpenseReportStatusEnum(Value.DRAFT, "DRAFT"); + + public static final ExpenseReportStatusEnum REJECTED = new ExpenseReportStatusEnum(Value.REJECTED, "REJECTED"); + + public static final ExpenseReportStatusEnum APPROVED = new ExpenseReportStatusEnum(Value.APPROVED, "APPROVED"); + + private final Value value; + + private final String string; + + ExpenseReportStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ExpenseReportStatusEnum + && this.string.equals(((ExpenseReportStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SUBMITTED: + return visitor.visitSubmitted(); + case DRAFT: + return visitor.visitDraft(); + case REJECTED: + return visitor.visitRejected(); + case APPROVED: + return visitor.visitApproved(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ExpenseReportStatusEnum valueOf(String value) { + switch (value) { + case "SUBMITTED": + return SUBMITTED; + case "DRAFT": + return DRAFT; + case "REJECTED": + return REJECTED; + case "APPROVED": + return APPROVED; + default: + return new ExpenseReportStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DRAFT, + + SUBMITTED, + + APPROVED, + + REJECTED, + + UNKNOWN + } + + public interface Visitor { + T visitDraft(); + + T visitSubmitted(); + + T visitApproved(); + + T visitRejected(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesListRequest.java new file mode 100644 index 000000000..f5e5e0a86 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesListRequest.java @@ -0,0 +1,305 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportsLinesListRequest.Builder.class) +public final class ExpenseReportsLinesListRequest { + private final Optional> expand; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ExpenseReportsLinesListRequest( + Optional> expand, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional pageSize, + Map additionalProperties) { + this.expand = expand; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportsLinesListRequest && equalTo((ExpenseReportsLinesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportsLinesListRequest other) { + return expand.equals(other.expand) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportsLinesListRequest other) { + expand(other.getExpand()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ExpenseReportsLinesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

    + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ExpenseReportsLinesListRequest build() { + return new ExpenseReportsLinesListRequest( + expand, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesListRequestExpandItem.java new file mode 100644 index 000000000..e81be0cb1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesListRequestExpandItem.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ExpenseReportsLinesListRequestExpandItem { + public static final ExpenseReportsLinesListRequestExpandItem TAX_RATE = + new ExpenseReportsLinesListRequestExpandItem(Value.TAX_RATE, "tax_rate"); + + public static final ExpenseReportsLinesListRequestExpandItem PROJECT = + new ExpenseReportsLinesListRequestExpandItem(Value.PROJECT, "project"); + + public static final ExpenseReportsLinesListRequestExpandItem ACCOUNT = + new ExpenseReportsLinesListRequestExpandItem(Value.ACCOUNT, "account"); + + public static final ExpenseReportsLinesListRequestExpandItem EMPLOYEE = + new ExpenseReportsLinesListRequestExpandItem(Value.EMPLOYEE, "employee"); + + public static final ExpenseReportsLinesListRequestExpandItem CONTACT = + new ExpenseReportsLinesListRequestExpandItem(Value.CONTACT, "contact"); + + public static final ExpenseReportsLinesListRequestExpandItem COMPANY = + new ExpenseReportsLinesListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + ExpenseReportsLinesListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ExpenseReportsLinesListRequestExpandItem + && this.string.equals(((ExpenseReportsLinesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TAX_RATE: + return visitor.visitTaxRate(); + case PROJECT: + return visitor.visitProject(); + case ACCOUNT: + return visitor.visitAccount(); + case EMPLOYEE: + return visitor.visitEmployee(); + case CONTACT: + return visitor.visitContact(); + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ExpenseReportsLinesListRequestExpandItem valueOf(String value) { + switch (value) { + case "tax_rate": + return TAX_RATE; + case "project": + return PROJECT; + case "account": + return ACCOUNT; + case "employee": + return EMPLOYEE; + case "contact": + return CONTACT; + case "company": + return COMPANY; + default: + return new ExpenseReportsLinesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNT, + + COMPANY, + + CONTACT, + + EMPLOYEE, + + PROJECT, + + TAX_RATE, + + UNKNOWN + } + + public interface Visitor { + T visitAccount(); + + T visitCompany(); + + T visitContact(); + + T visitEmployee(); + + T visitProject(); + + T visitTaxRate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..763c5d891 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsLinesRemoteFieldClassesListRequest.java @@ -0,0 +1,299 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportsLinesRemoteFieldClassesListRequest.Builder.class) +public final class ExpenseReportsLinesRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional isCustom; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ExpenseReportsLinesRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonModelField, + Optional isCustom, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.isCustom = isCustom; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return If provided, will only return remote fields classes with this is_custom value + */ + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportsLinesRemoteFieldClassesListRequest + && equalTo((ExpenseReportsLinesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportsLinesRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && isCustom.equals(other.isCustom) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.isCustom, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportsLinesRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + isCustom(other.getIsCustom()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, will only return remote field classes with this is_common_model_field value

    + */ + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + /** + *

    If provided, will only return remote fields classes with this is_custom value

    + */ + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ExpenseReportsLinesRemoteFieldClassesListRequest build() { + return new ExpenseReportsLinesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + isCustom, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsListRequest.java new file mode 100644 index 000000000..ac932a1dc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsListRequest.java @@ -0,0 +1,498 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportsListRequest.Builder.class) +public final class ExpenseReportsListRequest { + private final Optional> expand; + + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private ExpenseReportsListRequest( + Optional> expand, + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return expense reports for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportsListRequest && equalTo((ExpenseReportsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportsListRequest other) { + return expand.equals(other.expand) + && companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportsListRequest other) { + expand(other.getExpand()); + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ExpenseReportsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    If provided, will only return expense reports for this company.

    + */ + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

    + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public ExpenseReportsListRequest build() { + return new ExpenseReportsListRequest( + expand, + companyId, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsListRequestExpandItem.java new file mode 100644 index 000000000..e7f43116c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsListRequestExpandItem.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ExpenseReportsListRequestExpandItem { + public static final ExpenseReportsListRequestExpandItem ACCOUNTING_PERIOD = + new ExpenseReportsListRequestExpandItem(Value.ACCOUNTING_PERIOD, "accounting_period"); + + public static final ExpenseReportsListRequestExpandItem EMPLOYEE = + new ExpenseReportsListRequestExpandItem(Value.EMPLOYEE, "employee"); + + public static final ExpenseReportsListRequestExpandItem LINES = + new ExpenseReportsListRequestExpandItem(Value.LINES, "lines"); + + public static final ExpenseReportsListRequestExpandItem COMPANY = + new ExpenseReportsListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + ExpenseReportsListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ExpenseReportsListRequestExpandItem + && this.string.equals(((ExpenseReportsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNTING_PERIOD: + return visitor.visitAccountingPeriod(); + case EMPLOYEE: + return visitor.visitEmployee(); + case LINES: + return visitor.visitLines(); + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ExpenseReportsListRequestExpandItem valueOf(String value) { + switch (value) { + case "accounting_period": + return ACCOUNTING_PERIOD; + case "employee": + return EMPLOYEE; + case "lines": + return LINES; + case "company": + return COMPANY; + default: + return new ExpenseReportsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNTING_PERIOD, + + COMPANY, + + EMPLOYEE, + + LINES, + + UNKNOWN + } + + public interface Visitor { + T visitAccountingPeriod(); + + T visitCompany(); + + T visitEmployee(); + + T visitLines(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..58f3c6652 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsRemoteFieldClassesListRequest.java @@ -0,0 +1,299 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportsRemoteFieldClassesListRequest.Builder.class) +public final class ExpenseReportsRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional isCustom; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ExpenseReportsRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonModelField, + Optional isCustom, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.isCustom = isCustom; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return If provided, will only return remote fields classes with this is_custom value + */ + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportsRemoteFieldClassesListRequest + && equalTo((ExpenseReportsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportsRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && isCustom.equals(other.isCustom) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.isCustom, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportsRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + isCustom(other.getIsCustom()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, will only return remote field classes with this is_common_model_field value

    + */ + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + /** + *

    If provided, will only return remote fields classes with this is_custom value

    + */ + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ExpenseReportsRemoteFieldClassesListRequest build() { + return new ExpenseReportsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + isCustom, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsRetrieveRequest.java new file mode 100644 index 000000000..d5870c51d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsRetrieveRequest.java @@ -0,0 +1,201 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExpenseReportsRetrieveRequest.Builder.class) +public final class ExpenseReportsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ExpenseReportsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseReportsRetrieveRequest && equalTo((ExpenseReportsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExpenseReportsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeRemoteFields, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExpenseReportsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ExpenseReportsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

    + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ExpenseReportsRetrieveRequest build() { + return new ExpenseReportsRetrieveRequest( + expand, includeRemoteData, includeRemoteFields, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseReportsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ExpenseReportsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..3a291238b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseReportsRetrieveRequestExpandItem.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ExpenseReportsRetrieveRequestExpandItem { + public static final ExpenseReportsRetrieveRequestExpandItem ACCOUNTING_PERIOD = + new ExpenseReportsRetrieveRequestExpandItem(Value.ACCOUNTING_PERIOD, "accounting_period"); + + public static final ExpenseReportsRetrieveRequestExpandItem EMPLOYEE = + new ExpenseReportsRetrieveRequestExpandItem(Value.EMPLOYEE, "employee"); + + public static final ExpenseReportsRetrieveRequestExpandItem LINES = + new ExpenseReportsRetrieveRequestExpandItem(Value.LINES, "lines"); + + public static final ExpenseReportsRetrieveRequestExpandItem COMPANY = + new ExpenseReportsRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + ExpenseReportsRetrieveRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ExpenseReportsRetrieveRequestExpandItem + && this.string.equals(((ExpenseReportsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNTING_PERIOD: + return visitor.visitAccountingPeriod(); + case EMPLOYEE: + return visitor.visitEmployee(); + case LINES: + return visitor.visitLines(); + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ExpenseReportsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "accounting_period": + return ACCOUNTING_PERIOD; + case "employee": + return EMPLOYEE; + case "lines": + return LINES; + case "company": + return COMPANY; + default: + return new ExpenseReportsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNTING_PERIOD, + + COMPANY, + + EMPLOYEE, + + LINES, + + UNKNOWN + } + + public interface Visitor { + T visitAccountingPeriod(); + + T visitCompany(); + + T visitEmployee(); + + T visitLines(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseRequest.java b/src/main/java/com/merge/api/accounting/types/ExpenseRequest.java index 166c64509..922791274 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpenseRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequest.java @@ -35,7 +35,7 @@ public final class ExpenseRequest { private final Optional totalTaxAmount; - private final Optional currency; + private final Optional currency; private final Optional exchangeRate; @@ -68,7 +68,7 @@ private ExpenseRequest( Optional totalAmount, Optional subTotal, Optional totalTaxAmount, - Optional currency, + Optional currency, Optional exchangeRate, Optional inclusiveOfTax, Optional company, @@ -462,7 +462,7 @@ public Optional getTotalTaxAmount() { * */ @JsonProperty("currency") - public Optional getCurrency() { + public Optional getCurrency() { return currency; } @@ -617,7 +617,7 @@ public static final class Builder { private Optional totalTaxAmount = Optional.empty(); - private Optional currency = Optional.empty(); + private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); @@ -1064,12 +1064,12 @@ public Builder totalTaxAmount(Double totalTaxAmount) { * */ @JsonSetter(value = "currency", nulls = Nulls.SKIP) - public Builder currency(Optional currency) { + public Builder currency(Optional currency) { this.currency = currency; return this; } - public Builder currency(TransactionCurrencyEnum currency) { + public Builder currency(ExpenseRequestCurrency currency) { this.currency = Optional.ofNullable(currency); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/ExpenseRequestCurrency.java b/src/main/java/com/merge/api/accounting/types/ExpenseRequestCurrency.java new file mode 100644 index 000000000..2d40e3722 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequestCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ExpenseRequestCurrency.Deserializer.class) +public final class ExpenseRequestCurrency { + private final Object value; + + private final int type; + + private ExpenseRequestCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExpenseRequestCurrency && equalTo((ExpenseRequestCurrency) other); + } + + private boolean equalTo(ExpenseRequestCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ExpenseRequestCurrency of(TransactionCurrencyEnum value) { + return new ExpenseRequestCurrency(value, 0); + } + + public static ExpenseRequestCurrency of(String value) { + return new ExpenseRequestCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ExpenseRequestCurrency.class); + } + + @java.lang.Override + public ExpenseRequestCurrency deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ExpensesLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpensesLinesRemoteFieldClassesListRequest.java index 75c1e7290..b1ff0f66d 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpensesLinesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpensesLinesRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/ExpensesListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpensesListRequest.java index 071444b9d..75c2cb90c 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpensesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpensesListRequest.java @@ -179,7 +179,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -484,7 +484,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java index 996d7ebaf..5bafdf6df 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApiResponse.java index 4ba80d12e..5181e23eb 100644 --- a/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApiResponse.java +++ b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApiResponse.java @@ -41,6 +41,12 @@ public final class ExternalTargetFieldApiResponse { private final Optional> purchaseOrder; + private final Optional> salesOrder; + + private final Optional> itemFulfillment; + + private final Optional> expenseReport; + private final Optional> trackingCategory; private final Optional> journalEntry; @@ -84,6 +90,9 @@ private ExternalTargetFieldApiResponse( Optional> creditNote, Optional> item, Optional> purchaseOrder, + Optional> salesOrder, + Optional> itemFulfillment, + Optional> expenseReport, Optional> trackingCategory, Optional> journalEntry, Optional> taxRate, @@ -110,6 +119,9 @@ private ExternalTargetFieldApiResponse( this.creditNote = creditNote; this.item = item; this.purchaseOrder = purchaseOrder; + this.salesOrder = salesOrder; + this.itemFulfillment = itemFulfillment; + this.expenseReport = expenseReport; this.trackingCategory = trackingCategory; this.journalEntry = journalEntry; this.taxRate = taxRate; @@ -178,6 +190,21 @@ public Optional> getPurchaseOrder() { return purchaseOrder; } + @JsonProperty("SalesOrder") + public Optional> getSalesOrder() { + return salesOrder; + } + + @JsonProperty("ItemFulfillment") + public Optional> getItemFulfillment() { + return itemFulfillment; + } + + @JsonProperty("ExpenseReport") + public Optional> getExpenseReport() { + return expenseReport; + } + @JsonProperty("TrackingCategory") public Optional> getTrackingCategory() { return trackingCategory; @@ -275,6 +302,9 @@ private boolean equalTo(ExternalTargetFieldApiResponse other) { && creditNote.equals(other.creditNote) && item.equals(other.item) && purchaseOrder.equals(other.purchaseOrder) + && salesOrder.equals(other.salesOrder) + && itemFulfillment.equals(other.itemFulfillment) + && expenseReport.equals(other.expenseReport) && trackingCategory.equals(other.trackingCategory) && journalEntry.equals(other.journalEntry) && taxRate.equals(other.taxRate) @@ -305,6 +335,9 @@ public int hashCode() { this.creditNote, this.item, this.purchaseOrder, + this.salesOrder, + this.itemFulfillment, + this.expenseReport, this.trackingCategory, this.journalEntry, this.taxRate, @@ -353,6 +386,12 @@ public static final class Builder { private Optional> purchaseOrder = Optional.empty(); + private Optional> salesOrder = Optional.empty(); + + private Optional> itemFulfillment = Optional.empty(); + + private Optional> expenseReport = Optional.empty(); + private Optional> trackingCategory = Optional.empty(); private Optional> journalEntry = Optional.empty(); @@ -399,6 +438,9 @@ public Builder from(ExternalTargetFieldApiResponse other) { creditNote(other.getCreditNote()); item(other.getItem()); purchaseOrder(other.getPurchaseOrder()); + salesOrder(other.getSalesOrder()); + itemFulfillment(other.getItemFulfillment()); + expenseReport(other.getExpenseReport()); trackingCategory(other.getTrackingCategory()); journalEntry(other.getJournalEntry()); taxRate(other.getTaxRate()); @@ -527,6 +569,39 @@ public Builder purchaseOrder(List purchaseOrder) { return this; } + @JsonSetter(value = "SalesOrder", nulls = Nulls.SKIP) + public Builder salesOrder(Optional> salesOrder) { + this.salesOrder = salesOrder; + return this; + } + + public Builder salesOrder(List salesOrder) { + this.salesOrder = Optional.ofNullable(salesOrder); + return this; + } + + @JsonSetter(value = "ItemFulfillment", nulls = Nulls.SKIP) + public Builder itemFulfillment(Optional> itemFulfillment) { + this.itemFulfillment = itemFulfillment; + return this; + } + + public Builder itemFulfillment(List itemFulfillment) { + this.itemFulfillment = Optional.ofNullable(itemFulfillment); + return this; + } + + @JsonSetter(value = "ExpenseReport", nulls = Nulls.SKIP) + public Builder expenseReport(Optional> expenseReport) { + this.expenseReport = expenseReport; + return this; + } + + public Builder expenseReport(List expenseReport) { + this.expenseReport = Optional.ofNullable(expenseReport); + return this; + } + @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) public Builder trackingCategory(Optional> trackingCategory) { this.trackingCategory = trackingCategory; @@ -704,6 +779,9 @@ public ExternalTargetFieldApiResponse build() { creditNote, item, purchaseOrder, + salesOrder, + itemFulfillment, + expenseReport, trackingCategory, journalEntry, taxRate, diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java index e1cc66f6f..300be2e4a 100644 --- a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java @@ -28,6 +28,10 @@ public final class FieldMappingApiInstance { private final Optional remoteField; + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + private final Map additionalProperties; private FieldMappingApiInstance( @@ -35,11 +39,15 @@ private FieldMappingApiInstance( Optional isIntegrationWide, Optional targetField, Optional remoteField, + Optional jmesPath, + Optional advancedMappingExpression, Map additionalProperties) { this.id = id; this.isIntegrationWide = isIntegrationWide; this.targetField = targetField; this.remoteField = remoteField; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; this.additionalProperties = additionalProperties; } @@ -63,6 +71,16 @@ public Optional getRemoteField() { return remoteField; } + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +96,20 @@ private boolean equalTo(FieldMappingApiInstance other) { return id.equals(other.id) && isIntegrationWide.equals(other.isIntegrationWide) && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + return Objects.hash( + this.id, + this.isIntegrationWide, + this.targetField, + this.remoteField, + this.jmesPath, + this.advancedMappingExpression); } @java.lang.Override @@ -105,6 +131,10 @@ public static final class Builder { private Optional remoteField = Optional.empty(); + private Optional jmesPath = Optional.empty(); + + private Optional advancedMappingExpression = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -115,6 +145,8 @@ public Builder from(FieldMappingApiInstance other) { isIntegrationWide(other.getIsIntegrationWide()); targetField(other.getTargetField()); remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); return this; } @@ -162,8 +194,37 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public Builder advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + public Builder advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + return new FieldMappingApiInstance( + id, + isIntegrationWide, + targetField, + remoteField, + jmesPath, + advancedMappingExpression, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceResponse.java index a2117d62b..4b1c3627c 100644 --- a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceResponse.java +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceResponse.java @@ -41,6 +41,12 @@ public final class FieldMappingApiInstanceResponse { private final Optional> purchaseOrder; + private final Optional> salesOrder; + + private final Optional> itemFulfillment; + + private final Optional> expenseReport; + private final Optional> trackingCategory; private final Optional> journalEntry; @@ -84,6 +90,9 @@ private FieldMappingApiInstanceResponse( Optional> creditNote, Optional> item, Optional> purchaseOrder, + Optional> salesOrder, + Optional> itemFulfillment, + Optional> expenseReport, Optional> trackingCategory, Optional> journalEntry, Optional> taxRate, @@ -110,6 +119,9 @@ private FieldMappingApiInstanceResponse( this.creditNote = creditNote; this.item = item; this.purchaseOrder = purchaseOrder; + this.salesOrder = salesOrder; + this.itemFulfillment = itemFulfillment; + this.expenseReport = expenseReport; this.trackingCategory = trackingCategory; this.journalEntry = journalEntry; this.taxRate = taxRate; @@ -178,6 +190,21 @@ public Optional> getPurchaseOrder() { return purchaseOrder; } + @JsonProperty("SalesOrder") + public Optional> getSalesOrder() { + return salesOrder; + } + + @JsonProperty("ItemFulfillment") + public Optional> getItemFulfillment() { + return itemFulfillment; + } + + @JsonProperty("ExpenseReport") + public Optional> getExpenseReport() { + return expenseReport; + } + @JsonProperty("TrackingCategory") public Optional> getTrackingCategory() { return trackingCategory; @@ -275,6 +302,9 @@ private boolean equalTo(FieldMappingApiInstanceResponse other) { && creditNote.equals(other.creditNote) && item.equals(other.item) && purchaseOrder.equals(other.purchaseOrder) + && salesOrder.equals(other.salesOrder) + && itemFulfillment.equals(other.itemFulfillment) + && expenseReport.equals(other.expenseReport) && trackingCategory.equals(other.trackingCategory) && journalEntry.equals(other.journalEntry) && taxRate.equals(other.taxRate) @@ -305,6 +335,9 @@ public int hashCode() { this.creditNote, this.item, this.purchaseOrder, + this.salesOrder, + this.itemFulfillment, + this.expenseReport, this.trackingCategory, this.journalEntry, this.taxRate, @@ -353,6 +386,12 @@ public static final class Builder { private Optional> purchaseOrder = Optional.empty(); + private Optional> salesOrder = Optional.empty(); + + private Optional> itemFulfillment = Optional.empty(); + + private Optional> expenseReport = Optional.empty(); + private Optional> trackingCategory = Optional.empty(); private Optional> journalEntry = Optional.empty(); @@ -399,6 +438,9 @@ public Builder from(FieldMappingApiInstanceResponse other) { creditNote(other.getCreditNote()); item(other.getItem()); purchaseOrder(other.getPurchaseOrder()); + salesOrder(other.getSalesOrder()); + itemFulfillment(other.getItemFulfillment()); + expenseReport(other.getExpenseReport()); trackingCategory(other.getTrackingCategory()); journalEntry(other.getJournalEntry()); taxRate(other.getTaxRate()); @@ -527,6 +569,39 @@ public Builder purchaseOrder(List purchaseOrder) { return this; } + @JsonSetter(value = "SalesOrder", nulls = Nulls.SKIP) + public Builder salesOrder(Optional> salesOrder) { + this.salesOrder = salesOrder; + return this; + } + + public Builder salesOrder(List salesOrder) { + this.salesOrder = Optional.ofNullable(salesOrder); + return this; + } + + @JsonSetter(value = "ItemFulfillment", nulls = Nulls.SKIP) + public Builder itemFulfillment(Optional> itemFulfillment) { + this.itemFulfillment = itemFulfillment; + return this; + } + + public Builder itemFulfillment(List itemFulfillment) { + this.itemFulfillment = Optional.ofNullable(itemFulfillment); + return this; + } + + @JsonSetter(value = "ExpenseReport", nulls = Nulls.SKIP) + public Builder expenseReport(Optional> expenseReport) { + this.expenseReport = expenseReport; + return this; + } + + public Builder expenseReport(List expenseReport) { + this.expenseReport = Optional.ofNullable(expenseReport); + return this; + } + @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) public Builder trackingCategory(Optional> trackingCategory) { this.trackingCategory = trackingCategory; @@ -704,6 +779,9 @@ public FieldMappingApiInstanceResponse build() { creditNote, item, purchaseOrder, + salesOrder, + itemFulfillment, + expenseReport, trackingCategory, journalEntry, taxRate, diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLine.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLine.java index 6c2095e53..bb41744d7 100644 --- a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLine.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLine.java @@ -42,7 +42,7 @@ public final class GeneralLedgerTransactionLine { private final Optional project; - private final Optional baseCurrency; + private final Optional baseCurrency; private final Optional transactionCurrency; @@ -50,7 +50,7 @@ public final class GeneralLedgerTransactionLine { private final Optional description; - private final Optional> trackingCategories; + private final Optional> trackingCategories; private final String debitAmount; @@ -78,11 +78,11 @@ private GeneralLedgerTransactionLine( Optional employee, Optional contact, Optional project, - Optional baseCurrency, + Optional baseCurrency, Optional transactionCurrency, Optional exchangeRate, Optional description, - Optional> trackingCategories, + Optional> trackingCategories, String debitAmount, String creditAmount, Optional item, @@ -484,7 +484,7 @@ public Optional getProject() { * */ @JsonProperty("base_currency") - public Optional getBaseCurrency() { + public Optional getBaseCurrency() { return baseCurrency; } @@ -821,7 +821,7 @@ public Optional getDescription() { } @JsonProperty("tracking_categories") - public Optional> getTrackingCategories() { + public Optional> getTrackingCategories() { return trackingCategories; } @@ -1313,9 +1313,9 @@ public interface _FinalStage { *
  • ZWL - Zimbabwean Dollar (2009)
  • * */ - _FinalStage baseCurrency(Optional baseCurrency); + _FinalStage baseCurrency(Optional baseCurrency); - _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency); + _FinalStage baseCurrency(GeneralLedgerTransactionLineBaseCurrency baseCurrency); /** *

    The transaction currency that the transaction is made in.

    @@ -1646,10 +1646,9 @@ public interface _FinalStage { _FinalStage description(String description); - _FinalStage trackingCategories( - Optional> trackingCategories); + _FinalStage trackingCategories(Optional> trackingCategories); - _FinalStage trackingCategories(List trackingCategories); + _FinalStage trackingCategories(List trackingCategories); _FinalStage item(Optional item); @@ -1688,8 +1687,7 @@ public static final class Builder private Optional item = Optional.empty(); - private Optional> trackingCategories = - Optional.empty(); + private Optional> trackingCategories = Optional.empty(); private Optional description = Optional.empty(); @@ -1697,7 +1695,7 @@ public static final class Builder private Optional transactionCurrency = Optional.empty(); - private Optional baseCurrency = Optional.empty(); + private Optional baseCurrency = Optional.empty(); private Optional project = Optional.empty(); @@ -1823,16 +1821,14 @@ public _FinalStage item(Optional item) { } @java.lang.Override - public _FinalStage trackingCategories( - List trackingCategories) { + public _FinalStage trackingCategories(List trackingCategories) { this.trackingCategories = Optional.ofNullable(trackingCategories); return this; } @java.lang.Override @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) - public _FinalStage trackingCategories( - Optional> trackingCategories) { + public _FinalStage trackingCategories(Optional> trackingCategories) { this.trackingCategories = trackingCategories; return this; } @@ -2827,7 +2823,7 @@ public _FinalStage transactionCurrency( * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency) { + public _FinalStage baseCurrency(GeneralLedgerTransactionLineBaseCurrency baseCurrency) { this.baseCurrency = Optional.ofNullable(baseCurrency); return this; } @@ -3145,7 +3141,7 @@ public _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency) { */ @java.lang.Override @JsonSetter(value = "base_currency", nulls = Nulls.SKIP) - public _FinalStage baseCurrency(Optional baseCurrency) { + public _FinalStage baseCurrency(Optional baseCurrency) { this.baseCurrency = baseCurrency; return this; } diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java new file mode 100644 index 000000000..0606d3804 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineBaseCurrency.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GeneralLedgerTransactionLineBaseCurrency.Deserializer.class) +public final class GeneralLedgerTransactionLineBaseCurrency { + private final Object value; + + private final int type; + + private GeneralLedgerTransactionLineBaseCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GeneralLedgerTransactionLineBaseCurrency + && equalTo((GeneralLedgerTransactionLineBaseCurrency) other); + } + + private boolean equalTo(GeneralLedgerTransactionLineBaseCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GeneralLedgerTransactionLineBaseCurrency of(TransactionCurrencyEnum value) { + return new GeneralLedgerTransactionLineBaseCurrency(value, 0); + } + + public static GeneralLedgerTransactionLineBaseCurrency of(String value) { + return new GeneralLedgerTransactionLineBaseCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GeneralLedgerTransactionLineBaseCurrency.class); + } + + @java.lang.Override + public GeneralLedgerTransactionLineBaseCurrency deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequest.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequest.java index 19c8e1e38..de4028f66 100644 --- a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequest.java @@ -167,7 +167,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -454,7 +454,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java b/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java index b671a49d0..de4ffc272 100644 --- a/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/Invoice.java b/src/main/java/com/merge/api/accounting/types/Invoice.java index 092869cd4..05b5ed5b9 100644 --- a/src/main/java/com/merge/api/accounting/types/Invoice.java +++ b/src/main/java/com/merge/api/accounting/types/Invoice.java @@ -25,13 +25,15 @@ public final class Invoice { private final Optional id; + private final Optional invoiceUrl; + private final Optional remoteId; private final Optional createdAt; private final Optional modifiedAt; - private final Optional type; + private final Optional type; private final Optional contact; @@ -75,11 +77,13 @@ public final class Invoice { private final Optional>> purchaseOrders; + private final Optional>> salesOrders; + private final Optional>> payments; private final Optional>> appliedPayments; - private final Optional> lineItems; + private final Optional> lineItems; private final Optional> appliedCreditNotes; @@ -99,10 +103,11 @@ public final class Invoice { private Invoice( Optional id, + Optional invoiceUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, - Optional type, + Optional type, Optional contact, Optional number, Optional issueDate, @@ -124,9 +129,10 @@ private Invoice( Optional>> trackingCategories, Optional accountingPeriod, Optional>> purchaseOrders, + Optional>> salesOrders, Optional>> payments, Optional>> appliedPayments, - Optional> lineItems, + Optional> lineItems, Optional> appliedCreditNotes, Optional> appliedVendorCredits, Optional inclusiveOfTax, @@ -136,6 +142,7 @@ private Invoice( Optional> remoteFields, Map additionalProperties) { this.id = id; + this.invoiceUrl = invoiceUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -161,6 +168,7 @@ private Invoice( this.trackingCategories = trackingCategories; this.accountingPeriod = accountingPeriod; this.purchaseOrders = purchaseOrders; + this.salesOrders = salesOrders; this.payments = payments; this.appliedPayments = appliedPayments; this.lineItems = lineItems; @@ -179,6 +187,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the invoice. + */ + @JsonProperty("invoice_url") + public Optional getInvoiceUrl() { + return invoiceUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -211,7 +227,7 @@ public Optional getModifiedAt() { * */ @JsonProperty("type") - public Optional getType() { + public Optional getType() { return type; } @@ -693,6 +709,11 @@ public Optional>> getPurchaseOrders() { return purchaseOrders; } + @JsonProperty("sales_orders") + public Optional>> getSalesOrders() { + return salesOrders; + } + /** * @return Array of Payment object IDs. */ @@ -710,7 +731,7 @@ public Optional>> getAppliedPayments() } @JsonProperty("line_items") - public Optional> getLineItems() { + public Optional> getLineItems() { return lineItems; } @@ -774,6 +795,7 @@ public Map getAdditionalProperties() { private boolean equalTo(Invoice other) { return id.equals(other.id) + && invoiceUrl.equals(other.invoiceUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -799,6 +821,7 @@ private boolean equalTo(Invoice other) { && trackingCategories.equals(other.trackingCategories) && accountingPeriod.equals(other.accountingPeriod) && purchaseOrders.equals(other.purchaseOrders) + && salesOrders.equals(other.salesOrders) && payments.equals(other.payments) && appliedPayments.equals(other.appliedPayments) && lineItems.equals(other.lineItems) @@ -815,6 +838,7 @@ private boolean equalTo(Invoice other) { public int hashCode() { return Objects.hash( this.id, + this.invoiceUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -840,6 +864,7 @@ public int hashCode() { this.trackingCategories, this.accountingPeriod, this.purchaseOrders, + this.salesOrders, this.payments, this.appliedPayments, this.lineItems, @@ -865,13 +890,15 @@ public static Builder builder() { public static final class Builder { private Optional id = Optional.empty(); + private Optional invoiceUrl = Optional.empty(); + private Optional remoteId = Optional.empty(); private Optional createdAt = Optional.empty(); private Optional modifiedAt = Optional.empty(); - private Optional type = Optional.empty(); + private Optional type = Optional.empty(); private Optional contact = Optional.empty(); @@ -915,11 +942,13 @@ public static final class Builder { private Optional>> purchaseOrders = Optional.empty(); + private Optional>> salesOrders = Optional.empty(); + private Optional>> payments = Optional.empty(); private Optional>> appliedPayments = Optional.empty(); - private Optional> lineItems = Optional.empty(); + private Optional> lineItems = Optional.empty(); private Optional> appliedCreditNotes = Optional.empty(); @@ -942,6 +971,7 @@ private Builder() {} public Builder from(Invoice other) { id(other.getId()); + invoiceUrl(other.getInvoiceUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -967,6 +997,7 @@ public Builder from(Invoice other) { trackingCategories(other.getTrackingCategories()); accountingPeriod(other.getAccountingPeriod()); purchaseOrders(other.getPurchaseOrders()); + salesOrders(other.getSalesOrders()); payments(other.getPayments()); appliedPayments(other.getAppliedPayments()); lineItems(other.getLineItems()); @@ -991,6 +1022,20 @@ public Builder id(String id) { return this; } + /** + *

    The 3rd party URL of the invoice.

    + */ + @JsonSetter(value = "invoice_url", nulls = Nulls.SKIP) + public Builder invoiceUrl(Optional invoiceUrl) { + this.invoiceUrl = invoiceUrl; + return this; + } + + public Builder invoiceUrl(String invoiceUrl) { + this.invoiceUrl = Optional.ofNullable(invoiceUrl); + return this; + } + /** *

    The third-party API ID of the matching object.

    */ @@ -1041,12 +1086,12 @@ public Builder modifiedAt(OffsetDateTime modifiedAt) { * */ @JsonSetter(value = "type", nulls = Nulls.SKIP) - public Builder type(Optional type) { + public Builder type(Optional type) { this.type = type; return this; } - public Builder type(InvoiceTypeEnum type) { + public Builder type(InvoiceType type) { this.type = Optional.ofNullable(type); return this; } @@ -1655,6 +1700,17 @@ public Builder purchaseOrders(List> purchase return this; } + @JsonSetter(value = "sales_orders", nulls = Nulls.SKIP) + public Builder salesOrders(Optional>> salesOrders) { + this.salesOrders = salesOrders; + return this; + } + + public Builder salesOrders(List> salesOrders) { + this.salesOrders = Optional.ofNullable(salesOrders); + return this; + } + /** *

    Array of Payment object IDs.

    */ @@ -1684,12 +1740,12 @@ public Builder appliedPayments(List> applie } @JsonSetter(value = "line_items", nulls = Nulls.SKIP) - public Builder lineItems(Optional> lineItems) { + public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; return this; } - public Builder lineItems(List lineItems) { + public Builder lineItems(List lineItems) { this.lineItems = Optional.ofNullable(lineItems); return this; } @@ -1786,6 +1842,7 @@ public Builder remoteFields(List remoteFields) { public Invoice build() { return new Invoice( id, + invoiceUrl, remoteId, createdAt, modifiedAt, @@ -1811,6 +1868,7 @@ public Invoice build() { trackingCategories, accountingPeriod, purchaseOrders, + salesOrders, payments, appliedPayments, lineItems, diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceBatchItemRequest.java b/src/main/java/com/merge/api/accounting/types/InvoiceBatchItemRequest.java new file mode 100644 index 000000000..5e5a75f84 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceBatchItemRequest.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoiceBatchItemRequest.Builder.class) +public final class InvoiceBatchItemRequest { + private final String itemId; + + private final InvoiceRequest payload; + + private final Map additionalProperties; + + private InvoiceBatchItemRequest(String itemId, InvoiceRequest payload, Map additionalProperties) { + this.itemId = itemId; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party item ID for this model in the bulk create request + */ + @JsonProperty("item_id") + public String getItemId() { + return itemId; + } + + @JsonProperty("payload") + public InvoiceRequest getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceBatchItemRequest && equalTo((InvoiceBatchItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoiceBatchItemRequest other) { + return itemId.equals(other.itemId) && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemId, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ItemIdStage builder() { + return new Builder(); + } + + public interface ItemIdStage { + /** + *

    The third-party item ID for this model in the bulk create request

    + */ + PayloadStage itemId(@NotNull String itemId); + + Builder from(InvoiceBatchItemRequest other); + } + + public interface PayloadStage { + _FinalStage payload(@NotNull InvoiceRequest payload); + } + + public interface _FinalStage { + InvoiceBatchItemRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ItemIdStage, PayloadStage, _FinalStage { + private String itemId; + + private InvoiceRequest payload; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(InvoiceBatchItemRequest other) { + itemId(other.getItemId()); + payload(other.getPayload()); + return this; + } + + /** + *

    The third-party item ID for this model in the bulk create request

    + *

    The third-party item ID for this model in the bulk create request

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("item_id") + public PayloadStage itemId(@NotNull String itemId) { + this.itemId = itemId; + return this; + } + + @java.lang.Override + @JsonSetter("payload") + public _FinalStage payload(@NotNull InvoiceRequest payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public InvoiceBatchItemRequest build() { + return new InvoiceBatchItemRequest(itemId, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceBulkRequest.java b/src/main/java/com/merge/api/accounting/types/InvoiceBulkRequest.java new file mode 100644 index 000000000..e60f684f1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceBulkRequest.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoiceBulkRequest.Builder.class) +public final class InvoiceBulkRequest { + private final List batchItems; + + private final Map additionalProperties; + + private InvoiceBulkRequest(List batchItems, Map additionalProperties) { + this.batchItems = batchItems; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("batch_items") + public List getBatchItems() { + return batchItems; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceBulkRequest && equalTo((InvoiceBulkRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(InvoiceBulkRequest other) { + return batchItems.equals(other.batchItems); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.batchItems); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List batchItems = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InvoiceBulkRequest other) { + batchItems(other.getBatchItems()); + return this; + } + + @JsonSetter(value = "batch_items", nulls = Nulls.SKIP) + public Builder batchItems(List batchItems) { + this.batchItems.clear(); + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public Builder addBatchItems(InvoiceBatchItemRequest batchItems) { + this.batchItems.add(batchItems); + return this; + } + + public Builder addAllBatchItems(List batchItems) { + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public InvoiceBulkRequest build() { + return new InvoiceBulkRequest(batchItems, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java index 84487173f..a12950ed9 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java @@ -39,7 +39,7 @@ public final class InvoiceLineItem { private final Optional totalAmount; - private final Optional employee; + private final Optional employee; private final Optional project; @@ -63,6 +63,8 @@ public final class InvoiceLineItem { private final Optional remoteWasDeleted; + private final Optional isBillable; + private final Optional> fieldMappings; private final Optional> remoteFields; @@ -78,7 +80,7 @@ private InvoiceLineItem( Optional unitPrice, Optional quantity, Optional totalAmount, - Optional employee, + Optional employee, Optional project, Optional contact, Optional currency, @@ -90,6 +92,7 @@ private InvoiceLineItem( Optional>> trackingCategories, Optional company, Optional remoteWasDeleted, + Optional isBillable, Optional> fieldMappings, Optional> remoteFields, Map additionalProperties) { @@ -113,6 +116,7 @@ private InvoiceLineItem( this.trackingCategories = trackingCategories; this.company = company; this.remoteWasDeleted = remoteWasDeleted; + this.isBillable = isBillable; this.fieldMappings = fieldMappings; this.remoteFields = remoteFields; this.additionalProperties = additionalProperties; @@ -183,7 +187,7 @@ public Optional getTotalAmount() { * @return The employee this overall transaction relates to. */ @JsonProperty("employee") - public Optional getEmployee() { + public Optional getEmployee() { return employee; } @@ -571,6 +575,14 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + /** + * @return Indicates if the line item can be charged to the client/customer. + */ + @JsonProperty("is_billable") + public Optional getIsBillable() { + return isBillable; + } + @JsonProperty("field_mappings") public Optional> getFieldMappings() { return fieldMappings; @@ -613,6 +625,7 @@ private boolean equalTo(InvoiceLineItem other) { && trackingCategories.equals(other.trackingCategories) && company.equals(other.company) && remoteWasDeleted.equals(other.remoteWasDeleted) + && isBillable.equals(other.isBillable) && fieldMappings.equals(other.fieldMappings) && remoteFields.equals(other.remoteFields); } @@ -640,6 +653,7 @@ public int hashCode() { this.trackingCategories, this.company, this.remoteWasDeleted, + this.isBillable, this.fieldMappings, this.remoteFields); } @@ -671,7 +685,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional employee = Optional.empty(); + private Optional employee = Optional.empty(); private Optional project = Optional.empty(); @@ -695,6 +709,8 @@ public static final class Builder { private Optional remoteWasDeleted = Optional.empty(); + private Optional isBillable = Optional.empty(); + private Optional> fieldMappings = Optional.empty(); private Optional> remoteFields = Optional.empty(); @@ -725,6 +741,7 @@ public Builder from(InvoiceLineItem other) { trackingCategories(other.getTrackingCategories()); company(other.getCompany()); remoteWasDeleted(other.getRemoteWasDeleted()); + isBillable(other.getIsBillable()); fieldMappings(other.getFieldMappings()); remoteFields(other.getRemoteFields()); return this; @@ -843,12 +860,12 @@ public Builder totalAmount(Double totalAmount) { *

    The employee this overall transaction relates to.

    */ @JsonSetter(value = "employee", nulls = Nulls.SKIP) - public Builder employee(Optional employee) { + public Builder employee(Optional employee) { this.employee = employee; return this; } - public Builder employee(InvoiceLineItemEmployee employee) { + public Builder employee(String employee) { this.employee = Optional.ofNullable(employee); return this; } @@ -1304,6 +1321,20 @@ public Builder remoteWasDeleted(Boolean remoteWasDeleted) { return this; } + /** + *

    Indicates if the line item can be charged to the client/customer.

    + */ + @JsonSetter(value = "is_billable", nulls = Nulls.SKIP) + public Builder isBillable(Optional isBillable) { + this.isBillable = isBillable; + return this; + } + + public Builder isBillable(Boolean isBillable) { + this.isBillable = Optional.ofNullable(isBillable); + return this; + } + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; @@ -1348,6 +1379,7 @@ public InvoiceLineItem build() { trackingCategories, company, remoteWasDeleted, + isBillable, fieldMappings, remoteFields, additionalProperties); diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java index 7bcd76f72..146f2bd45 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java @@ -32,7 +32,7 @@ public final class InvoiceLineItemRequest { private final Optional totalAmount; - private final Optional employee; + private final Optional employee; private final Optional project; @@ -54,6 +54,8 @@ public final class InvoiceLineItemRequest { private final Optional company; + private final Optional isBillable; + private final Optional> integrationParams; private final Optional> linkedAccountParams; @@ -68,7 +70,7 @@ private InvoiceLineItemRequest( Optional unitPrice, Optional quantity, Optional totalAmount, - Optional employee, + Optional employee, Optional project, Optional contact, Optional currency, @@ -79,6 +81,7 @@ private InvoiceLineItemRequest( Optional trackingCategory, Optional>> trackingCategories, Optional company, + Optional isBillable, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -99,6 +102,7 @@ private InvoiceLineItemRequest( this.trackingCategory = trackingCategory; this.trackingCategories = trackingCategories; this.company = company; + this.isBillable = isBillable; this.integrationParams = integrationParams; this.linkedAccountParams = linkedAccountParams; this.remoteFields = remoteFields; @@ -149,7 +153,7 @@ public Optional getTotalAmount() { * @return The employee this overall transaction relates to. */ @JsonProperty("employee") - public Optional getEmployee() { + public Optional getEmployee() { return employee; } @@ -529,6 +533,14 @@ public Optional getCompany() { return company; } + /** + * @return Indicates if the line item can be charged to the client/customer. + */ + @JsonProperty("is_billable") + public Optional getIsBillable() { + return isBillable; + } + @JsonProperty("integration_params") public Optional> getIntegrationParams() { return integrationParams; @@ -572,6 +584,7 @@ private boolean equalTo(InvoiceLineItemRequest other) { && trackingCategory.equals(other.trackingCategory) && trackingCategories.equals(other.trackingCategories) && company.equals(other.company) + && isBillable.equals(other.isBillable) && integrationParams.equals(other.integrationParams) && linkedAccountParams.equals(other.linkedAccountParams) && remoteFields.equals(other.remoteFields); @@ -596,6 +609,7 @@ public int hashCode() { this.trackingCategory, this.trackingCategories, this.company, + this.isBillable, this.integrationParams, this.linkedAccountParams, this.remoteFields); @@ -622,7 +636,7 @@ public static final class Builder { private Optional totalAmount = Optional.empty(); - private Optional employee = Optional.empty(); + private Optional employee = Optional.empty(); private Optional project = Optional.empty(); @@ -645,6 +659,8 @@ public static final class Builder { private Optional company = Optional.empty(); + private Optional isBillable = Optional.empty(); + private Optional> integrationParams = Optional.empty(); private Optional> linkedAccountParams = Optional.empty(); @@ -673,6 +689,7 @@ public Builder from(InvoiceLineItemRequest other) { trackingCategory(other.getTrackingCategory()); trackingCategories(other.getTrackingCategories()); company(other.getCompany()); + isBillable(other.getIsBillable()); integrationParams(other.getIntegrationParams()); linkedAccountParams(other.getLinkedAccountParams()); remoteFields(other.getRemoteFields()); @@ -753,12 +770,12 @@ public Builder totalAmount(Double totalAmount) { *

    The employee this overall transaction relates to.

    */ @JsonSetter(value = "employee", nulls = Nulls.SKIP) - public Builder employee(Optional employee) { + public Builder employee(Optional employee) { this.employee = employee; return this; } - public Builder employee(InvoiceLineItemRequestEmployee employee) { + public Builder employee(String employee) { this.employee = Optional.ofNullable(employee); return this; } @@ -1201,6 +1218,20 @@ public Builder company(String company) { return this; } + /** + *

    Indicates if the line item can be charged to the client/customer.

    + */ + @JsonSetter(value = "is_billable", nulls = Nulls.SKIP) + public Builder isBillable(Optional isBillable) { + this.isBillable = isBillable; + return this; + } + + public Builder isBillable(Boolean isBillable) { + this.isBillable = Optional.ofNullable(isBillable); + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1252,6 +1283,7 @@ public InvoiceLineItemRequest build() { trackingCategory, trackingCategories, company, + isBillable, integrationParams, linkedAccountParams, remoteFields, diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemsItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemsItem.java new file mode 100644 index 000000000..d14067556 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceLineItemsItem.Deserializer.class) +public final class InvoiceLineItemsItem { + private final Object value; + + private final int type; + + private InvoiceLineItemsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((InvoiceLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceLineItemsItem && equalTo((InvoiceLineItemsItem) other); + } + + private boolean equalTo(InvoiceLineItemsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceLineItemsItem of(String value) { + return new InvoiceLineItemsItem(value, 0); + } + + public static InvoiceLineItemsItem of(InvoiceLineItem value) { + return new InvoiceLineItemsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(InvoiceLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceLineItemsItem.class); + } + + @java.lang.Override + public InvoiceLineItemsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, InvoiceLineItem.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceRequest.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequest.java index 4a0ca35e5..60c9283b4 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequest.java @@ -65,7 +65,9 @@ public final class InvoiceRequest { private final Optional>> trackingCategories; - private final Optional> lineItems; + private final Optional accountingPeriod; + + private final Optional> lineItems; private final Optional>> purchaseOrders; @@ -99,7 +101,8 @@ private InvoiceRequest( Optional balance, Optional>> payments, Optional>> trackingCategories, - Optional> lineItems, + Optional accountingPeriod, + Optional> lineItems, Optional>> purchaseOrders, Optional> integrationParams, Optional> linkedAccountParams, @@ -126,6 +129,7 @@ private InvoiceRequest( this.balance = balance; this.payments = payments; this.trackingCategories = trackingCategories; + this.accountingPeriod = accountingPeriod; this.lineItems = lineItems; this.purchaseOrders = purchaseOrders; this.integrationParams = integrationParams; @@ -619,8 +623,16 @@ public Optional>> getTrackin return trackingCategories; } + /** + * @return The accounting period that the Invoice was generated in. + */ + @JsonProperty("accounting_period") + public Optional getAccountingPeriod() { + return accountingPeriod; + } + @JsonProperty("line_items") - public Optional> getLineItems() { + public Optional> getLineItems() { return lineItems; } @@ -677,6 +689,7 @@ private boolean equalTo(InvoiceRequest other) { && balance.equals(other.balance) && payments.equals(other.payments) && trackingCategories.equals(other.trackingCategories) + && accountingPeriod.equals(other.accountingPeriod) && lineItems.equals(other.lineItems) && purchaseOrders.equals(other.purchaseOrders) && integrationParams.equals(other.integrationParams) @@ -708,6 +721,7 @@ public int hashCode() { this.balance, this.payments, this.trackingCategories, + this.accountingPeriod, this.lineItems, this.purchaseOrders, this.integrationParams, @@ -768,7 +782,9 @@ public static final class Builder { private Optional>> trackingCategories = Optional.empty(); - private Optional> lineItems = Optional.empty(); + private Optional accountingPeriod = Optional.empty(); + + private Optional> lineItems = Optional.empty(); private Optional>> purchaseOrders = Optional.empty(); @@ -805,6 +821,7 @@ public Builder from(InvoiceRequest other) { balance(other.getBalance()); payments(other.getPayments()); trackingCategories(other.getTrackingCategories()); + accountingPeriod(other.getAccountingPeriod()); lineItems(other.getLineItems()); purchaseOrders(other.getPurchaseOrders()); integrationParams(other.getIntegrationParams()); @@ -1425,13 +1442,27 @@ public Builder trackingCategories(ListThe accounting period that the Invoice was generated in.

    + */ + @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) + public Builder accountingPeriod(Optional accountingPeriod) { + this.accountingPeriod = accountingPeriod; + return this; + } + + public Builder accountingPeriod(InvoiceRequestAccountingPeriod accountingPeriod) { + this.accountingPeriod = Optional.ofNullable(accountingPeriod); + return this; + } + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) - public Builder lineItems(Optional> lineItems) { + public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; return this; } - public Builder lineItems(List lineItems) { + public Builder lineItems(List lineItems) { this.lineItems = Optional.ofNullable(lineItems); return this; } @@ -1503,6 +1534,7 @@ public InvoiceRequest build() { balance, payments, trackingCategories, + accountingPeriod, lineItems, purchaseOrders, integrationParams, diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceRequestAccountingPeriod.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequestAccountingPeriod.java new file mode 100644 index 000000000..76573feb8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequestAccountingPeriod.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestAccountingPeriod.Deserializer.class) +public final class InvoiceRequestAccountingPeriod { + private final Object value; + + private final int type; + + private InvoiceRequestAccountingPeriod(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((AccountingPeriod) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestAccountingPeriod && equalTo((InvoiceRequestAccountingPeriod) other); + } + + private boolean equalTo(InvoiceRequestAccountingPeriod other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestAccountingPeriod of(String value) { + return new InvoiceRequestAccountingPeriod(value, 0); + } + + public static InvoiceRequestAccountingPeriod of(AccountingPeriod value) { + return new InvoiceRequestAccountingPeriod(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(AccountingPeriod value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestAccountingPeriod.class); + } + + @java.lang.Override + public InvoiceRequestAccountingPeriod deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountingPeriod.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceRequestLineItemsItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceRequestLineItemsItem.java new file mode 100644 index 000000000..0e8ce587b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequestLineItemsItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceRequestLineItemsItem.Deserializer.class) +public final class InvoiceRequestLineItemsItem { + private final Object value; + + private final int type; + + private InvoiceRequestLineItemsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((InvoiceLineItemRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceRequestLineItemsItem && equalTo((InvoiceRequestLineItemsItem) other); + } + + private boolean equalTo(InvoiceRequestLineItemsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceRequestLineItemsItem of(String value) { + return new InvoiceRequestLineItemsItem(value, 0); + } + + public static InvoiceRequestLineItemsItem of(InvoiceLineItemRequest value) { + return new InvoiceRequestLineItemsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(InvoiceLineItemRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceRequestLineItemsItem.class); + } + + @java.lang.Override + public InvoiceRequestLineItemsItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, InvoiceLineItemRequest.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceSalesOrdersItem.java b/src/main/java/com/merge/api/accounting/types/InvoiceSalesOrdersItem.java new file mode 100644 index 000000000..b2cf30848 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceSalesOrdersItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceSalesOrdersItem.Deserializer.class) +public final class InvoiceSalesOrdersItem { + private final Object value; + + private final int type; + + private InvoiceSalesOrdersItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((SalesOrder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceSalesOrdersItem && equalTo((InvoiceSalesOrdersItem) other); + } + + private boolean equalTo(InvoiceSalesOrdersItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceSalesOrdersItem of(String value) { + return new InvoiceSalesOrdersItem(value, 0); + } + + public static InvoiceSalesOrdersItem of(SalesOrder value) { + return new InvoiceSalesOrdersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(SalesOrder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceSalesOrdersItem.class); + } + + @java.lang.Override + public InvoiceSalesOrdersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrder.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoiceType.java b/src/main/java/com/merge/api/accounting/types/InvoiceType.java new file mode 100644 index 000000000..6e9c2e087 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoiceType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = InvoiceType.Deserializer.class) +public final class InvoiceType { + private final Object value; + + private final int type; + + private InvoiceType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((InvoiceTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoiceType && equalTo((InvoiceType) other); + } + + private boolean equalTo(InvoiceType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static InvoiceType of(InvoiceTypeEnum value) { + return new InvoiceType(value, 0); + } + + public static InvoiceType of(String value) { + return new InvoiceType(value, 1); + } + + public interface Visitor { + T visit(InvoiceTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(InvoiceType.class); + } + + @java.lang.Override + public InvoiceType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, InvoiceTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesLineItemsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/InvoicesLineItemsRemoteFieldClassesListRequest.java index e2a7b7513..95d2d1854 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesLineItemsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesLineItemsRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesListRequest.java b/src/main/java/com/merge/api/accounting/types/InvoicesListRequest.java index c11247b58..387ae2916 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequest.java @@ -235,7 +235,7 @@ public Optional getNumber() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -654,7 +654,7 @@ public Builder number(String number) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestExpandItem.java index 88d34100d..3e37a0842 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesListRequestExpandItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestExpandItem.java @@ -16,12 +16,18 @@ public final class InvoicesListRequestExpandItem { public static final InvoicesListRequestExpandItem LINE_ITEMS = new InvoicesListRequestExpandItem(Value.LINE_ITEMS, "line_items"); - public static final InvoicesListRequestExpandItem PAYMENTS = - new InvoicesListRequestExpandItem(Value.PAYMENTS, "payments"); - public static final InvoicesListRequestExpandItem TRACKING_CATEGORIES = new InvoicesListRequestExpandItem(Value.TRACKING_CATEGORIES, "tracking_categories"); + public static final InvoicesListRequestExpandItem SALES_ORDERS = + new InvoicesListRequestExpandItem(Value.SALES_ORDERS, "sales_orders"); + + public static final InvoicesListRequestExpandItem COMPANY = + new InvoicesListRequestExpandItem(Value.COMPANY, "company"); + + public static final InvoicesListRequestExpandItem PAYMENTS = + new InvoicesListRequestExpandItem(Value.PAYMENTS, "payments"); + public static final InvoicesListRequestExpandItem PURCHASE_ORDERS = new InvoicesListRequestExpandItem(Value.PURCHASE_ORDERS, "purchase_orders"); @@ -40,9 +46,6 @@ public final class InvoicesListRequestExpandItem { public static final InvoicesListRequestExpandItem APPLIED_CREDIT_NOTES = new InvoicesListRequestExpandItem(Value.APPLIED_CREDIT_NOTES, "applied_credit_notes"); - public static final InvoicesListRequestExpandItem COMPANY = - new InvoicesListRequestExpandItem(Value.COMPANY, "company"); - private final Value value; private final String string; @@ -82,10 +85,14 @@ public T visit(Visitor visitor) { return visitor.visitAccountingPeriod(); case LINE_ITEMS: return visitor.visitLineItems(); - case PAYMENTS: - return visitor.visitPayments(); case TRACKING_CATEGORIES: return visitor.visitTrackingCategories(); + case SALES_ORDERS: + return visitor.visitSalesOrders(); + case COMPANY: + return visitor.visitCompany(); + case PAYMENTS: + return visitor.visitPayments(); case PURCHASE_ORDERS: return visitor.visitPurchaseOrders(); case EMPLOYEE: @@ -98,8 +105,6 @@ public T visit(Visitor visitor) { return visitor.visitAppliedPayments(); case APPLIED_CREDIT_NOTES: return visitor.visitAppliedCreditNotes(); - case COMPANY: - return visitor.visitCompany(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -115,10 +120,14 @@ public static InvoicesListRequestExpandItem valueOf(String value) { return ACCOUNTING_PERIOD; case "line_items": return LINE_ITEMS; - case "payments": - return PAYMENTS; case "tracking_categories": return TRACKING_CATEGORIES; + case "sales_orders": + return SALES_ORDERS; + case "company": + return COMPANY; + case "payments": + return PAYMENTS; case "purchase_orders": return PURCHASE_ORDERS; case "employee": @@ -131,8 +140,6 @@ public static InvoicesListRequestExpandItem valueOf(String value) { return APPLIED_PAYMENTS; case "applied_credit_notes": return APPLIED_CREDIT_NOTES; - case "company": - return COMPANY; default: return new InvoicesListRequestExpandItem(Value.UNKNOWN, value); } @@ -161,6 +168,8 @@ public enum Value { PURCHASE_ORDERS, + SALES_ORDERS, + TRACKING_CATEGORIES, UNKNOWN @@ -189,6 +198,8 @@ public interface Visitor { T visitPurchaseOrders(); + T visitSalesOrders(); + T visitTrackingCategories(); T visitUnknown(String unknownType); diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java index 51a6fd8de..67e48ebde 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestExpandItem.java index cec11aa65..d6714c173 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestExpandItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestExpandItem.java @@ -16,12 +16,18 @@ public final class InvoicesRetrieveRequestExpandItem { public static final InvoicesRetrieveRequestExpandItem LINE_ITEMS = new InvoicesRetrieveRequestExpandItem(Value.LINE_ITEMS, "line_items"); - public static final InvoicesRetrieveRequestExpandItem PAYMENTS = - new InvoicesRetrieveRequestExpandItem(Value.PAYMENTS, "payments"); - public static final InvoicesRetrieveRequestExpandItem TRACKING_CATEGORIES = new InvoicesRetrieveRequestExpandItem(Value.TRACKING_CATEGORIES, "tracking_categories"); + public static final InvoicesRetrieveRequestExpandItem SALES_ORDERS = + new InvoicesRetrieveRequestExpandItem(Value.SALES_ORDERS, "sales_orders"); + + public static final InvoicesRetrieveRequestExpandItem COMPANY = + new InvoicesRetrieveRequestExpandItem(Value.COMPANY, "company"); + + public static final InvoicesRetrieveRequestExpandItem PAYMENTS = + new InvoicesRetrieveRequestExpandItem(Value.PAYMENTS, "payments"); + public static final InvoicesRetrieveRequestExpandItem PURCHASE_ORDERS = new InvoicesRetrieveRequestExpandItem(Value.PURCHASE_ORDERS, "purchase_orders"); @@ -40,9 +46,6 @@ public final class InvoicesRetrieveRequestExpandItem { public static final InvoicesRetrieveRequestExpandItem APPLIED_CREDIT_NOTES = new InvoicesRetrieveRequestExpandItem(Value.APPLIED_CREDIT_NOTES, "applied_credit_notes"); - public static final InvoicesRetrieveRequestExpandItem COMPANY = - new InvoicesRetrieveRequestExpandItem(Value.COMPANY, "company"); - private final Value value; private final String string; @@ -82,10 +85,14 @@ public T visit(Visitor visitor) { return visitor.visitAccountingPeriod(); case LINE_ITEMS: return visitor.visitLineItems(); - case PAYMENTS: - return visitor.visitPayments(); case TRACKING_CATEGORIES: return visitor.visitTrackingCategories(); + case SALES_ORDERS: + return visitor.visitSalesOrders(); + case COMPANY: + return visitor.visitCompany(); + case PAYMENTS: + return visitor.visitPayments(); case PURCHASE_ORDERS: return visitor.visitPurchaseOrders(); case EMPLOYEE: @@ -98,8 +105,6 @@ public T visit(Visitor visitor) { return visitor.visitAppliedPayments(); case APPLIED_CREDIT_NOTES: return visitor.visitAppliedCreditNotes(); - case COMPANY: - return visitor.visitCompany(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -115,10 +120,14 @@ public static InvoicesRetrieveRequestExpandItem valueOf(String value) { return ACCOUNTING_PERIOD; case "line_items": return LINE_ITEMS; - case "payments": - return PAYMENTS; case "tracking_categories": return TRACKING_CATEGORIES; + case "sales_orders": + return SALES_ORDERS; + case "company": + return COMPANY; + case "payments": + return PAYMENTS; case "purchase_orders": return PURCHASE_ORDERS; case "employee": @@ -131,8 +140,6 @@ public static InvoicesRetrieveRequestExpandItem valueOf(String value) { return APPLIED_PAYMENTS; case "applied_credit_notes": return APPLIED_CREDIT_NOTES; - case "company": - return COMPANY; default: return new InvoicesRetrieveRequestExpandItem(Value.UNKNOWN, value); } @@ -161,6 +168,8 @@ public enum Value { PURCHASE_ORDERS, + SALES_ORDERS, + TRACKING_CATEGORIES, UNKNOWN @@ -189,6 +198,8 @@ public interface Visitor { T visitPurchaseOrders(); + T visitSalesOrders(); + T visitTrackingCategories(); T visitUnknown(String unknownType); diff --git a/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java b/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java index eb1b9428f..a4fcd6170 100644 --- a/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java @@ -164,7 +164,7 @@ public Optional getLinkedAccountId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -446,7 +446,7 @@ public Builder linkedAccountId(String linkedAccountId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/Item.java b/src/main/java/com/merge/api/accounting/types/Item.java index 6e8bf096f..4e71569a1 100644 --- a/src/main/java/com/merge/api/accounting/types/Item.java +++ b/src/main/java/com/merge/api/accounting/types/Item.java @@ -25,6 +25,8 @@ public final class Item { private final Optional id; + private final Optional itemUrl; + private final Optional remoteId; private final Optional createdAt; @@ -63,6 +65,7 @@ public final class Item { private Item( Optional id, + Optional itemUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, @@ -82,6 +85,7 @@ private Item( Optional> remoteData, Map additionalProperties) { this.id = id; + this.itemUrl = itemUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -107,6 +111,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the item. + */ + @JsonProperty("item_url") + public Optional getItemUrl() { + return itemUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -260,6 +272,7 @@ public Map getAdditionalProperties() { private boolean equalTo(Item other) { return id.equals(other.id) + && itemUrl.equals(other.itemUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -283,6 +296,7 @@ private boolean equalTo(Item other) { public int hashCode() { return Objects.hash( this.id, + this.itemUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -315,6 +329,8 @@ public static Builder builder() { public static final class Builder { private Optional id = Optional.empty(); + private Optional itemUrl = Optional.empty(); + private Optional remoteId = Optional.empty(); private Optional createdAt = Optional.empty(); @@ -356,6 +372,7 @@ private Builder() {} public Builder from(Item other) { id(other.getId()); + itemUrl(other.getItemUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -387,6 +404,20 @@ public Builder id(String id) { return this; } + /** + *

    The 3rd party URL of the item.

    + */ + @JsonSetter(value = "item_url", nulls = Nulls.SKIP) + public Builder itemUrl(Optional itemUrl) { + this.itemUrl = itemUrl; + return this; + } + + public Builder itemUrl(String itemUrl) { + this.itemUrl = Optional.ofNullable(itemUrl); + return this; + } + /** *

    The third-party API ID of the matching object.

    */ @@ -632,6 +663,7 @@ public Builder remoteData(List remoteData) { public Item build() { return new Item( id, + itemUrl, remoteId, createdAt, modifiedAt, diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillment.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillment.java new file mode 100644 index 000000000..de6976240 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillment.java @@ -0,0 +1,635 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillment.Builder.class) +public final class ItemFulfillment { + private final Optional id; + + private final Optional itemFulfillmentUrl; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional salesOrder; + + private final Optional fulfillmentDate; + + private final Optional customer; + + private final Optional company; + + private final Optional status; + + private final Optional memo; + + private final Optional> lines; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ItemFulfillment( + Optional id, + Optional itemFulfillmentUrl, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional salesOrder, + Optional fulfillmentDate, + Optional customer, + Optional company, + Optional status, + Optional memo, + Optional> lines, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.itemFulfillmentUrl = itemFulfillmentUrl; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.salesOrder = salesOrder; + this.fulfillmentDate = fulfillmentDate; + this.customer = customer; + this.company = company; + this.status = status; + this.memo = memo; + this.lines = lines; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The 3rd party URL of the item fulfillment. + */ + @JsonProperty("item_fulfillment_url") + public Optional getItemFulfillmentUrl() { + return itemFulfillmentUrl; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The ID of the sales order that the item fulfillment originated from. + */ + @JsonProperty("sales_order") + public Optional getSalesOrder() { + return salesOrder; + } + + /** + * @return The date the fulfillment was created. + */ + @JsonProperty("fulfillment_date") + public Optional getFulfillmentDate() { + return fulfillmentDate; + } + + /** + * @return The customer associated with the item fulfillment. + */ + @JsonProperty("customer") + public Optional getCustomer() { + return customer; + } + + /** + * @return The subsidiary associated with the fulfillment. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The status of the item fulfillment. + *
      + *
    • DRAFT - DRAFT
    • + *
    • IN_PROGRESS - IN_PROGRESS
    • + *
    • SHIPPED - SHIPPED
    • + *
    • CANCELLED - CANCELLED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Comment attached to the fulfillment. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + /** + * @return When the third party's item fulfillment was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's item fulfillment was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillment && equalTo((ItemFulfillment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillment other) { + return id.equals(other.id) + && itemFulfillmentUrl.equals(other.itemFulfillmentUrl) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && salesOrder.equals(other.salesOrder) + && fulfillmentDate.equals(other.fulfillmentDate) + && customer.equals(other.customer) + && company.equals(other.company) + && status.equals(other.status) + && memo.equals(other.memo) + && lines.equals(other.lines) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.itemFulfillmentUrl, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.salesOrder, + this.fulfillmentDate, + this.customer, + this.company, + this.status, + this.memo, + this.lines, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional itemFulfillmentUrl = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional salesOrder = Optional.empty(); + + private Optional fulfillmentDate = Optional.empty(); + + private Optional customer = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillment other) { + id(other.getId()); + itemFulfillmentUrl(other.getItemFulfillmentUrl()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + salesOrder(other.getSalesOrder()); + fulfillmentDate(other.getFulfillmentDate()); + customer(other.getCustomer()); + company(other.getCompany()); + status(other.getStatus()); + memo(other.getMemo()); + lines(other.getLines()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The 3rd party URL of the item fulfillment.

    + */ + @JsonSetter(value = "item_fulfillment_url", nulls = Nulls.SKIP) + public Builder itemFulfillmentUrl(Optional itemFulfillmentUrl) { + this.itemFulfillmentUrl = itemFulfillmentUrl; + return this; + } + + public Builder itemFulfillmentUrl(String itemFulfillmentUrl) { + this.itemFulfillmentUrl = Optional.ofNullable(itemFulfillmentUrl); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    The ID of the sales order that the item fulfillment originated from.

    + */ + @JsonSetter(value = "sales_order", nulls = Nulls.SKIP) + public Builder salesOrder(Optional salesOrder) { + this.salesOrder = salesOrder; + return this; + } + + public Builder salesOrder(ItemFulfillmentSalesOrder salesOrder) { + this.salesOrder = Optional.ofNullable(salesOrder); + return this; + } + + /** + *

    The date the fulfillment was created.

    + */ + @JsonSetter(value = "fulfillment_date", nulls = Nulls.SKIP) + public Builder fulfillmentDate(Optional fulfillmentDate) { + this.fulfillmentDate = fulfillmentDate; + return this; + } + + public Builder fulfillmentDate(OffsetDateTime fulfillmentDate) { + this.fulfillmentDate = Optional.ofNullable(fulfillmentDate); + return this; + } + + /** + *

    The customer associated with the item fulfillment.

    + */ + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public Builder customer(Optional customer) { + this.customer = customer; + return this; + } + + public Builder customer(ItemFulfillmentCustomer customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + /** + *

    The subsidiary associated with the fulfillment.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ItemFulfillmentCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    The status of the item fulfillment.

    + *
      + *
    • DRAFT - DRAFT
    • + *
    • IN_PROGRESS - IN_PROGRESS
    • + *
    • SHIPPED - SHIPPED
    • + *
    • CANCELLED - CANCELLED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ItemFulfillmentStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    Comment attached to the fulfillment.

    + */ + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + /** + *

    When the third party's item fulfillment was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's item fulfillment was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ItemFulfillment build() { + return new ItemFulfillment( + id, + itemFulfillmentUrl, + remoteId, + createdAt, + modifiedAt, + salesOrder, + fulfillmentDate, + customer, + company, + status, + memo, + lines, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentBatchItemRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentBatchItemRequest.java new file mode 100644 index 000000000..1f61b9a7d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentBatchItemRequest.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentBatchItemRequest.Builder.class) +public final class ItemFulfillmentBatchItemRequest { + private final String itemId; + + private final ItemFulfillmentRequestRequest payload; + + private final Map additionalProperties; + + private ItemFulfillmentBatchItemRequest( + String itemId, ItemFulfillmentRequestRequest payload, Map additionalProperties) { + this.itemId = itemId; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party item ID for this model in the bulk create request + */ + @JsonProperty("item_id") + public String getItemId() { + return itemId; + } + + @JsonProperty("payload") + public ItemFulfillmentRequestRequest getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentBatchItemRequest && equalTo((ItemFulfillmentBatchItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentBatchItemRequest other) { + return itemId.equals(other.itemId) && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemId, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ItemIdStage builder() { + return new Builder(); + } + + public interface ItemIdStage { + /** + *

    The third-party item ID for this model in the bulk create request

    + */ + PayloadStage itemId(@NotNull String itemId); + + Builder from(ItemFulfillmentBatchItemRequest other); + } + + public interface PayloadStage { + _FinalStage payload(@NotNull ItemFulfillmentRequestRequest payload); + } + + public interface _FinalStage { + ItemFulfillmentBatchItemRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ItemIdStage, PayloadStage, _FinalStage { + private String itemId; + + private ItemFulfillmentRequestRequest payload; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ItemFulfillmentBatchItemRequest other) { + itemId(other.getItemId()); + payload(other.getPayload()); + return this; + } + + /** + *

    The third-party item ID for this model in the bulk create request

    + *

    The third-party item ID for this model in the bulk create request

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("item_id") + public PayloadStage itemId(@NotNull String itemId) { + this.itemId = itemId; + return this; + } + + @java.lang.Override + @JsonSetter("payload") + public _FinalStage payload(@NotNull ItemFulfillmentRequestRequest payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public ItemFulfillmentBatchItemRequest build() { + return new ItemFulfillmentBatchItemRequest(itemId, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentBulkRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentBulkRequest.java new file mode 100644 index 000000000..b2c9bfd6d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentBulkRequest.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentBulkRequest.Builder.class) +public final class ItemFulfillmentBulkRequest { + private final List batchItems; + + private final Map additionalProperties; + + private ItemFulfillmentBulkRequest( + List batchItems, Map additionalProperties) { + this.batchItems = batchItems; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("batch_items") + public List getBatchItems() { + return batchItems; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentBulkRequest && equalTo((ItemFulfillmentBulkRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentBulkRequest other) { + return batchItems.equals(other.batchItems); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.batchItems); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List batchItems = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentBulkRequest other) { + batchItems(other.getBatchItems()); + return this; + } + + @JsonSetter(value = "batch_items", nulls = Nulls.SKIP) + public Builder batchItems(List batchItems) { + this.batchItems.clear(); + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public Builder addBatchItems(ItemFulfillmentBatchItemRequest batchItems) { + this.batchItems.add(batchItems); + return this; + } + + public Builder addAllBatchItems(List batchItems) { + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public ItemFulfillmentBulkRequest build() { + return new ItemFulfillmentBulkRequest(batchItems, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentCompany.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentCompany.java new file mode 100644 index 000000000..a1bc640aa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentCompany.Deserializer.class) +public final class ItemFulfillmentCompany { + private final Object value; + + private final int type; + + private ItemFulfillmentCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentCompany && equalTo((ItemFulfillmentCompany) other); + } + + private boolean equalTo(ItemFulfillmentCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentCompany of(String value) { + return new ItemFulfillmentCompany(value, 0); + } + + public static ItemFulfillmentCompany of(CompanyInfo value) { + return new ItemFulfillmentCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentCompany.class); + } + + @java.lang.Override + public ItemFulfillmentCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentCustomer.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentCustomer.java new file mode 100644 index 000000000..915ec65b8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentCustomer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentCustomer.Deserializer.class) +public final class ItemFulfillmentCustomer { + private final Object value; + + private final int type; + + private ItemFulfillmentCustomer(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentCustomer && equalTo((ItemFulfillmentCustomer) other); + } + + private boolean equalTo(ItemFulfillmentCustomer other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentCustomer of(String value) { + return new ItemFulfillmentCustomer(value, 0); + } + + public static ItemFulfillmentCustomer of(Contact value) { + return new ItemFulfillmentCustomer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentCustomer.class); + } + + @java.lang.Override + public ItemFulfillmentCustomer deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Contact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentEndpointRequest.java new file mode 100644 index 000000000..ede4a57bf --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentEndpointRequest.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentEndpointRequest.Builder.class) +public final class ItemFulfillmentEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final ItemFulfillmentRequestRequest model; + + private final Map additionalProperties; + + private ItemFulfillmentEndpointRequest( + Optional isDebugMode, + Optional runAsync, + ItemFulfillmentRequestRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public ItemFulfillmentRequestRequest getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentEndpointRequest && equalTo((ItemFulfillmentEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ItemFulfillmentRequestRequest model); + + Builder from(ItemFulfillmentEndpointRequest other); + } + + public interface _FinalStage { + ItemFulfillmentEndpointRequest build(); + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ItemFulfillmentRequestRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ItemFulfillmentEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull ItemFulfillmentRequestRequest model) { + this.model = model; + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public ItemFulfillmentEndpointRequest build() { + return new ItemFulfillmentEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLine.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLine.java new file mode 100644 index 000000000..3f01acb08 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLine.java @@ -0,0 +1,439 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentLine.Builder.class) +public final class ItemFulfillmentLine { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional item; + + private final Optional salesOrderLine; + + private final Optional quantity; + + private final Optional>> trackingCategories; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ItemFulfillmentLine( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional item, + Optional salesOrderLine, + Optional quantity, + Optional>> trackingCategories, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.item = item; + this.salesOrderLine = salesOrderLine; + this.quantity = quantity; + this.trackingCategories = trackingCategories; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + @JsonProperty("sales_order_line") + public Optional getSalesOrderLine() { + return salesOrderLine; + } + + /** + * @return The amount of item being delivered. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return The dimensions or classification tags. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return When the third party's item fulfillment line item was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's item fulfillment line item was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLine && equalTo((ItemFulfillmentLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentLine other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && item.equals(other.item) + && salesOrderLine.equals(other.salesOrderLine) + && quantity.equals(other.quantity) + && trackingCategories.equals(other.trackingCategories) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.item, + this.salesOrderLine, + this.quantity, + this.trackingCategories, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional salesOrderLine = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentLine other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + item(other.getItem()); + salesOrderLine(other.getSalesOrderLine()); + quantity(other.getQuantity()); + trackingCategories(other.getTrackingCategories()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(ItemFulfillmentLineItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "sales_order_line", nulls = Nulls.SKIP) + public Builder salesOrderLine(Optional salesOrderLine) { + this.salesOrderLine = salesOrderLine; + return this; + } + + public Builder salesOrderLine(ItemFulfillmentLineSalesOrderLine salesOrderLine) { + this.salesOrderLine = Optional.ofNullable(salesOrderLine); + return this; + } + + /** + *

    The amount of item being delivered.

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + *

    The dimensions or classification tags.

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + /** + *

    When the third party's item fulfillment line item was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's item fulfillment line item was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ItemFulfillmentLine build() { + return new ItemFulfillmentLine( + id, + remoteId, + createdAt, + modifiedAt, + item, + salesOrderLine, + quantity, + trackingCategories, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineItem.java new file mode 100644 index 000000000..44c0aa170 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentLineItem.Deserializer.class) +public final class ItemFulfillmentLineItem { + private final Object value; + + private final int type; + + private ItemFulfillmentLineItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLineItem && equalTo((ItemFulfillmentLineItem) other); + } + + private boolean equalTo(ItemFulfillmentLineItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentLineItem of(String value) { + return new ItemFulfillmentLineItem(value, 0); + } + + public static ItemFulfillmentLineItem of(Item value) { + return new ItemFulfillmentLineItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentLineItem.class); + } + + @java.lang.Override + public ItemFulfillmentLineItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Item.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequest.java new file mode 100644 index 000000000..1578b0b69 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequest.java @@ -0,0 +1,370 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentLineRequest.Builder.class) +public final class ItemFulfillmentLineRequest { + private final Optional remoteId; + + private final Optional item; + + private final Optional salesOrderLine; + + private final Optional quantity; + + private final Optional>> trackingCategories; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ItemFulfillmentLineRequest( + Optional remoteId, + Optional item, + Optional salesOrderLine, + Optional quantity, + Optional>> trackingCategories, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.item = item; + this.salesOrderLine = salesOrderLine; + this.quantity = quantity; + this.trackingCategories = trackingCategories; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + @JsonProperty("sales_order_line") + public Optional getSalesOrderLine() { + return salesOrderLine; + } + + /** + * @return The amount of item being delivered. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + /** + * @return The dimensions or classification tags. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return When the third party's item fulfillment line item was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's item fulfillment line item was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLineRequest && equalTo((ItemFulfillmentLineRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentLineRequest other) { + return remoteId.equals(other.remoteId) + && item.equals(other.item) + && salesOrderLine.equals(other.salesOrderLine) + && quantity.equals(other.quantity) + && trackingCategories.equals(other.trackingCategories) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.item, + this.salesOrderLine, + this.quantity, + this.trackingCategories, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteId = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional salesOrderLine = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentLineRequest other) { + remoteId(other.getRemoteId()); + item(other.getItem()); + salesOrderLine(other.getSalesOrderLine()); + quantity(other.getQuantity()); + trackingCategories(other.getTrackingCategories()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(ItemFulfillmentLineRequestItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + @JsonSetter(value = "sales_order_line", nulls = Nulls.SKIP) + public Builder salesOrderLine(Optional salesOrderLine) { + this.salesOrderLine = salesOrderLine; + return this; + } + + public Builder salesOrderLine(ItemFulfillmentLineRequestSalesOrderLine salesOrderLine) { + this.salesOrderLine = Optional.ofNullable(salesOrderLine); + return this; + } + + /** + *

    The amount of item being delivered.

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + *

    The dimensions or classification tags.

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + /** + *

    When the third party's item fulfillment line item was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's item fulfillment line item was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ItemFulfillmentLineRequest build() { + return new ItemFulfillmentLineRequest( + remoteId, + item, + salesOrderLine, + quantity, + trackingCategories, + remoteCreatedAt, + remoteUpdatedAt, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestItem.java new file mode 100644 index 000000000..c423e505a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentLineRequestItem.Deserializer.class) +public final class ItemFulfillmentLineRequestItem { + private final Object value; + + private final int type; + + private ItemFulfillmentLineRequestItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLineRequestItem && equalTo((ItemFulfillmentLineRequestItem) other); + } + + private boolean equalTo(ItemFulfillmentLineRequestItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentLineRequestItem of(String value) { + return new ItemFulfillmentLineRequestItem(value, 0); + } + + public static ItemFulfillmentLineRequestItem of(Item value) { + return new ItemFulfillmentLineRequestItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentLineRequestItem.class); + } + + @java.lang.Override + public ItemFulfillmentLineRequestItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Item.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.java new file mode 100644 index 000000000..14208f1f4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestSalesOrderLine.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentLineRequestSalesOrderLine.Deserializer.class) +public final class ItemFulfillmentLineRequestSalesOrderLine { + private final Object value; + + private final int type; + + private ItemFulfillmentLineRequestSalesOrderLine(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((SalesOrderLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLineRequestSalesOrderLine + && equalTo((ItemFulfillmentLineRequestSalesOrderLine) other); + } + + private boolean equalTo(ItemFulfillmentLineRequestSalesOrderLine other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentLineRequestSalesOrderLine of(String value) { + return new ItemFulfillmentLineRequestSalesOrderLine(value, 0); + } + + public static ItemFulfillmentLineRequestSalesOrderLine of(SalesOrderLine value) { + return new ItemFulfillmentLineRequestSalesOrderLine(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(SalesOrderLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentLineRequestSalesOrderLine.class); + } + + @java.lang.Override + public ItemFulfillmentLineRequestSalesOrderLine deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrderLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestTrackingCategoriesItem.java similarity index 66% rename from src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestTrackingCategoriesItem.java index 112900440..95f65422a 100644 --- a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLineTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineRequestTrackingCategoriesItem.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = GeneralLedgerTransactionLineTrackingCategoriesItem.Deserializer.class) -public final class GeneralLedgerTransactionLineTrackingCategoriesItem { +@JsonDeserialize(using = ItemFulfillmentLineRequestTrackingCategoriesItem.Deserializer.class) +public final class ItemFulfillmentLineRequestTrackingCategoriesItem { private final Object value; private final int type; - private GeneralLedgerTransactionLineTrackingCategoriesItem(Object value, int type) { + private ItemFulfillmentLineRequestTrackingCategoriesItem(Object value, int type) { this.value = value; this.type = type; } @@ -42,11 +42,11 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof GeneralLedgerTransactionLineTrackingCategoriesItem - && equalTo((GeneralLedgerTransactionLineTrackingCategoriesItem) other); + return other instanceof ItemFulfillmentLineRequestTrackingCategoriesItem + && equalTo((ItemFulfillmentLineRequestTrackingCategoriesItem) other); } - private boolean equalTo(GeneralLedgerTransactionLineTrackingCategoriesItem other) { + private boolean equalTo(ItemFulfillmentLineRequestTrackingCategoriesItem other) { return value.equals(other.value); } @@ -60,12 +60,12 @@ public String toString() { return this.value.toString(); } - public static GeneralLedgerTransactionLineTrackingCategoriesItem of(String value) { - return new GeneralLedgerTransactionLineTrackingCategoriesItem(value, 0); + public static ItemFulfillmentLineRequestTrackingCategoriesItem of(String value) { + return new ItemFulfillmentLineRequestTrackingCategoriesItem(value, 0); } - public static GeneralLedgerTransactionLineTrackingCategoriesItem of(TrackingCategory value) { - return new GeneralLedgerTransactionLineTrackingCategoriesItem(value, 1); + public static ItemFulfillmentLineRequestTrackingCategoriesItem of(TrackingCategory value) { + return new ItemFulfillmentLineRequestTrackingCategoriesItem(value, 1); } public interface Visitor { @@ -74,13 +74,13 @@ public interface Visitor { T visit(TrackingCategory value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(GeneralLedgerTransactionLineTrackingCategoriesItem.class); + super(ItemFulfillmentLineRequestTrackingCategoriesItem.class); } @java.lang.Override - public GeneralLedgerTransactionLineTrackingCategoriesItem deserialize( + public ItemFulfillmentLineRequestTrackingCategoriesItem deserialize( JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineSalesOrderLine.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineSalesOrderLine.java new file mode 100644 index 000000000..4a8e617f9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineSalesOrderLine.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentLineSalesOrderLine.Deserializer.class) +public final class ItemFulfillmentLineSalesOrderLine { + private final Object value; + + private final int type; + + private ItemFulfillmentLineSalesOrderLine(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((SalesOrderLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLineSalesOrderLine && equalTo((ItemFulfillmentLineSalesOrderLine) other); + } + + private boolean equalTo(ItemFulfillmentLineSalesOrderLine other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentLineSalesOrderLine of(String value) { + return new ItemFulfillmentLineSalesOrderLine(value, 0); + } + + public static ItemFulfillmentLineSalesOrderLine of(SalesOrderLine value) { + return new ItemFulfillmentLineSalesOrderLine(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(SalesOrderLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentLineSalesOrderLine.class); + } + + @java.lang.Override + public ItemFulfillmentLineSalesOrderLine deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrderLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineTrackingCategoriesItem.java new file mode 100644 index 000000000..dd8705956 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLineTrackingCategoriesItem.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentLineTrackingCategoriesItem.Deserializer.class) +public final class ItemFulfillmentLineTrackingCategoriesItem { + private final Object value; + + private final int type; + + private ItemFulfillmentLineTrackingCategoriesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLineTrackingCategoriesItem + && equalTo((ItemFulfillmentLineTrackingCategoriesItem) other); + } + + private boolean equalTo(ItemFulfillmentLineTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentLineTrackingCategoriesItem of(String value) { + return new ItemFulfillmentLineTrackingCategoriesItem(value, 0); + } + + public static ItemFulfillmentLineTrackingCategoriesItem of(TrackingCategory value) { + return new ItemFulfillmentLineTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentLineTrackingCategoriesItem.class); + } + + @java.lang.Override + public ItemFulfillmentLineTrackingCategoriesItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TrackingCategory.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLinesItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLinesItem.java new file mode 100644 index 000000000..35515f9dd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentLinesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentLinesItem.Deserializer.class) +public final class ItemFulfillmentLinesItem { + private final Object value; + + private final int type; + + private ItemFulfillmentLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((ItemFulfillmentLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentLinesItem && equalTo((ItemFulfillmentLinesItem) other); + } + + private boolean equalTo(ItemFulfillmentLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentLinesItem of(String value) { + return new ItemFulfillmentLinesItem(value, 0); + } + + public static ItemFulfillmentLinesItem of(ItemFulfillmentLine value) { + return new ItemFulfillmentLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ItemFulfillmentLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentLinesItem.class); + } + + @java.lang.Override + public ItemFulfillmentLinesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ItemFulfillmentLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequest.java new file mode 100644 index 000000000..1779c982c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequest.java @@ -0,0 +1,385 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentRequestRequest.Builder.class) +public final class ItemFulfillmentRequestRequest { + private final Optional salesOrder; + + private final Optional fulfillmentDate; + + private final Optional customer; + + private final Optional company; + + private final Optional status; + + private final Optional memo; + + private final Optional> lines; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private ItemFulfillmentRequestRequest( + Optional salesOrder, + Optional fulfillmentDate, + Optional customer, + Optional company, + Optional status, + Optional memo, + Optional> lines, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.salesOrder = salesOrder; + this.fulfillmentDate = fulfillmentDate; + this.customer = customer; + this.company = company; + this.status = status; + this.memo = memo; + this.lines = lines; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ID of the sales order that the item fulfillment originated from. + */ + @JsonProperty("sales_order") + public Optional getSalesOrder() { + return salesOrder; + } + + /** + * @return The date the fulfillment was created. + */ + @JsonProperty("fulfillment_date") + public Optional getFulfillmentDate() { + return fulfillmentDate; + } + + /** + * @return The customer associated with the item fulfillment. + */ + @JsonProperty("customer") + public Optional getCustomer() { + return customer; + } + + /** + * @return The subsidiary associated with the fulfillment. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The status of the item fulfillment. + *
      + *
    • DRAFT - DRAFT
    • + *
    • IN_PROGRESS - IN_PROGRESS
    • + *
    • SHIPPED - SHIPPED
    • + *
    • CANCELLED - CANCELLED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Comment attached to the fulfillment. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentRequestRequest && equalTo((ItemFulfillmentRequestRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentRequestRequest other) { + return salesOrder.equals(other.salesOrder) + && fulfillmentDate.equals(other.fulfillmentDate) + && customer.equals(other.customer) + && company.equals(other.company) + && status.equals(other.status) + && memo.equals(other.memo) + && lines.equals(other.lines) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.salesOrder, + this.fulfillmentDate, + this.customer, + this.company, + this.status, + this.memo, + this.lines, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional salesOrder = Optional.empty(); + + private Optional fulfillmentDate = Optional.empty(); + + private Optional customer = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentRequestRequest other) { + salesOrder(other.getSalesOrder()); + fulfillmentDate(other.getFulfillmentDate()); + customer(other.getCustomer()); + company(other.getCompany()); + status(other.getStatus()); + memo(other.getMemo()); + lines(other.getLines()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The ID of the sales order that the item fulfillment originated from.

    + */ + @JsonSetter(value = "sales_order", nulls = Nulls.SKIP) + public Builder salesOrder(Optional salesOrder) { + this.salesOrder = salesOrder; + return this; + } + + public Builder salesOrder(ItemFulfillmentRequestRequestSalesOrder salesOrder) { + this.salesOrder = Optional.ofNullable(salesOrder); + return this; + } + + /** + *

    The date the fulfillment was created.

    + */ + @JsonSetter(value = "fulfillment_date", nulls = Nulls.SKIP) + public Builder fulfillmentDate(Optional fulfillmentDate) { + this.fulfillmentDate = fulfillmentDate; + return this; + } + + public Builder fulfillmentDate(OffsetDateTime fulfillmentDate) { + this.fulfillmentDate = Optional.ofNullable(fulfillmentDate); + return this; + } + + /** + *

    The customer associated with the item fulfillment.

    + */ + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public Builder customer(Optional customer) { + this.customer = customer; + return this; + } + + public Builder customer(ItemFulfillmentRequestRequestCustomer customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + /** + *

    The subsidiary associated with the fulfillment.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(ItemFulfillmentRequestRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    The status of the item fulfillment.

    + *
      + *
    • DRAFT - DRAFT
    • + *
    • IN_PROGRESS - IN_PROGRESS
    • + *
    • SHIPPED - SHIPPED
    • + *
    • CANCELLED - CANCELLED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ItemFulfillmentRequestRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    Comment attached to the fulfillment.

    + */ + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public ItemFulfillmentRequestRequest build() { + return new ItemFulfillmentRequestRequest( + salesOrder, + fulfillmentDate, + customer, + company, + status, + memo, + lines, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestCompany.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestCompany.java new file mode 100644 index 000000000..5f99b7bc4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestCompany.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentRequestRequestCompany.Deserializer.class) +public final class ItemFulfillmentRequestRequestCompany { + private final Object value; + + private final int type; + + private ItemFulfillmentRequestRequestCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentRequestRequestCompany + && equalTo((ItemFulfillmentRequestRequestCompany) other); + } + + private boolean equalTo(ItemFulfillmentRequestRequestCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentRequestRequestCompany of(String value) { + return new ItemFulfillmentRequestRequestCompany(value, 0); + } + + public static ItemFulfillmentRequestRequestCompany of(CompanyInfo value) { + return new ItemFulfillmentRequestRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentRequestRequestCompany.class); + } + + @java.lang.Override + public ItemFulfillmentRequestRequestCompany deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestCustomer.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestCustomer.java new file mode 100644 index 000000000..7e4d9f1bd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestCustomer.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentRequestRequestCustomer.Deserializer.class) +public final class ItemFulfillmentRequestRequestCustomer { + private final Object value; + + private final int type; + + private ItemFulfillmentRequestRequestCustomer(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentRequestRequestCustomer + && equalTo((ItemFulfillmentRequestRequestCustomer) other); + } + + private boolean equalTo(ItemFulfillmentRequestRequestCustomer other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentRequestRequestCustomer of(String value) { + return new ItemFulfillmentRequestRequestCustomer(value, 0); + } + + public static ItemFulfillmentRequestRequestCustomer of(Contact value) { + return new ItemFulfillmentRequestRequestCustomer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentRequestRequestCustomer.class); + } + + @java.lang.Override + public ItemFulfillmentRequestRequestCustomer deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Contact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestLinesItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestLinesItem.java new file mode 100644 index 000000000..5073e2540 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestLinesItem.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentRequestRequestLinesItem.Deserializer.class) +public final class ItemFulfillmentRequestRequestLinesItem { + private final Object value; + + private final int type; + + private ItemFulfillmentRequestRequestLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((ItemFulfillmentLineRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentRequestRequestLinesItem + && equalTo((ItemFulfillmentRequestRequestLinesItem) other); + } + + private boolean equalTo(ItemFulfillmentRequestRequestLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentRequestRequestLinesItem of(String value) { + return new ItemFulfillmentRequestRequestLinesItem(value, 0); + } + + public static ItemFulfillmentRequestRequestLinesItem of(ItemFulfillmentLineRequest value) { + return new ItemFulfillmentRequestRequestLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ItemFulfillmentLineRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentRequestRequestLinesItem.class); + } + + @java.lang.Override + public ItemFulfillmentRequestRequestLinesItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ItemFulfillmentLineRequest.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAppliedToLinesItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestSalesOrder.java similarity index 66% rename from src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAppliedToLinesItem.java rename to src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestSalesOrder.java index 6c3e48347..936248a48 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestAppliedToLinesItem.java +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestSalesOrder.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = PatchedPaymentRequestAppliedToLinesItem.Deserializer.class) -public final class PatchedPaymentRequestAppliedToLinesItem { +@JsonDeserialize(using = ItemFulfillmentRequestRequestSalesOrder.Deserializer.class) +public final class ItemFulfillmentRequestRequestSalesOrder { private final Object value; private final int type; - private PatchedPaymentRequestAppliedToLinesItem(Object value, int type) { + private ItemFulfillmentRequestRequestSalesOrder(Object value, int type) { this.value = value; this.type = type; } @@ -34,7 +34,7 @@ public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((PaymentLineItemRequest) this.value); + return visitor.visit((SalesOrder) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -42,11 +42,11 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof PatchedPaymentRequestAppliedToLinesItem - && equalTo((PatchedPaymentRequestAppliedToLinesItem) other); + return other instanceof ItemFulfillmentRequestRequestSalesOrder + && equalTo((ItemFulfillmentRequestRequestSalesOrder) other); } - private boolean equalTo(PatchedPaymentRequestAppliedToLinesItem other) { + private boolean equalTo(ItemFulfillmentRequestRequestSalesOrder other) { return value.equals(other.value); } @@ -60,27 +60,27 @@ public String toString() { return this.value.toString(); } - public static PatchedPaymentRequestAppliedToLinesItem of(String value) { - return new PatchedPaymentRequestAppliedToLinesItem(value, 0); + public static ItemFulfillmentRequestRequestSalesOrder of(String value) { + return new ItemFulfillmentRequestRequestSalesOrder(value, 0); } - public static PatchedPaymentRequestAppliedToLinesItem of(PaymentLineItemRequest value) { - return new PatchedPaymentRequestAppliedToLinesItem(value, 1); + public static ItemFulfillmentRequestRequestSalesOrder of(SalesOrder value) { + return new ItemFulfillmentRequestRequestSalesOrder(value, 1); } public interface Visitor { T visit(String value); - T visit(PaymentLineItemRequest value); + T visit(SalesOrder value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(PatchedPaymentRequestAppliedToLinesItem.class); + super(ItemFulfillmentRequestRequestSalesOrder.class); } @java.lang.Override - public PatchedPaymentRequestAppliedToLinesItem deserialize(JsonParser p, DeserializationContext context) + public ItemFulfillmentRequestRequestSalesOrder deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { @@ -88,7 +88,7 @@ public PatchedPaymentRequestAppliedToLinesItem deserialize(JsonParser p, Deseria } catch (RuntimeException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentLineItemRequest.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrder.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestStatus.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestStatus.java new file mode 100644 index 000000000..bc5e8200b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentRequestRequestStatus.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentRequestRequestStatus.Deserializer.class) +public final class ItemFulfillmentRequestRequestStatus { + private final Object value; + + private final int type; + + private ItemFulfillmentRequestRequestStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ItemFulfillmentStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentRequestRequestStatus + && equalTo((ItemFulfillmentRequestRequestStatus) other); + } + + private boolean equalTo(ItemFulfillmentRequestRequestStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentRequestRequestStatus of(ItemFulfillmentStatusEnum value) { + return new ItemFulfillmentRequestRequestStatus(value, 0); + } + + public static ItemFulfillmentRequestRequestStatus of(String value) { + return new ItemFulfillmentRequestRequestStatus(value, 1); + } + + public interface Visitor { + T visit(ItemFulfillmentStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentRequestRequestStatus.class); + } + + @java.lang.Override + public ItemFulfillmentRequestRequestStatus deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ItemFulfillmentStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentResponse.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentResponse.java new file mode 100644 index 000000000..3b8b2261f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentResponse.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentResponse.Builder.class) +public final class ItemFulfillmentResponse { + private final ItemFulfillment model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private ItemFulfillmentResponse( + ItemFulfillment model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public ItemFulfillment getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentResponse && equalTo((ItemFulfillmentResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull ItemFulfillment model); + + Builder from(ItemFulfillmentResponse other); + } + + public interface _FinalStage { + ItemFulfillmentResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private ItemFulfillment model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ItemFulfillmentResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull ItemFulfillment model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public ItemFulfillmentResponse build() { + return new ItemFulfillmentResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentSalesOrder.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentSalesOrder.java new file mode 100644 index 000000000..56cf86a90 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentSalesOrder.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentSalesOrder.Deserializer.class) +public final class ItemFulfillmentSalesOrder { + private final Object value; + + private final int type; + + private ItemFulfillmentSalesOrder(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((SalesOrder) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentSalesOrder && equalTo((ItemFulfillmentSalesOrder) other); + } + + private boolean equalTo(ItemFulfillmentSalesOrder other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentSalesOrder of(String value) { + return new ItemFulfillmentSalesOrder(value, 0); + } + + public static ItemFulfillmentSalesOrder of(SalesOrder value) { + return new ItemFulfillmentSalesOrder(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(SalesOrder value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentSalesOrder.class); + } + + @java.lang.Override + public ItemFulfillmentSalesOrder deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrder.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentStatus.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentStatus.java new file mode 100644 index 000000000..db9d10aac --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ItemFulfillmentStatus.Deserializer.class) +public final class ItemFulfillmentStatus { + private final Object value; + + private final int type; + + private ItemFulfillmentStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ItemFulfillmentStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentStatus && equalTo((ItemFulfillmentStatus) other); + } + + private boolean equalTo(ItemFulfillmentStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ItemFulfillmentStatus of(ItemFulfillmentStatusEnum value) { + return new ItemFulfillmentStatus(value, 0); + } + + public static ItemFulfillmentStatus of(String value) { + return new ItemFulfillmentStatus(value, 1); + } + + public interface Visitor { + T visit(ItemFulfillmentStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ItemFulfillmentStatus.class); + } + + @java.lang.Override + public ItemFulfillmentStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ItemFulfillmentStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentStatusEnum.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentStatusEnum.java new file mode 100644 index 000000000..a1d5f8e1a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentStatusEnum.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ItemFulfillmentStatusEnum { + public static final ItemFulfillmentStatusEnum CANCELLED = + new ItemFulfillmentStatusEnum(Value.CANCELLED, "CANCELLED"); + + public static final ItemFulfillmentStatusEnum IN_PROGRESS = + new ItemFulfillmentStatusEnum(Value.IN_PROGRESS, "IN_PROGRESS"); + + public static final ItemFulfillmentStatusEnum DRAFT = new ItemFulfillmentStatusEnum(Value.DRAFT, "DRAFT"); + + public static final ItemFulfillmentStatusEnum SHIPPED = new ItemFulfillmentStatusEnum(Value.SHIPPED, "SHIPPED"); + + private final Value value; + + private final String string; + + ItemFulfillmentStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ItemFulfillmentStatusEnum + && this.string.equals(((ItemFulfillmentStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CANCELLED: + return visitor.visitCancelled(); + case IN_PROGRESS: + return visitor.visitInProgress(); + case DRAFT: + return visitor.visitDraft(); + case SHIPPED: + return visitor.visitShipped(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ItemFulfillmentStatusEnum valueOf(String value) { + switch (value) { + case "CANCELLED": + return CANCELLED; + case "IN_PROGRESS": + return IN_PROGRESS; + case "DRAFT": + return DRAFT; + case "SHIPPED": + return SHIPPED; + default: + return new ItemFulfillmentStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DRAFT, + + IN_PROGRESS, + + SHIPPED, + + CANCELLED, + + UNKNOWN + } + + public interface Visitor { + T visitDraft(); + + T visitInProgress(); + + T visitShipped(); + + T visitCancelled(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsLinesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..84bd0106c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsLinesRemoteFieldClassesListRequest.java @@ -0,0 +1,299 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentsLinesRemoteFieldClassesListRequest.Builder.class) +public final class ItemFulfillmentsLinesRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional isCustom; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ItemFulfillmentsLinesRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonModelField, + Optional isCustom, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.isCustom = isCustom; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return If provided, will only return remote fields classes with this is_custom value + */ + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentsLinesRemoteFieldClassesListRequest + && equalTo((ItemFulfillmentsLinesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentsLinesRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && isCustom.equals(other.isCustom) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.isCustom, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentsLinesRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + isCustom(other.getIsCustom()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, will only return remote field classes with this is_common_model_field value

    + */ + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + /** + *

    If provided, will only return remote fields classes with this is_custom value

    + */ + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ItemFulfillmentsLinesRemoteFieldClassesListRequest build() { + return new ItemFulfillmentsLinesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + isCustom, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsListRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsListRequest.java new file mode 100644 index 000000000..062750f84 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsListRequest.java @@ -0,0 +1,369 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentsListRequest.Builder.class) +public final class ItemFulfillmentsListRequest { + private final Optional> expand; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private ItemFulfillmentsListRequest( + Optional> expand, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional pageSize, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return 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 + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentsListRequest && equalTo((ItemFulfillmentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentsListRequest other) { + return expand.equals(other.expand) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.pageSize, + this.remoteFields, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentsListRequest other) { + expand(other.getExpand()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ItemFulfillmentsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

    + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    Deprecated. Use show_enum_origins.

    + */ + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + /** + *

    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

    + */ + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public ItemFulfillmentsListRequest build() { + return new ItemFulfillmentsListRequest( + expand, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + pageSize, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsListRequestExpandItem.java new file mode 100644 index 000000000..d2e304ca5 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsListRequestExpandItem.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ItemFulfillmentsListRequestExpandItem { + public static final ItemFulfillmentsListRequestExpandItem CUSTOMER = + new ItemFulfillmentsListRequestExpandItem(Value.CUSTOMER, "customer"); + + public static final ItemFulfillmentsListRequestExpandItem SALES_ORDER = + new ItemFulfillmentsListRequestExpandItem(Value.SALES_ORDER, "sales_order"); + + public static final ItemFulfillmentsListRequestExpandItem LINES = + new ItemFulfillmentsListRequestExpandItem(Value.LINES, "lines"); + + public static final ItemFulfillmentsListRequestExpandItem COMPANY = + new ItemFulfillmentsListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + ItemFulfillmentsListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ItemFulfillmentsListRequestExpandItem + && this.string.equals(((ItemFulfillmentsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOMER: + return visitor.visitCustomer(); + case SALES_ORDER: + return visitor.visitSalesOrder(); + case LINES: + return visitor.visitLines(); + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ItemFulfillmentsListRequestExpandItem valueOf(String value) { + switch (value) { + case "customer": + return CUSTOMER; + case "sales_order": + return SALES_ORDER; + case "lines": + return LINES; + case "company": + return COMPANY; + default: + return new ItemFulfillmentsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + CUSTOMER, + + LINES, + + SALES_ORDER, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitCustomer(); + + T visitLines(); + + T visitSalesOrder(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..3f20b8454 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRemoteFieldClassesListRequest.java @@ -0,0 +1,299 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentsRemoteFieldClassesListRequest.Builder.class) +public final class ItemFulfillmentsRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional isCustom; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ItemFulfillmentsRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonModelField, + Optional isCustom, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.isCustom = isCustom; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return If provided, will only return remote fields classes with this is_custom value + */ + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentsRemoteFieldClassesListRequest + && equalTo((ItemFulfillmentsRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentsRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && isCustom.equals(other.isCustom) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.isCustom, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentsRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + isCustom(other.getIsCustom()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, will only return remote field classes with this is_common_model_field value

    + */ + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + /** + *

    If provided, will only return remote fields classes with this is_custom value

    + */ + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ItemFulfillmentsRemoteFieldClassesListRequest build() { + return new ItemFulfillmentsRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + isCustom, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRetrieveRequest.java new file mode 100644 index 000000000..4ba8ca252 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRetrieveRequest.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemFulfillmentsRetrieveRequest.Builder.class) +public final class ItemFulfillmentsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private ItemFulfillmentsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return 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 + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemFulfillmentsRetrieveRequest && equalTo((ItemFulfillmentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ItemFulfillmentsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemFulfillmentsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ItemFulfillmentsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

    + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    Deprecated. Use show_enum_origins.

    + */ + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + /** + *

    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

    + */ + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public ItemFulfillmentsRetrieveRequest build() { + return new ItemFulfillmentsRetrieveRequest( + expand, + includeRemoteData, + includeRemoteFields, + includeShellData, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..5250e7879 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemFulfillmentsRetrieveRequestExpandItem.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ItemFulfillmentsRetrieveRequestExpandItem { + public static final ItemFulfillmentsRetrieveRequestExpandItem CUSTOMER = + new ItemFulfillmentsRetrieveRequestExpandItem(Value.CUSTOMER, "customer"); + + public static final ItemFulfillmentsRetrieveRequestExpandItem SALES_ORDER = + new ItemFulfillmentsRetrieveRequestExpandItem(Value.SALES_ORDER, "sales_order"); + + public static final ItemFulfillmentsRetrieveRequestExpandItem LINES = + new ItemFulfillmentsRetrieveRequestExpandItem(Value.LINES, "lines"); + + public static final ItemFulfillmentsRetrieveRequestExpandItem COMPANY = + new ItemFulfillmentsRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + ItemFulfillmentsRetrieveRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ItemFulfillmentsRetrieveRequestExpandItem + && this.string.equals(((ItemFulfillmentsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOMER: + return visitor.visitCustomer(); + case SALES_ORDER: + return visitor.visitSalesOrder(); + case LINES: + return visitor.visitLines(); + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ItemFulfillmentsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "customer": + return CUSTOMER; + case "sales_order": + return SALES_ORDER; + case "lines": + return LINES; + case "company": + return COMPANY; + default: + return new ItemFulfillmentsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + CUSTOMER, + + LINES, + + SALES_ORDER, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitCustomer(); + + T visitLines(); + + T visitSalesOrder(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java b/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java index 717195b53..4fe3e869d 100644 --- a/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java @@ -43,6 +43,8 @@ public final class ItemsListRequest { private final Optional modifiedBefore; + private final Optional name; + private final Optional pageSize; private final Optional remoteFields; @@ -64,6 +66,7 @@ private ItemsListRequest( Optional includeShellData, Optional modifiedAfter, Optional modifiedBefore, + Optional name, Optional pageSize, Optional remoteFields, Optional remoteId, @@ -79,6 +82,7 @@ private ItemsListRequest( this.includeShellData = includeShellData; this.modifiedAfter = modifiedAfter; this.modifiedBefore = modifiedBefore; + this.name = name; this.pageSize = pageSize; this.remoteFields = remoteFields; this.remoteId = remoteId; @@ -167,7 +171,15 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return If provided, will only return items with this name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -220,6 +232,7 @@ private boolean equalTo(ItemsListRequest other) { && includeShellData.equals(other.includeShellData) && modifiedAfter.equals(other.modifiedAfter) && modifiedBefore.equals(other.modifiedBefore) + && name.equals(other.name) && pageSize.equals(other.pageSize) && remoteFields.equals(other.remoteFields) && remoteId.equals(other.remoteId) @@ -239,6 +252,7 @@ public int hashCode() { this.includeShellData, this.modifiedAfter, this.modifiedBefore, + this.name, this.pageSize, this.remoteFields, this.remoteId, @@ -276,6 +290,8 @@ public static final class Builder { private Optional modifiedBefore = Optional.empty(); + private Optional name = Optional.empty(); + private Optional pageSize = Optional.empty(); private Optional remoteFields = Optional.empty(); @@ -300,6 +316,7 @@ public Builder from(ItemsListRequest other) { includeShellData(other.getIncludeShellData()); modifiedAfter(other.getModifiedAfter()); modifiedBefore(other.getModifiedBefore()); + name(other.getName()); pageSize(other.getPageSize()); remoteFields(other.getRemoteFields()); remoteId(other.getRemoteId()); @@ -453,7 +470,21 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    If provided, will only return items with this name.

    + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -520,6 +551,7 @@ public ItemsListRequest build() { includeShellData, modifiedAfter, modifiedBefore, + name, pageSize, remoteFields, remoteId, diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java index 6085e22de..09c8f23c0 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java index 30ce7318e..c356892f8 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java @@ -179,7 +179,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -484,7 +484,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java index 9d39cb83f..58b481159 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntry.java b/src/main/java/com/merge/api/accounting/types/JournalEntry.java index ef61d5c49..f3b72c229 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntry.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntry.java @@ -25,6 +25,8 @@ public final class JournalEntry { private final Optional id; + private final Optional journalEntryUrl; + private final Optional remoteId; private final Optional createdAt; @@ -47,7 +49,7 @@ public final class JournalEntry { private final Optional inclusiveOfTax; - private final Optional> lines; + private final Optional> lines; private final Optional journalNumber; @@ -73,6 +75,7 @@ public final class JournalEntry { private JournalEntry( Optional id, + Optional journalEntryUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, @@ -84,7 +87,7 @@ private JournalEntry( Optional exchangeRate, Optional company, Optional inclusiveOfTax, - Optional> lines, + Optional> lines, Optional journalNumber, Optional>> trackingCategories, Optional remoteWasDeleted, @@ -97,6 +100,7 @@ private JournalEntry( Optional> remoteFields, Map additionalProperties) { this.id = id; + this.journalEntryUrl = journalEntryUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -127,6 +131,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the journal entry. + */ + @JsonProperty("journal_entry_url") + public Optional getJournalEntryUrl() { + return journalEntryUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -524,7 +536,7 @@ public Optional getInclusiveOfTax() { } @JsonProperty("lines") - public Optional> getLines() { + public Optional> getLines() { return lines; } @@ -613,6 +625,7 @@ public Map getAdditionalProperties() { private boolean equalTo(JournalEntry other) { return id.equals(other.id) + && journalEntryUrl.equals(other.journalEntryUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -641,6 +654,7 @@ private boolean equalTo(JournalEntry other) { public int hashCode() { return Objects.hash( this.id, + this.journalEntryUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -678,6 +692,8 @@ public static Builder builder() { public static final class Builder { private Optional id = Optional.empty(); + private Optional journalEntryUrl = Optional.empty(); + private Optional remoteId = Optional.empty(); private Optional createdAt = Optional.empty(); @@ -700,7 +716,7 @@ public static final class Builder { private Optional inclusiveOfTax = Optional.empty(); - private Optional> lines = Optional.empty(); + private Optional> lines = Optional.empty(); private Optional journalNumber = Optional.empty(); @@ -729,6 +745,7 @@ private Builder() {} public Builder from(JournalEntry other) { id(other.getId()); + journalEntryUrl(other.getJournalEntryUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -765,6 +782,20 @@ public Builder id(String id) { return this; } + /** + *

    The 3rd party URL of the journal entry.

    + */ + @JsonSetter(value = "journal_entry_url", nulls = Nulls.SKIP) + public Builder journalEntryUrl(Optional journalEntryUrl) { + this.journalEntryUrl = journalEntryUrl; + return this; + } + + public Builder journalEntryUrl(String journalEntryUrl) { + this.journalEntryUrl = Optional.ofNullable(journalEntryUrl); + return this; + } + /** *

    The third-party API ID of the matching object.

    */ @@ -1228,12 +1259,12 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { } @JsonSetter(value = "lines", nulls = Nulls.SKIP) - public Builder lines(Optional> lines) { + public Builder lines(Optional> lines) { this.lines = lines; return this; } - public Builder lines(List lines) { + public Builder lines(List lines) { this.lines = Optional.ofNullable(lines); return this; } @@ -1374,6 +1405,7 @@ public Builder remoteFields(List remoteFields) { public JournalEntry build() { return new JournalEntry( id, + journalEntryUrl, remoteId, createdAt, modifiedAt, diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntryLinesItem.java b/src/main/java/com/merge/api/accounting/types/JournalEntryLinesItem.java new file mode 100644 index 000000000..5272eed88 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryLinesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryLinesItem.Deserializer.class) +public final class JournalEntryLinesItem { + private final Object value; + + private final int type; + + private JournalEntryLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((JournalLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryLinesItem && equalTo((JournalEntryLinesItem) other); + } + + private boolean equalTo(JournalEntryLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryLinesItem of(String value) { + return new JournalEntryLinesItem(value, 0); + } + + public static JournalEntryLinesItem of(JournalLine value) { + return new JournalEntryLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(JournalLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryLinesItem.class); + } + + @java.lang.Override + public JournalEntryLinesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, JournalLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntryRequest.java b/src/main/java/com/merge/api/accounting/types/JournalEntryRequest.java index 4f032ea3a..b7c85cd8f 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntryRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryRequest.java @@ -39,7 +39,7 @@ public final class JournalEntryRequest { private final Optional inclusiveOfTax; - private final Optional> lines; + private final Optional> lines; private final Optional journalNumber; @@ -62,7 +62,7 @@ private JournalEntryRequest( Optional company, Optional>> trackingCategories, Optional inclusiveOfTax, - Optional> lines, + Optional> lines, Optional journalNumber, Optional postingStatus, Optional> integrationParams, @@ -456,7 +456,7 @@ public Optional getInclusiveOfTax() { } @JsonProperty("lines") - public Optional> getLines() { + public Optional> getLines() { return lines; } @@ -570,7 +570,7 @@ public static final class Builder { private Optional inclusiveOfTax = Optional.empty(); - private Optional> lines = Optional.empty(); + private Optional> lines = Optional.empty(); private Optional journalNumber = Optional.empty(); @@ -1025,12 +1025,12 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { } @JsonSetter(value = "lines", nulls = Nulls.SKIP) - public Builder lines(Optional> lines) { + public Builder lines(Optional> lines) { this.lines = lines; return this; } - public Builder lines(List lines) { + public Builder lines(List lines) { this.lines = Optional.ofNullable(lines); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/JournalEntryRequestLinesItem.java b/src/main/java/com/merge/api/accounting/types/JournalEntryRequestLinesItem.java new file mode 100644 index 000000000..4382eebf6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryRequestLinesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = JournalEntryRequestLinesItem.Deserializer.class) +public final class JournalEntryRequestLinesItem { + private final Object value; + + private final int type; + + private JournalEntryRequestLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((JournalLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof JournalEntryRequestLinesItem && equalTo((JournalEntryRequestLinesItem) other); + } + + private boolean equalTo(JournalEntryRequestLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static JournalEntryRequestLinesItem of(String value) { + return new JournalEntryRequestLinesItem(value, 0); + } + + public static JournalEntryRequestLinesItem of(JournalLine value) { + return new JournalEntryRequestLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(JournalLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(JournalEntryRequestLinesItem.class); + } + + @java.lang.Override + public JournalEntryRequestLinesItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, JournalLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java index a2347eafd..169ab0a48 100644 --- a/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java @@ -80,7 +80,7 @@ private LinkedAccountsListRequest( } /** - * @return Options: accounting, ats, crm, filestorage, hris, mktg, ticketing + * @return Options: accounting, ats, crm, filestorage, hris, knowledgebase, mktg, ticketing *
      *
    • hris - hris
    • *
    • ats - ats
    • @@ -89,6 +89,10 @@ private LinkedAccountsListRequest( *
    • crm - crm
    • *
    • mktg - mktg
    • *
    • filestorage - filestorage
    • + *
    • datawarehouse - datawarehouse
    • + *
    • knowledgebase - knowledgebase
    • + *
    • communication - communication
    • + *
    • chat - chat
    • *
    */ @JsonProperty("category") @@ -174,7 +178,7 @@ public Optional getIsTestAccount() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -294,7 +298,7 @@ public Builder from(LinkedAccountsListRequest other) { } /** - *

    Options: accounting, ats, crm, filestorage, hris, mktg, ticketing

    + *

    Options: accounting, ats, crm, filestorage, hris, knowledgebase, mktg, ticketing

    *
      *
    • hris - hris
    • *
    • ats - ats
    • @@ -303,6 +307,10 @@ public Builder from(LinkedAccountsListRequest other) { *
    • crm - crm
    • *
    • mktg - mktg
    • *
    • filestorage - filestorage
    • + *
    • datawarehouse - datawarehouse
    • + *
    • knowledgebase - knowledgebase
    • + *
    • communication - communication
    • + *
    • chat - chat
    • *
    */ @JsonSetter(value = "category", nulls = Nulls.SKIP) @@ -454,7 +462,7 @@ public Builder isTestAccount(String isTestAccount) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequestCategory.java index 7bc0c2737..bdcf29b0b 100644 --- a/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequestCategory.java +++ b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequestCategory.java @@ -10,9 +10,15 @@ public final class LinkedAccountsListRequestCategory { public static final LinkedAccountsListRequestCategory HRIS = new LinkedAccountsListRequestCategory(Value.HRIS, "hris"); + public static final LinkedAccountsListRequestCategory KNOWLEDGEBASE = + new LinkedAccountsListRequestCategory(Value.KNOWLEDGEBASE, "knowledgebase"); + public static final LinkedAccountsListRequestCategory TICKETING = new LinkedAccountsListRequestCategory(Value.TICKETING, "ticketing"); + public static final LinkedAccountsListRequestCategory COMMUNICATION = + new LinkedAccountsListRequestCategory(Value.COMMUNICATION, "communication"); + public static final LinkedAccountsListRequestCategory CRM = new LinkedAccountsListRequestCategory(Value.CRM, "crm"); public static final LinkedAccountsListRequestCategory FILESTORAGE = @@ -21,11 +27,17 @@ public final class LinkedAccountsListRequestCategory { public static final LinkedAccountsListRequestCategory ACCOUNTING = new LinkedAccountsListRequestCategory(Value.ACCOUNTING, "accounting"); + public static final LinkedAccountsListRequestCategory DATAWAREHOUSE = + new LinkedAccountsListRequestCategory(Value.DATAWAREHOUSE, "datawarehouse"); + public static final LinkedAccountsListRequestCategory MKTG = new LinkedAccountsListRequestCategory(Value.MKTG, "mktg"); public static final LinkedAccountsListRequestCategory ATS = new LinkedAccountsListRequestCategory(Value.ATS, "ats"); + public static final LinkedAccountsListRequestCategory CHAT = + new LinkedAccountsListRequestCategory(Value.CHAT, "chat"); + private final Value value; private final String string; @@ -61,18 +73,26 @@ public T visit(Visitor visitor) { switch (value) { case HRIS: return visitor.visitHris(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); case TICKETING: return visitor.visitTicketing(); + case COMMUNICATION: + return visitor.visitCommunication(); case CRM: return visitor.visitCrm(); case FILESTORAGE: return visitor.visitFilestorage(); case ACCOUNTING: return visitor.visitAccounting(); + case DATAWAREHOUSE: + return visitor.visitDatawarehouse(); case MKTG: return visitor.visitMktg(); case ATS: return visitor.visitAts(); + case CHAT: + return visitor.visitChat(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -84,18 +104,26 @@ public static LinkedAccountsListRequestCategory valueOf(String value) { switch (value) { case "hris": return HRIS; + case "knowledgebase": + return KNOWLEDGEBASE; case "ticketing": return TICKETING; + case "communication": + return COMMUNICATION; case "crm": return CRM; case "filestorage": return FILESTORAGE; case "accounting": return ACCOUNTING; + case "datawarehouse": + return DATAWAREHOUSE; case "mktg": return MKTG; case "ats": return ATS; + case "chat": + return CHAT; default: return new LinkedAccountsListRequestCategory(Value.UNKNOWN, value); } @@ -106,12 +134,20 @@ public enum Value { ATS, + CHAT, + + COMMUNICATION, + CRM, + DATAWAREHOUSE, + FILESTORAGE, HRIS, + KNOWLEDGEBASE, + MKTG, TICKETING, @@ -124,12 +160,20 @@ public interface Visitor { T visitAts(); + T visitChat(); + + T visitCommunication(); + T visitCrm(); + T visitDatawarehouse(); + T visitFilestorage(); T visitHris(); + T visitKnowledgebase(); + T visitMktg(); T visitTicketing(); diff --git a/src/main/java/com/merge/api/accounting/types/MetaResponse.java b/src/main/java/com/merge/api/accounting/types/MetaResponse.java index d77906a50..4d9df5c79 100644 --- a/src/main/java/com/merge/api/accounting/types/MetaResponse.java +++ b/src/main/java/com/merge/api/accounting/types/MetaResponse.java @@ -15,6 +15,7 @@ import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -24,28 +25,28 @@ public final class MetaResponse { private final Map requestSchema; - private final Optional> remoteFieldClasses; - private final Optional status; private final boolean hasConditionalParams; private final boolean hasRequiredLinkedAccountParams; + private final Optional> remoteFields; + private final Map additionalProperties; private MetaResponse( Map requestSchema, - Optional> remoteFieldClasses, Optional status, boolean hasConditionalParams, boolean hasRequiredLinkedAccountParams, + Optional> remoteFields, Map additionalProperties) { this.requestSchema = requestSchema; - this.remoteFieldClasses = remoteFieldClasses; this.status = status; this.hasConditionalParams = hasConditionalParams; this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.remoteFields = remoteFields; this.additionalProperties = additionalProperties; } @@ -54,11 +55,6 @@ public Map getRequestSchema() { return requestSchema; } - @JsonProperty("remote_field_classes") - public Optional> getRemoteFieldClasses() { - return remoteFieldClasses; - } - @JsonProperty("status") public Optional getStatus() { return status; @@ -74,6 +70,14 @@ public boolean getHasRequiredLinkedAccountParams() { return hasRequiredLinkedAccountParams; } + /** + * @return Remote field values to populate + */ + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -87,20 +91,20 @@ public Map getAdditionalProperties() { private boolean equalTo(MetaResponse other) { return requestSchema.equals(other.requestSchema) - && remoteFieldClasses.equals(other.remoteFieldClasses) && status.equals(other.status) && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams + && remoteFields.equals(other.remoteFields); } @java.lang.Override public int hashCode() { return Objects.hash( this.requestSchema, - this.remoteFieldClasses, this.status, this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); + this.hasRequiredLinkedAccountParams, + this.remoteFields); } @java.lang.Override @@ -131,13 +135,16 @@ public interface _FinalStage { _FinalStage requestSchema(String key, JsonNode value); - _FinalStage remoteFieldClasses(Optional> remoteFieldClasses); - - _FinalStage remoteFieldClasses(Map remoteFieldClasses); - _FinalStage status(Optional status); _FinalStage status(LinkedAccountStatus status); + + /** + *

    Remote field values to populate

    + */ + _FinalStage remoteFields(Optional> remoteFields); + + _FinalStage remoteFields(List remoteFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -147,9 +154,9 @@ public static final class Builder private boolean hasRequiredLinkedAccountParams; - private Optional status = Optional.empty(); + private Optional> remoteFields = Optional.empty(); - private Optional> remoteFieldClasses = Optional.empty(); + private Optional status = Optional.empty(); private Map requestSchema = new LinkedHashMap<>(); @@ -161,10 +168,10 @@ private Builder() {} @java.lang.Override public Builder from(MetaResponse other) { requestSchema(other.getRequestSchema()); - remoteFieldClasses(other.getRemoteFieldClasses()); status(other.getStatus()); hasConditionalParams(other.getHasConditionalParams()); hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + remoteFields(other.getRemoteFields()); return this; } @@ -182,29 +189,36 @@ public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccou return this; } + /** + *

    Remote field values to populate

    + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override - public _FinalStage status(LinkedAccountStatus status) { - this.status = Optional.ofNullable(status); + public _FinalStage remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); return this; } + /** + *

    Remote field values to populate

    + */ @java.lang.Override - @JsonSetter(value = "status", nulls = Nulls.SKIP) - public _FinalStage status(Optional status) { - this.status = status; + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public _FinalStage remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; return this; } @java.lang.Override - public _FinalStage remoteFieldClasses(Map remoteFieldClasses) { - this.remoteFieldClasses = Optional.ofNullable(remoteFieldClasses); + public _FinalStage status(LinkedAccountStatus status) { + this.status = Optional.ofNullable(status); return this; } @java.lang.Override - @JsonSetter(value = "remote_field_classes", nulls = Nulls.SKIP) - public _FinalStage remoteFieldClasses(Optional> remoteFieldClasses) { - this.remoteFieldClasses = remoteFieldClasses; + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; return this; } @@ -236,10 +250,10 @@ public _FinalStage requestSchema(Map requestSchema) { public MetaResponse build() { return new MetaResponse( requestSchema, - remoteFieldClasses, status, hasConditionalParams, hasRequiredLinkedAccountParams, + remoteFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java index 5eaff435e..10beaf6ad 100644 --- a/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java +++ b/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java @@ -25,7 +25,7 @@ public final class MultipartFormFieldRequest { private final String data; - private final Optional encoding; + private final Optional encoding; private final Optional fileName; @@ -36,7 +36,7 @@ public final class MultipartFormFieldRequest { private MultipartFormFieldRequest( String name, String data, - Optional encoding, + Optional encoding, Optional fileName, Optional contentType, Map additionalProperties) { @@ -73,7 +73,7 @@ public String getData() { * */ @JsonProperty("encoding") - public Optional getEncoding() { + public Optional getEncoding() { return encoding; } @@ -153,9 +153,9 @@ public interface _FinalStage { *
  • GZIP_BASE64 - GZIP_BASE64
  • * */ - _FinalStage encoding(Optional encoding); + _FinalStage encoding(Optional encoding); - _FinalStage encoding(EncodingEnum encoding); + _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); /** *

    The file name of the form field, if the field is for a file.

    @@ -182,7 +182,7 @@ public static final class Builder implements NameStage, DataStage, _FinalStage { private Optional fileName = Optional.empty(); - private Optional encoding = Optional.empty(); + private Optional encoding = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -273,7 +273,7 @@ public _FinalStage fileName(Optional fileName) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage encoding(EncodingEnum encoding) { + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { this.encoding = Optional.ofNullable(encoding); return this; } @@ -288,7 +288,7 @@ public _FinalStage encoding(EncodingEnum encoding) { */ @java.lang.Override @JsonSetter(value = "encoding", nulls = Nulls.SKIP) - public _FinalStage encoding(Optional encoding) { + public _FinalStage encoding(Optional encoding) { this.encoding = encoding; return this; } diff --git a/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..da97ed0d7 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) +public final class MultipartFormFieldRequestEncoding { + private final Object value; + + private final int type; + + private MultipartFormFieldRequestEncoding(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EncodingEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); + } + + private boolean equalTo(MultipartFormFieldRequestEncoding other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { + return new MultipartFormFieldRequestEncoding(value, 0); + } + + public static MultipartFormFieldRequestEncoding of(String value) { + return new MultipartFormFieldRequestEncoding(value, 1); + } + + public interface Visitor { + T visit(EncodingEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(MultipartFormFieldRequestEncoding.class); + } + + @java.lang.Override + public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedExpenseReportLineList.java b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseReportLineList.java new file mode 100644 index 000000000..ab5eb9c9c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseReportLineList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedExpenseReportLineList.Builder.class) +public final class PaginatedExpenseReportLineList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedExpenseReportLineList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedExpenseReportLineList && equalTo((PaginatedExpenseReportLineList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedExpenseReportLineList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedExpenseReportLineList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedExpenseReportLineList build() { + return new PaginatedExpenseReportLineList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedExpenseReportList.java b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseReportList.java new file mode 100644 index 000000000..781db414d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseReportList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedExpenseReportList.Builder.class) +public final class PaginatedExpenseReportList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedExpenseReportList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedExpenseReportList && equalTo((PaginatedExpenseReportList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedExpenseReportList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedExpenseReportList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedExpenseReportList build() { + return new PaginatedExpenseReportList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedItemFulfillmentList.java b/src/main/java/com/merge/api/accounting/types/PaginatedItemFulfillmentList.java new file mode 100644 index 000000000..e8fd38706 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedItemFulfillmentList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedItemFulfillmentList.Builder.class) +public final class PaginatedItemFulfillmentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedItemFulfillmentList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedItemFulfillmentList && equalTo((PaginatedItemFulfillmentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedItemFulfillmentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedItemFulfillmentList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedItemFulfillmentList build() { + return new PaginatedItemFulfillmentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedSalesOrderList.java b/src/main/java/com/merge/api/accounting/types/PaginatedSalesOrderList.java new file mode 100644 index 000000000..5ec8377ae --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaginatedSalesOrderList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSalesOrderList.Builder.class) +public final class PaginatedSalesOrderList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSalesOrderList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSalesOrderList && equalTo((PaginatedSalesOrderList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSalesOrderList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSalesOrderList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSalesOrderList build() { + return new PaginatedSalesOrderList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedContactEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedContactEndpointRequest.java new file mode 100644 index 000000000..330c4cb41 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PatchedContactEndpointRequest.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedContactEndpointRequest.Builder.class) +public final class PatchedContactEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedContactRequest model; + + private final Map additionalProperties; + + private PatchedContactEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedContactRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedContactRequest getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedContactEndpointRequest && equalTo((PatchedContactEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedContactEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedContactRequest model); + + Builder from(PatchedContactEndpointRequest other); + } + + public interface _FinalStage { + PatchedContactEndpointRequest build(); + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedContactRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PatchedContactEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedContactRequest model) { + this.model = model; + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public PatchedContactEndpointRequest build() { + return new PatchedContactEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedContactRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedContactRequest.java new file mode 100644 index 000000000..6770eecc2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PatchedContactRequest.java @@ -0,0 +1,514 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedContactRequest.Builder.class) +public final class PatchedContactRequest { + private final Optional contactUrl; + + private final Optional name; + + private final Optional isSupplier; + + private final Optional isCustomer; + + private final Optional emailAddress; + + private final Optional taxNumber; + + private final Optional status; + + private final Optional currency; + + private final Optional company; + + private final Optional> addresses; + + private final Optional> phoneNumbers; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private PatchedContactRequest( + Optional contactUrl, + Optional name, + Optional isSupplier, + Optional isCustomer, + Optional emailAddress, + Optional taxNumber, + Optional status, + Optional currency, + Optional company, + Optional> addresses, + Optional> phoneNumbers, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.contactUrl = contactUrl; + this.name = name; + this.isSupplier = isSupplier; + this.isCustomer = isCustomer; + this.emailAddress = emailAddress; + this.taxNumber = taxNumber; + this.status = status; + this.currency = currency; + this.company = company; + this.addresses = addresses; + this.phoneNumbers = phoneNumbers; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The 3rd party URL of the contact. + */ + @JsonProperty("contact_url") + public Optional getContactUrl() { + return contactUrl; + } + + /** + * @return The contact's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Whether the contact is a supplier. + */ + @JsonProperty("is_supplier") + public Optional getIsSupplier() { + return isSupplier; + } + + /** + * @return Whether the contact is a customer. + */ + @JsonProperty("is_customer") + public Optional getIsCustomer() { + return isCustomer; + } + + /** + * @return The contact's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return The contact's tax number. + */ + @JsonProperty("tax_number") + public Optional getTaxNumber() { + return taxNumber; + } + + /** + * @return The contact's status + *
      + *
    • ACTIVE - ACTIVE
    • + *
    • ARCHIVED - ARCHIVED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The currency the contact's transactions are in. + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return The company the contact belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return Address object IDs for the given Contacts object. + */ + @JsonProperty("addresses") + public Optional> getAddresses() { + return addresses; + } + + /** + * @return AccountingPhoneNumber object for the given Contacts object. + */ + @JsonProperty("phone_numbers") + public Optional> getPhoneNumbers() { + return phoneNumbers; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedContactRequest && equalTo((PatchedContactRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedContactRequest other) { + return contactUrl.equals(other.contactUrl) + && name.equals(other.name) + && isSupplier.equals(other.isSupplier) + && isCustomer.equals(other.isCustomer) + && emailAddress.equals(other.emailAddress) + && taxNumber.equals(other.taxNumber) + && status.equals(other.status) + && currency.equals(other.currency) + && company.equals(other.company) + && addresses.equals(other.addresses) + && phoneNumbers.equals(other.phoneNumbers) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.contactUrl, + this.name, + this.isSupplier, + this.isCustomer, + this.emailAddress, + this.taxNumber, + this.status, + this.currency, + this.company, + this.addresses, + this.phoneNumbers, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional contactUrl = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional isSupplier = Optional.empty(); + + private Optional isCustomer = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional taxNumber = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional> addresses = Optional.empty(); + + private Optional> phoneNumbers = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedContactRequest other) { + contactUrl(other.getContactUrl()); + name(other.getName()); + isSupplier(other.getIsSupplier()); + isCustomer(other.getIsCustomer()); + emailAddress(other.getEmailAddress()); + taxNumber(other.getTaxNumber()); + status(other.getStatus()); + currency(other.getCurrency()); + company(other.getCompany()); + addresses(other.getAddresses()); + phoneNumbers(other.getPhoneNumbers()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The 3rd party URL of the contact.

    + */ + @JsonSetter(value = "contact_url", nulls = Nulls.SKIP) + public Builder contactUrl(Optional contactUrl) { + this.contactUrl = contactUrl; + return this; + } + + public Builder contactUrl(String contactUrl) { + this.contactUrl = Optional.ofNullable(contactUrl); + return this; + } + + /** + *

    The contact's name.

    + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

    Whether the contact is a supplier.

    + */ + @JsonSetter(value = "is_supplier", nulls = Nulls.SKIP) + public Builder isSupplier(Optional isSupplier) { + this.isSupplier = isSupplier; + return this; + } + + public Builder isSupplier(Boolean isSupplier) { + this.isSupplier = Optional.ofNullable(isSupplier); + return this; + } + + /** + *

    Whether the contact is a customer.

    + */ + @JsonSetter(value = "is_customer", nulls = Nulls.SKIP) + public Builder isCustomer(Optional isCustomer) { + this.isCustomer = isCustomer; + return this; + } + + public Builder isCustomer(Boolean isCustomer) { + this.isCustomer = Optional.ofNullable(isCustomer); + return this; + } + + /** + *

    The contact's email address.

    + */ + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + *

    The contact's tax number.

    + */ + @JsonSetter(value = "tax_number", nulls = Nulls.SKIP) + public Builder taxNumber(Optional taxNumber) { + this.taxNumber = taxNumber; + return this; + } + + public Builder taxNumber(String taxNumber) { + this.taxNumber = Optional.ofNullable(taxNumber); + return this; + } + + /** + *

    The contact's status

    + *
      + *
    • ACTIVE - ACTIVE
    • + *
    • ARCHIVED - ARCHIVED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(PatchedContactRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    The currency the contact's transactions are in.

    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(String currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    The company the contact belongs to.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(String company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    Address object IDs for the given Contacts object.

    + */ + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) + public Builder addresses(Optional> addresses) { + this.addresses = addresses; + return this; + } + + public Builder addresses(List addresses) { + this.addresses = Optional.ofNullable(addresses); + return this; + } + + /** + *

    AccountingPhoneNumber object for the given Contacts object.

    + */ + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) + public Builder phoneNumbers(Optional> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Builder phoneNumbers(List phoneNumbers) { + this.phoneNumbers = Optional.ofNullable(phoneNumbers); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public PatchedContactRequest build() { + return new PatchedContactRequest( + contactUrl, + name, + isSupplier, + isCustomer, + emailAddress, + taxNumber, + status, + currency, + company, + addresses, + phoneNumbers, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedContactRequestStatus.java b/src/main/java/com/merge/api/accounting/types/PatchedContactRequestStatus.java new file mode 100644 index 000000000..160aa57f8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PatchedContactRequestStatus.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PatchedContactRequestStatus.Deserializer.class) +public final class PatchedContactRequestStatus { + private final Object value; + + private final int type; + + private PatchedContactRequestStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((Status7D1Enum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedContactRequestStatus && equalTo((PatchedContactRequestStatus) other); + } + + private boolean equalTo(PatchedContactRequestStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PatchedContactRequestStatus of(Status7D1Enum value) { + return new PatchedContactRequestStatus(value, 0); + } + + public static PatchedContactRequestStatus of(String value) { + return new PatchedContactRequestStatus(value, 1); + } + + public interface Visitor { + T visit(Status7D1Enum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PatchedContactRequestStatus.class); + } + + @java.lang.Override + public PatchedContactRequestStatus deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status7D1Enum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedCreditNoteEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedCreditNoteEndpointRequest.java new file mode 100644 index 000000000..3923e2999 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PatchedCreditNoteEndpointRequest.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedCreditNoteEndpointRequest.Builder.class) +public final class PatchedCreditNoteEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final CreditNoteRequest model; + + private final Map additionalProperties; + + private PatchedCreditNoteEndpointRequest( + Optional isDebugMode, + Optional runAsync, + CreditNoteRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public CreditNoteRequest getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedCreditNoteEndpointRequest && equalTo((PatchedCreditNoteEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedCreditNoteEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull CreditNoteRequest model); + + Builder from(PatchedCreditNoteEndpointRequest other); + } + + public interface _FinalStage { + PatchedCreditNoteEndpointRequest build(); + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private CreditNoteRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PatchedCreditNoteEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull CreditNoteRequest model) { + this.model = model; + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public PatchedCreditNoteEndpointRequest build() { + return new PatchedCreditNoteEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedEditFieldMappingRequest.java index ae506e399..24bf8e9e9 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedEditFieldMappingRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedEditFieldMappingRequest.java @@ -22,25 +22,45 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + private final Optional> remoteFieldTraversalPath; private final Optional remoteMethod; private final Optional remoteUrlPath; + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + private final Map additionalProperties; private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, Optional> remoteFieldTraversalPath, Optional remoteMethod, Optional remoteUrlPath, + Optional jmesPath, + Optional advancedMappingExpression, Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; this.additionalProperties = additionalProperties; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. */ @@ -65,6 +85,22 @@ public Optional getRemoteUrlPath() { return remoteUrlPath; } + /** + * @return DEPRECATED: Use 'advanced_mapping_expression' instead. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + /** + * @return A JSONata expression used to transform the remote field data. + */ + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +113,23 @@ public Map getAdditionalProperties() { } private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); } @java.lang.Override public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath, + this.advancedMappingExpression); } @java.lang.Override @@ -98,21 +143,44 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + private Optional> remoteFieldTraversalPath = Optional.empty(); private Optional remoteMethod = Optional.empty(); private Optional remoteUrlPath = Optional.empty(); + private Optional jmesPath = Optional.empty(); + + private Optional advancedMappingExpression = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); return this; } @@ -158,9 +226,43 @@ public Builder remoteUrlPath(String remoteUrlPath) { return this; } + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    A JSONata expression used to transform the remote field data.

    + */ + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public Builder advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + public Builder advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + public PatchedEditFieldMappingRequest build() { return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + advancedMappingExpression, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java index 6c0917f19..e9feecf60 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java @@ -23,29 +23,31 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PatchedPaymentRequest.Builder.class) public final class PatchedPaymentRequest { + private final Optional paymentUrl; + private final Optional transactionDate; - private final Optional contact; + private final Optional contact; - private final Optional account; + private final Optional account; - private final Optional paymentMethod; + private final Optional paymentMethod; private final Optional currency; private final Optional exchangeRate; - private final Optional company; + private final Optional company; private final Optional totalAmount; private final Optional type; - private final Optional>> trackingCategories; + private final Optional>> trackingCategories; - private final Optional accountingPeriod; + private final Optional accountingPeriod; - private final Optional> appliedToLines; + private final Optional> appliedToLines; private final Optional> integrationParams; @@ -56,22 +58,24 @@ public final class PatchedPaymentRequest { private final Map additionalProperties; private PatchedPaymentRequest( + Optional paymentUrl, Optional transactionDate, - Optional contact, - Optional account, - Optional paymentMethod, + Optional contact, + Optional account, + Optional paymentMethod, Optional currency, Optional exchangeRate, - Optional company, + Optional company, Optional totalAmount, Optional type, - Optional>> trackingCategories, - Optional accountingPeriod, - Optional> appliedToLines, + Optional>> trackingCategories, + Optional accountingPeriod, + Optional> appliedToLines, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, Map additionalProperties) { + this.paymentUrl = paymentUrl; this.transactionDate = transactionDate; this.contact = contact; this.account = account; @@ -90,6 +94,14 @@ private PatchedPaymentRequest( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the payment. + */ + @JsonProperty("payment_url") + public Optional getPaymentUrl() { + return paymentUrl; + } + /** * @return The payment's transaction date. */ @@ -102,7 +114,7 @@ public Optional getTransactionDate() { * @return The supplier, or customer involved in the payment. */ @JsonProperty("contact") - public Optional getContact() { + public Optional getContact() { return contact; } @@ -110,7 +122,7 @@ public Optional getContact() { * @return The supplier’s or customer’s account in which the payment is made. */ @JsonProperty("account") - public Optional getAccount() { + public Optional getAccount() { return account; } @@ -118,7 +130,7 @@ public Optional getAccount() { * @return The method which this payment was made by. */ @JsonProperty("payment_method") - public Optional getPaymentMethod() { + public Optional getPaymentMethod() { return paymentMethod; } @@ -450,7 +462,7 @@ public Optional getExchangeRate() { * @return The company the payment belongs to. */ @JsonProperty("company") - public Optional getCompany() { + public Optional getCompany() { return company; } @@ -475,7 +487,7 @@ public Optional getType() { } @JsonProperty("tracking_categories") - public Optional>> getTrackingCategories() { + public Optional>> getTrackingCategories() { return trackingCategories; } @@ -483,7 +495,7 @@ public Optional>> get * @return The accounting period that the Payment was generated in. */ @JsonProperty("accounting_period") - public Optional getAccountingPeriod() { + public Optional getAccountingPeriod() { return accountingPeriod; } @@ -491,7 +503,7 @@ public Optional getAccountingPeriod() { * @return A list of “Payment Applied to Lines” objects. */ @JsonProperty("applied_to_lines") - public Optional> getAppliedToLines() { + public Optional> getAppliedToLines() { return appliedToLines; } @@ -522,7 +534,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(PatchedPaymentRequest other) { - return transactionDate.equals(other.transactionDate) + return paymentUrl.equals(other.paymentUrl) + && transactionDate.equals(other.transactionDate) && contact.equals(other.contact) && account.equals(other.account) && paymentMethod.equals(other.paymentMethod) @@ -542,6 +555,7 @@ private boolean equalTo(PatchedPaymentRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.paymentUrl, this.transactionDate, this.contact, this.account, @@ -570,30 +584,31 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional paymentUrl = Optional.empty(); + private Optional transactionDate = Optional.empty(); - private Optional contact = Optional.empty(); + private Optional contact = Optional.empty(); - private Optional account = Optional.empty(); + private Optional account = Optional.empty(); - private Optional paymentMethod = Optional.empty(); + private Optional paymentMethod = Optional.empty(); private Optional currency = Optional.empty(); private Optional exchangeRate = Optional.empty(); - private Optional company = Optional.empty(); + private Optional company = Optional.empty(); private Optional totalAmount = Optional.empty(); private Optional type = Optional.empty(); - private Optional>> trackingCategories = - Optional.empty(); + private Optional>> trackingCategories = Optional.empty(); - private Optional accountingPeriod = Optional.empty(); + private Optional accountingPeriod = Optional.empty(); - private Optional> appliedToLines = Optional.empty(); + private Optional> appliedToLines = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -607,6 +622,7 @@ public static final class Builder { private Builder() {} public Builder from(PatchedPaymentRequest other) { + paymentUrl(other.getPaymentUrl()); transactionDate(other.getTransactionDate()); contact(other.getContact()); account(other.getAccount()); @@ -625,6 +641,20 @@ public Builder from(PatchedPaymentRequest other) { return this; } + /** + *

    The 3rd party URL of the payment.

    + */ + @JsonSetter(value = "payment_url", nulls = Nulls.SKIP) + public Builder paymentUrl(Optional paymentUrl) { + this.paymentUrl = paymentUrl; + return this; + } + + public Builder paymentUrl(String paymentUrl) { + this.paymentUrl = Optional.ofNullable(paymentUrl); + return this; + } + /** *

    The payment's transaction date.

    */ @@ -643,12 +673,12 @@ public Builder transactionDate(OffsetDateTime transactionDate) { *

    The supplier, or customer involved in the payment.

    */ @JsonSetter(value = "contact", nulls = Nulls.SKIP) - public Builder contact(Optional contact) { + public Builder contact(Optional contact) { this.contact = contact; return this; } - public Builder contact(PatchedPaymentRequestContact contact) { + public Builder contact(String contact) { this.contact = Optional.ofNullable(contact); return this; } @@ -657,12 +687,12 @@ public Builder contact(PatchedPaymentRequestContact contact) { *

    The supplier’s or customer’s account in which the payment is made.

    */ @JsonSetter(value = "account", nulls = Nulls.SKIP) - public Builder account(Optional account) { + public Builder account(Optional account) { this.account = account; return this; } - public Builder account(PatchedPaymentRequestAccount account) { + public Builder account(String account) { this.account = Optional.ofNullable(account); return this; } @@ -671,12 +701,12 @@ public Builder account(PatchedPaymentRequestAccount account) { *

    The method which this payment was made by.

    */ @JsonSetter(value = "payment_method", nulls = Nulls.SKIP) - public Builder paymentMethod(Optional paymentMethod) { + public Builder paymentMethod(Optional paymentMethod) { this.paymentMethod = paymentMethod; return this; } - public Builder paymentMethod(PatchedPaymentRequestPaymentMethod paymentMethod) { + public Builder paymentMethod(String paymentMethod) { this.paymentMethod = Optional.ofNullable(paymentMethod); return this; } @@ -1021,12 +1051,12 @@ public Builder exchangeRate(String exchangeRate) { *

    The company the payment belongs to.

    */ @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { + public Builder company(Optional company) { this.company = company; return this; } - public Builder company(PatchedPaymentRequestCompany company) { + public Builder company(String company) { this.company = Optional.ofNullable(company); return this; } @@ -1064,14 +1094,12 @@ public Builder type(PatchedPaymentRequestType type) { } @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) - public Builder trackingCategories( - Optional>> trackingCategories) { + public Builder trackingCategories(Optional>> trackingCategories) { this.trackingCategories = trackingCategories; return this; } - public Builder trackingCategories( - List> trackingCategories) { + public Builder trackingCategories(List> trackingCategories) { this.trackingCategories = Optional.ofNullable(trackingCategories); return this; } @@ -1080,12 +1108,12 @@ public Builder trackingCategories( *

    The accounting period that the Payment was generated in.

    */ @JsonSetter(value = "accounting_period", nulls = Nulls.SKIP) - public Builder accountingPeriod(Optional accountingPeriod) { + public Builder accountingPeriod(Optional accountingPeriod) { this.accountingPeriod = accountingPeriod; return this; } - public Builder accountingPeriod(PatchedPaymentRequestAccountingPeriod accountingPeriod) { + public Builder accountingPeriod(String accountingPeriod) { this.accountingPeriod = Optional.ofNullable(accountingPeriod); return this; } @@ -1094,12 +1122,12 @@ public Builder accountingPeriod(PatchedPaymentRequestAccountingPeriod accounting *

    A list of “Payment Applied to Lines” objects.

    */ @JsonSetter(value = "applied_to_lines", nulls = Nulls.SKIP) - public Builder appliedToLines(Optional> appliedToLines) { + public Builder appliedToLines(Optional> appliedToLines) { this.appliedToLines = appliedToLines; return this; } - public Builder appliedToLines(List appliedToLines) { + public Builder appliedToLines(List appliedToLines) { this.appliedToLines = Optional.ofNullable(appliedToLines); return this; } @@ -1139,6 +1167,7 @@ public Builder remoteFields(List remoteFields) { public PatchedPaymentRequest build() { return new PatchedPaymentRequest( + paymentUrl, transactionDate, contact, account, diff --git a/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditEndpointRequest.java new file mode 100644 index 000000000..93f86427d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditEndpointRequest.java @@ -0,0 +1,191 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedVendorCreditEndpointRequest.Builder.class) +public final class PatchedVendorCreditEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final PatchedVendorCreditRequest model; + + private final Map additionalProperties; + + private PatchedVendorCreditEndpointRequest( + Optional isDebugMode, + Optional runAsync, + PatchedVendorCreditRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public PatchedVendorCreditRequest getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedVendorCreditEndpointRequest + && equalTo((PatchedVendorCreditEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedVendorCreditEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull PatchedVendorCreditRequest model); + + Builder from(PatchedVendorCreditEndpointRequest other); + } + + public interface _FinalStage { + PatchedVendorCreditEndpointRequest build(); + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private PatchedVendorCreditRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(PatchedVendorCreditEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull PatchedVendorCreditRequest model) { + this.model = model; + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public PatchedVendorCreditEndpointRequest build() { + return new PatchedVendorCreditEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditRequest.java new file mode 100644 index 000000000..dd72fc588 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditRequest.java @@ -0,0 +1,1027 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedVendorCreditRequest.Builder.class) +public final class PatchedVendorCreditRequest { + private final Optional number; + + private final Optional transactionDate; + + private final Optional vendor; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional inclusiveOfTax; + + private final Optional company; + + private final Optional>> trackingCategories; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional vendorCreditUrl; + + private final Map additionalProperties; + + private PatchedVendorCreditRequest( + Optional number, + Optional transactionDate, + Optional vendor, + Optional currency, + Optional exchangeRate, + Optional inclusiveOfTax, + Optional company, + Optional>> trackingCategories, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional vendorCreditUrl, + Map additionalProperties) { + this.number = number; + this.transactionDate = transactionDate; + this.vendor = vendor; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.inclusiveOfTax = inclusiveOfTax; + this.company = company; + this.trackingCategories = trackingCategories; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.vendorCreditUrl = vendorCreditUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return The vendor credit's number. + */ + @JsonProperty("number") + public Optional getNumber() { + return number; + } + + /** + * @return The vendor credit's transaction date. + */ + @JsonProperty("transaction_date") + public Optional getTransactionDate() { + return transactionDate; + } + + /** + * @return The vendor that owes the gift or refund. + */ + @JsonProperty("vendor") + public Optional getVendor() { + return vendor; + } + + /** + * @return The vendor credit's currency. + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return The vendor credit's exchange rate. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. + */ + @JsonProperty("inclusive_of_tax") + public Optional getInclusiveOfTax() { + return inclusiveOfTax; + } + + /** + * @return The company the vendor credit belongs to. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + /** + * @return The 3rd party URL of the vendor credit. + */ + @JsonProperty("vendor_credit_url") + public Optional getVendorCreditUrl() { + return vendorCreditUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedVendorCreditRequest && equalTo((PatchedVendorCreditRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedVendorCreditRequest other) { + return number.equals(other.number) + && transactionDate.equals(other.transactionDate) + && vendor.equals(other.vendor) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && inclusiveOfTax.equals(other.inclusiveOfTax) + && company.equals(other.company) + && trackingCategories.equals(other.trackingCategories) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && vendorCreditUrl.equals(other.vendorCreditUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.number, + this.transactionDate, + this.vendor, + this.currency, + this.exchangeRate, + this.inclusiveOfTax, + this.company, + this.trackingCategories, + this.integrationParams, + this.linkedAccountParams, + this.vendorCreditUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional number = Optional.empty(); + + private Optional transactionDate = Optional.empty(); + + private Optional vendor = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional inclusiveOfTax = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional vendorCreditUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedVendorCreditRequest other) { + number(other.getNumber()); + transactionDate(other.getTransactionDate()); + vendor(other.getVendor()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + inclusiveOfTax(other.getInclusiveOfTax()); + company(other.getCompany()); + trackingCategories(other.getTrackingCategories()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + vendorCreditUrl(other.getVendorCreditUrl()); + return this; + } + + /** + *

    The vendor credit's number.

    + */ + @JsonSetter(value = "number", nulls = Nulls.SKIP) + public Builder number(Optional number) { + this.number = number; + return this; + } + + public Builder number(String number) { + this.number = Optional.ofNullable(number); + return this; + } + + /** + *

    The vendor credit's transaction date.

    + */ + @JsonSetter(value = "transaction_date", nulls = Nulls.SKIP) + public Builder transactionDate(Optional transactionDate) { + this.transactionDate = transactionDate; + return this; + } + + public Builder transactionDate(OffsetDateTime transactionDate) { + this.transactionDate = Optional.ofNullable(transactionDate); + return this; + } + + /** + *

    The vendor that owes the gift or refund.

    + */ + @JsonSetter(value = "vendor", nulls = Nulls.SKIP) + public Builder vendor(Optional vendor) { + this.vendor = vendor; + return this; + } + + public Builder vendor(String vendor) { + this.vendor = Optional.ofNullable(vendor); + return this; + } + + /** + *

    The vendor credit's currency.

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(PatchedVendorCreditRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    The vendor credit's exchange rate.

    + */ + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + /** + *

    If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive.

    + */ + @JsonSetter(value = "inclusive_of_tax", nulls = Nulls.SKIP) + public Builder inclusiveOfTax(Optional inclusiveOfTax) { + this.inclusiveOfTax = inclusiveOfTax; + return this; + } + + public Builder inclusiveOfTax(Boolean inclusiveOfTax) { + this.inclusiveOfTax = Optional.ofNullable(inclusiveOfTax); + return this; + } + + /** + *

    The company the vendor credit belongs to.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(String company) { + this.company = Optional.ofNullable(company); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories(Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + /** + *

    The 3rd party URL of the vendor credit.

    + */ + @JsonSetter(value = "vendor_credit_url", nulls = Nulls.SKIP) + public Builder vendorCreditUrl(Optional vendorCreditUrl) { + this.vendorCreditUrl = vendorCreditUrl; + return this; + } + + public Builder vendorCreditUrl(String vendorCreditUrl) { + this.vendorCreditUrl = Optional.ofNullable(vendorCreditUrl); + return this; + } + + public PatchedVendorCreditRequest build() { + return new PatchedVendorCreditRequest( + number, + transactionDate, + vendor, + currency, + exchangeRate, + inclusiveOfTax, + company, + trackingCategories, + integrationParams, + linkedAccountParams, + vendorCreditUrl, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestPaymentMethod.java b/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditRequestCurrency.java similarity index 69% rename from src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestPaymentMethod.java rename to src/main/java/com/merge/api/accounting/types/PatchedVendorCreditRequestCurrency.java index e81a2d022..d6638f99a 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestPaymentMethod.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedVendorCreditRequestCurrency.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = PatchedPaymentRequestPaymentMethod.Deserializer.class) -public final class PatchedPaymentRequestPaymentMethod { +@JsonDeserialize(using = PatchedVendorCreditRequestCurrency.Deserializer.class) +public final class PatchedVendorCreditRequestCurrency { private final Object value; private final int type; - private PatchedPaymentRequestPaymentMethod(Object value, int type) { + private PatchedVendorCreditRequestCurrency(Object value, int type) { this.value = value; this.type = type; } @@ -32,9 +32,9 @@ public Object get() { @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { - return visitor.visit((String) this.value); + return visitor.visit((TransactionCurrencyEnum) this.value); } else if (this.type == 1) { - return visitor.visit((PaymentMethod) this.value); + return visitor.visit((String) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -42,11 +42,11 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof PatchedPaymentRequestPaymentMethod - && equalTo((PatchedPaymentRequestPaymentMethod) other); + return other instanceof PatchedVendorCreditRequestCurrency + && equalTo((PatchedVendorCreditRequestCurrency) other); } - private boolean equalTo(PatchedPaymentRequestPaymentMethod other) { + private boolean equalTo(PatchedVendorCreditRequestCurrency other) { return value.equals(other.value); } @@ -60,35 +60,35 @@ public String toString() { return this.value.toString(); } - public static PatchedPaymentRequestPaymentMethod of(String value) { - return new PatchedPaymentRequestPaymentMethod(value, 0); + public static PatchedVendorCreditRequestCurrency of(TransactionCurrencyEnum value) { + return new PatchedVendorCreditRequestCurrency(value, 0); } - public static PatchedPaymentRequestPaymentMethod of(PaymentMethod value) { - return new PatchedPaymentRequestPaymentMethod(value, 1); + public static PatchedVendorCreditRequestCurrency of(String value) { + return new PatchedVendorCreditRequestCurrency(value, 1); } public interface Visitor { - T visit(String value); + T visit(TransactionCurrencyEnum value); - T visit(PaymentMethod value); + T visit(String value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(PatchedPaymentRequestPaymentMethod.class); + super(PatchedVendorCreditRequestCurrency.class); } @java.lang.Override - public PatchedPaymentRequestPaymentMethod deserialize(JsonParser p, DeserializationContext context) + public PatchedVendorCreditRequestCurrency deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); } catch (RuntimeException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentMethod.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/accounting/types/Payment.java b/src/main/java/com/merge/api/accounting/types/Payment.java index 6052c8114..9d2f61897 100644 --- a/src/main/java/com/merge/api/accounting/types/Payment.java +++ b/src/main/java/com/merge/api/accounting/types/Payment.java @@ -25,6 +25,8 @@ public final class Payment { private final Optional id; + private final Optional paymentUrl; + private final Optional remoteId; private final Optional createdAt; @@ -69,6 +71,7 @@ public final class Payment { private Payment( Optional id, + Optional paymentUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, @@ -91,6 +94,7 @@ private Payment( Optional> remoteFields, Map additionalProperties) { this.id = id; + this.paymentUrl = paymentUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -119,6 +123,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the payment. + */ + @JsonProperty("payment_url") + public Optional getPaymentUrl() { + return paymentUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -592,6 +604,7 @@ public Map getAdditionalProperties() { private boolean equalTo(Payment other) { return id.equals(other.id) + && paymentUrl.equals(other.paymentUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -618,6 +631,7 @@ private boolean equalTo(Payment other) { public int hashCode() { return Objects.hash( this.id, + this.paymentUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -653,6 +667,8 @@ public static Builder builder() { public static final class Builder { private Optional id = Optional.empty(); + private Optional paymentUrl = Optional.empty(); + private Optional remoteId = Optional.empty(); private Optional createdAt = Optional.empty(); @@ -700,6 +716,7 @@ private Builder() {} public Builder from(Payment other) { id(other.getId()); + paymentUrl(other.getPaymentUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -734,6 +751,20 @@ public Builder id(String id) { return this; } + /** + *

    The 3rd party URL of the payment.

    + */ + @JsonSetter(value = "payment_url", nulls = Nulls.SKIP) + public Builder paymentUrl(Optional paymentUrl) { + this.paymentUrl = paymentUrl; + return this; + } + + public Builder paymentUrl(String paymentUrl) { + this.paymentUrl = Optional.ofNullable(paymentUrl); + return this; + } + /** *

    The third-party API ID of the matching object.

    */ @@ -1317,6 +1348,7 @@ public Builder remoteFields(List remoteFields) { public Payment build() { return new Payment( id, + paymentUrl, remoteId, createdAt, modifiedAt, diff --git a/src/main/java/com/merge/api/accounting/types/PaymentMethod.java b/src/main/java/com/merge/api/accounting/types/PaymentMethod.java index 33e305ebf..f434c03e4 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentMethod.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentMethod.java @@ -26,13 +26,15 @@ public final class PaymentMethod { private final Optional id; + private final Optional paymentMethodUrl; + private final Optional remoteId; private final Optional createdAt; private final Optional modifiedAt; - private final PaymentMethodMethodType methodType; + private final Optional methodType; private final String name; @@ -48,10 +50,11 @@ public final class PaymentMethod { private PaymentMethod( Optional id, + Optional paymentMethodUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, - PaymentMethodMethodType methodType, + Optional methodType, String name, Optional isActive, Optional remoteUpdatedAt, @@ -59,6 +62,7 @@ private PaymentMethod( Optional> remoteData, Map additionalProperties) { this.id = id; + this.paymentMethodUrl = paymentMethodUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -76,6 +80,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the payment method. + */ + @JsonProperty("payment_method_url") + public Optional getPaymentMethodUrl() { + return paymentMethodUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -111,7 +123,7 @@ public Optional getModifiedAt() { * */ @JsonProperty("method_type") - public PaymentMethodMethodType getMethodType() { + public Optional getMethodType() { return methodType; } @@ -162,6 +174,7 @@ public Map getAdditionalProperties() { private boolean equalTo(PaymentMethod other) { return id.equals(other.id) + && paymentMethodUrl.equals(other.paymentMethodUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -177,6 +190,7 @@ private boolean equalTo(PaymentMethod other) { public int hashCode() { return Objects.hash( this.id, + this.paymentMethodUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -193,31 +207,17 @@ public String toString() { return ObjectMappers.stringify(this); } - public static MethodTypeStage builder() { + public static NameStage builder() { return new Builder(); } - public interface MethodTypeStage { - /** - *

    The type of the payment method.

    - *
      - *
    • CREDIT_CARD - CREDIT_CARD
    • - *
    • DEBIT_CARD - DEBIT_CARD
    • - *
    • ACH - ACH
    • - *
    • CASH - CASH
    • - *
    • CHECK - CHECK
    • - *
    - */ - NameStage methodType(@NotNull PaymentMethodMethodType methodType); - - Builder from(PaymentMethod other); - } - public interface NameStage { /** *

    The payment method’s name

    */ _FinalStage name(@NotNull String name); + + Builder from(PaymentMethod other); } public interface _FinalStage { @@ -227,6 +227,13 @@ public interface _FinalStage { _FinalStage id(String id); + /** + *

    The 3rd party URL of the payment method.

    + */ + _FinalStage paymentMethodUrl(Optional paymentMethodUrl); + + _FinalStage paymentMethodUrl(String paymentMethodUrl); + /** *

    The third-party API ID of the matching object.

    */ @@ -248,6 +255,20 @@ public interface _FinalStage { _FinalStage modifiedAt(OffsetDateTime modifiedAt); + /** + *

    The type of the payment method.

    + *
      + *
    • CREDIT_CARD - CREDIT_CARD
    • + *
    • DEBIT_CARD - DEBIT_CARD
    • + *
    • ACH - ACH
    • + *
    • CASH - CASH
    • + *
    • CHECK - CHECK
    • + *
    + */ + _FinalStage methodType(Optional methodType); + + _FinalStage methodType(PaymentMethodMethodType methodType); + /** *

    True if the payment method is active, False if not.

    */ @@ -272,9 +293,7 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements MethodTypeStage, NameStage, _FinalStage { - private PaymentMethodMethodType methodType; - + public static final class Builder implements NameStage, _FinalStage { private String name; private Optional> remoteData = Optional.empty(); @@ -285,12 +304,16 @@ public static final class Builder implements MethodTypeStage, NameStage, _FinalS private Optional isActive = Optional.empty(); + private Optional methodType = Optional.empty(); + private Optional modifiedAt = Optional.empty(); private Optional createdAt = Optional.empty(); private Optional remoteId = Optional.empty(); + private Optional paymentMethodUrl = Optional.empty(); + private Optional id = Optional.empty(); @JsonAnySetter @@ -301,6 +324,7 @@ private Builder() {} @java.lang.Override public Builder from(PaymentMethod other) { id(other.getId()); + paymentMethodUrl(other.getPaymentMethodUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -313,32 +337,6 @@ public Builder from(PaymentMethod other) { return this; } - /** - *

    The type of the payment method.

    - *
      - *
    • CREDIT_CARD - CREDIT_CARD
    • - *
    • DEBIT_CARD - DEBIT_CARD
    • - *
    • ACH - ACH
    • - *
    • CASH - CASH
    • - *
    • CHECK - CHECK
    • - *
    - *

    The type of the payment method.

    - *
      - *
    • CREDIT_CARD - CREDIT_CARD
    • - *
    • DEBIT_CARD - DEBIT_CARD
    • - *
    • ACH - ACH
    • - *
    • CASH - CASH
    • - *
    • CHECK - CHECK
    • - *
    - * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("method_type") - public NameStage methodType(@NotNull PaymentMethodMethodType methodType) { - this.methodType = methodType; - return this; - } - /** *

    The payment method’s name

    *

    The payment method’s name

    @@ -417,6 +415,40 @@ public _FinalStage isActive(Optional isActive) { return this; } + /** + *

    The type of the payment method.

    + *
      + *
    • CREDIT_CARD - CREDIT_CARD
    • + *
    • DEBIT_CARD - DEBIT_CARD
    • + *
    • ACH - ACH
    • + *
    • CASH - CASH
    • + *
    • CHECK - CHECK
    • + *
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage methodType(PaymentMethodMethodType methodType) { + this.methodType = Optional.ofNullable(methodType); + return this; + } + + /** + *

    The type of the payment method.

    + *
      + *
    • CREDIT_CARD - CREDIT_CARD
    • + *
    • DEBIT_CARD - DEBIT_CARD
    • + *
    • ACH - ACH
    • + *
    • CASH - CASH
    • + *
    • CHECK - CHECK
    • + *
    + */ + @java.lang.Override + @JsonSetter(value = "method_type", nulls = Nulls.SKIP) + public _FinalStage methodType(Optional methodType) { + this.methodType = methodType; + return this; + } + /** *

    The datetime that this object was modified by Merge.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -477,6 +509,26 @@ public _FinalStage remoteId(Optional remoteId) { return this; } + /** + *

    The 3rd party URL of the payment method.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentMethodUrl(String paymentMethodUrl) { + this.paymentMethodUrl = Optional.ofNullable(paymentMethodUrl); + return this; + } + + /** + *

    The 3rd party URL of the payment method.

    + */ + @java.lang.Override + @JsonSetter(value = "payment_method_url", nulls = Nulls.SKIP) + public _FinalStage paymentMethodUrl(Optional paymentMethodUrl) { + this.paymentMethodUrl = paymentMethodUrl; + return this; + } + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); @@ -494,6 +546,7 @@ public _FinalStage id(Optional id) { public PaymentMethod build() { return new PaymentMethod( id, + paymentMethodUrl, remoteId, createdAt, modifiedAt, diff --git a/src/main/java/com/merge/api/accounting/types/PaymentMethodsListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentMethodsListRequest.java index 3417f92b0..9cedce6ae 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentMethodsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentMethodsListRequest.java @@ -80,7 +80,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -204,7 +204,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/PaymentRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentRequest.java index 7ede2c853..1bcf5c4bf 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequest.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PaymentRequest.Builder.class) public final class PaymentRequest { + private final Optional paymentUrl; + private final Optional transactionDate; private final Optional contact; @@ -56,6 +58,7 @@ public final class PaymentRequest { private final Map additionalProperties; private PaymentRequest( + Optional paymentUrl, Optional transactionDate, Optional contact, Optional account, @@ -72,6 +75,7 @@ private PaymentRequest( Optional> linkedAccountParams, Optional> remoteFields, Map additionalProperties) { + this.paymentUrl = paymentUrl; this.transactionDate = transactionDate; this.contact = contact; this.account = account; @@ -90,6 +94,14 @@ private PaymentRequest( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the payment. + */ + @JsonProperty("payment_url") + public Optional getPaymentUrl() { + return paymentUrl; + } + /** * @return The payment's transaction date. */ @@ -522,7 +534,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(PaymentRequest other) { - return transactionDate.equals(other.transactionDate) + return paymentUrl.equals(other.paymentUrl) + && transactionDate.equals(other.transactionDate) && contact.equals(other.contact) && account.equals(other.account) && paymentMethod.equals(other.paymentMethod) @@ -542,6 +555,7 @@ private boolean equalTo(PaymentRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.paymentUrl, this.transactionDate, this.contact, this.account, @@ -570,6 +584,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional paymentUrl = Optional.empty(); + private Optional transactionDate = Optional.empty(); private Optional contact = Optional.empty(); @@ -606,6 +622,7 @@ public static final class Builder { private Builder() {} public Builder from(PaymentRequest other) { + paymentUrl(other.getPaymentUrl()); transactionDate(other.getTransactionDate()); contact(other.getContact()); account(other.getAccount()); @@ -624,6 +641,20 @@ public Builder from(PaymentRequest other) { return this; } + /** + *

    The 3rd party URL of the payment.

    + */ + @JsonSetter(value = "payment_url", nulls = Nulls.SKIP) + public Builder paymentUrl(Optional paymentUrl) { + this.paymentUrl = paymentUrl; + return this; + } + + public Builder paymentUrl(String paymentUrl) { + this.paymentUrl = Optional.ofNullable(paymentUrl); + return this; + } + /** *

    The payment's transaction date.

    */ @@ -1137,6 +1168,7 @@ public Builder remoteFields(List remoteFields) { public PaymentRequest build() { return new PaymentRequest( + paymentUrl, transactionDate, contact, account, diff --git a/src/main/java/com/merge/api/accounting/types/PaymentRequestAppliedToLinesItem.java b/src/main/java/com/merge/api/accounting/types/PaymentRequestAppliedToLinesItem.java index a0922fca6..32ebda9f3 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentRequestAppliedToLinesItem.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequestAppliedToLinesItem.java @@ -34,7 +34,7 @@ public T visit(Visitor visitor) { if (this.type == 0) { return visitor.visit((String) this.value); } else if (this.type == 1) { - return visitor.visit((PaymentLineItemRequest) this.value); + return visitor.visit((PaymentLineItem) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -63,14 +63,14 @@ public static PaymentRequestAppliedToLinesItem of(String value) { return new PaymentRequestAppliedToLinesItem(value, 0); } - public static PaymentRequestAppliedToLinesItem of(PaymentLineItemRequest value) { + public static PaymentRequestAppliedToLinesItem of(PaymentLineItem value) { return new PaymentRequestAppliedToLinesItem(value, 1); } public interface Visitor { T visit(String value); - T visit(PaymentLineItemRequest value); + T visit(PaymentLineItem value); } static final class Deserializer extends StdDeserializer { @@ -87,7 +87,7 @@ public PaymentRequestAppliedToLinesItem deserialize(JsonParser p, Deserializatio } catch (RuntimeException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentLineItemRequest.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentLineItem.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTerm.java b/src/main/java/com/merge/api/accounting/types/PaymentTerm.java index e4abee539..d624cbd9d 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentTerm.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentTerm.java @@ -26,6 +26,8 @@ public final class PaymentTerm { private final Optional id; + private final Optional paymentTermUrl; + private final Optional remoteId; private final Optional createdAt; @@ -52,6 +54,7 @@ public final class PaymentTerm { private PaymentTerm( Optional id, + Optional paymentTermUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, @@ -65,6 +68,7 @@ private PaymentTerm( Optional> remoteData, Map additionalProperties) { this.id = id; + this.paymentTermUrl = paymentTermUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -84,6 +88,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the payment term. + */ + @JsonProperty("payment_term_url") + public Optional getPaymentTermUrl() { + return paymentTermUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -179,6 +191,7 @@ public Map getAdditionalProperties() { private boolean equalTo(PaymentTerm other) { return id.equals(other.id) + && paymentTermUrl.equals(other.paymentTermUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -196,6 +209,7 @@ private boolean equalTo(PaymentTerm other) { public int hashCode() { return Objects.hash( this.id, + this.paymentTermUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -234,6 +248,13 @@ public interface _FinalStage { _FinalStage id(String id); + /** + *

    The 3rd party URL of the payment term.

    + */ + _FinalStage paymentTermUrl(Optional paymentTermUrl); + + _FinalStage paymentTermUrl(String paymentTermUrl); + /** *

    The third-party API ID of the matching object.

    */ @@ -323,6 +344,8 @@ public static final class Builder implements NameStage, _FinalStage { private Optional remoteId = Optional.empty(); + private Optional paymentTermUrl = Optional.empty(); + private Optional id = Optional.empty(); @JsonAnySetter @@ -333,6 +356,7 @@ private Builder() {} @java.lang.Override public Builder from(PaymentTerm other) { id(other.getId()); + paymentTermUrl(other.getPaymentTermUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -545,6 +569,26 @@ public _FinalStage remoteId(Optional remoteId) { return this; } + /** + *

    The 3rd party URL of the payment term.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentTermUrl(String paymentTermUrl) { + this.paymentTermUrl = Optional.ofNullable(paymentTermUrl); + return this; + } + + /** + *

    The 3rd party URL of the payment term.

    + */ + @java.lang.Override + @JsonSetter(value = "payment_term_url", nulls = Nulls.SKIP) + public _FinalStage paymentTermUrl(Optional paymentTermUrl) { + this.paymentTermUrl = paymentTermUrl; + return this; + } + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); @@ -562,6 +606,7 @@ public _FinalStage id(Optional id) { public PaymentTerm build() { return new PaymentTerm( id, + paymentTermUrl, remoteId, createdAt, modifiedAt, diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java index c53bc58b6..3d37c443b 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java @@ -94,7 +94,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -246,7 +246,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/PaymentsLineItemsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentsLineItemsRemoteFieldClassesListRequest.java index c27d272e5..9974d8595 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentsLineItemsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentsLineItemsRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/PaymentsListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentsListRequest.java index fe03a01ca..fe1cc8d1b 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentsListRequest.java @@ -203,7 +203,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -546,7 +546,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java index 2da781632..880f30a15 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/Project.java b/src/main/java/com/merge/api/accounting/types/Project.java index 2f4410989..5ad501f9f 100644 --- a/src/main/java/com/merge/api/accounting/types/Project.java +++ b/src/main/java/com/merge/api/accounting/types/Project.java @@ -26,6 +26,8 @@ public final class Project { private final Optional id; + private final Optional projectUrl; + private final Optional remoteId; private final Optional createdAt; @@ -48,6 +50,7 @@ public final class Project { private Project( Optional id, + Optional projectUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, @@ -59,6 +62,7 @@ private Project( Optional> remoteData, Map additionalProperties) { this.id = id; + this.projectUrl = projectUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -76,6 +80,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the project. + */ + @JsonProperty("project_url") + public Optional getProjectUrl() { + return projectUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -155,6 +167,7 @@ public Map getAdditionalProperties() { private boolean equalTo(Project other) { return id.equals(other.id) + && projectUrl.equals(other.projectUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -170,6 +183,7 @@ private boolean equalTo(Project other) { public int hashCode() { return Objects.hash( this.id, + this.projectUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -206,6 +220,13 @@ public interface _FinalStage { _FinalStage id(String id); + /** + *

    The 3rd party URL of the project.

    + */ + _FinalStage projectUrl(Optional projectUrl); + + _FinalStage projectUrl(String projectUrl); + /** *

    The third-party API ID of the matching object.

    */ @@ -277,6 +298,8 @@ public static final class Builder implements NameStage, _FinalStage { private Optional remoteId = Optional.empty(); + private Optional projectUrl = Optional.empty(); + private Optional id = Optional.empty(); @JsonAnySetter @@ -287,6 +310,7 @@ private Builder() {} @java.lang.Override public Builder from(Project other) { id(other.getId()); + projectUrl(other.getProjectUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -457,6 +481,26 @@ public _FinalStage remoteId(Optional remoteId) { return this; } + /** + *

    The 3rd party URL of the project.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage projectUrl(String projectUrl) { + this.projectUrl = Optional.ofNullable(projectUrl); + return this; + } + + /** + *

    The 3rd party URL of the project.

    + */ + @java.lang.Override + @JsonSetter(value = "project_url", nulls = Nulls.SKIP) + public _FinalStage projectUrl(Optional projectUrl) { + this.projectUrl = projectUrl; + return this; + } + @java.lang.Override public _FinalStage id(String id) { this.id = Optional.ofNullable(id); @@ -474,6 +518,7 @@ public _FinalStage id(Optional id) { public Project build() { return new Project( id, + projectUrl, remoteId, createdAt, modifiedAt, diff --git a/src/main/java/com/merge/api/accounting/types/ProjectsListRequest.java b/src/main/java/com/merge/api/accounting/types/ProjectsListRequest.java index dcac2268d..4536da337 100644 --- a/src/main/java/com/merge/api/accounting/types/ProjectsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ProjectsListRequest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -24,6 +25,12 @@ public final class ProjectsListRequest { private final Optional> expand; + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + private final Optional cursor; private final Optional includeDeletedData; @@ -32,24 +39,46 @@ public final class ProjectsListRequest { private final Optional includeShellData; + private final Optional isActive; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + private final Optional pageSize; + private final Optional remoteId; + private final Map additionalProperties; private ProjectsListRequest( Optional> expand, + Optional companyId, + Optional createdAfter, + Optional createdBefore, Optional cursor, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, + Optional isActive, + Optional modifiedAfter, + Optional modifiedBefore, Optional pageSize, + Optional remoteId, Map additionalProperties) { this.expand = expand; + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; this.cursor = cursor; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; + this.isActive = isActive; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; this.pageSize = pageSize; + this.remoteId = remoteId; this.additionalProperties = additionalProperties; } @@ -61,6 +90,30 @@ public Optional> getExpand() { return expand; } + /** + * @return If provided, will only return projects for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + /** * @return The pagination cursor value. */ @@ -94,13 +147,45 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return If provided, will only return projects with this value for is_active. + */ + @JsonProperty("is_active") + public Optional getIsActive() { + return isActive; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { return pageSize; } + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -114,22 +199,36 @@ public Map getAdditionalProperties() { private boolean equalTo(ProjectsListRequest other) { return expand.equals(other.expand) + && companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) - && pageSize.equals(other.pageSize); + && isActive.equals(other.isActive) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); } @java.lang.Override public int hashCode() { return Objects.hash( this.expand, + this.companyId, + this.createdAfter, + this.createdBefore, this.cursor, this.includeDeletedData, this.includeRemoteData, this.includeShellData, - this.pageSize); + this.isActive, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); } @java.lang.Override @@ -145,6 +244,12 @@ public static Builder builder() { public static final class Builder { private Optional> expand = Optional.empty(); + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + private Optional cursor = Optional.empty(); private Optional includeDeletedData = Optional.empty(); @@ -153,8 +258,16 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); + private Optional isActive = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + private Optional pageSize = Optional.empty(); + private Optional remoteId = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -162,11 +275,18 @@ private Builder() {} public Builder from(ProjectsListRequest other) { expand(other.getExpand()); + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); + isActive(other.getIsActive()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); return this; } @@ -189,6 +309,48 @@ public Builder expand(ProjectsListRequestExpandItem expand) { return this; } + /** + *

    If provided, will only return projects for this company.

    + */ + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + /** *

    The pagination cursor value.

    */ @@ -246,7 +408,49 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

    Number of results to return per page.

    + *

    If provided, will only return projects with this value for is_active.

    + */ + @JsonSetter(value = "is_active", nulls = Nulls.SKIP) + public Builder isActive(Optional isActive) { + this.isActive = isActive; + return this; + } + + public Builder isActive(String isActive) { + this.isActive = Optional.ofNullable(isActive); + return this; + } + + /** + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -259,14 +463,35 @@ public Builder pageSize(Integer pageSize) { return this; } + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + public ProjectsListRequest build() { return new ProjectsListRequest( expand, + companyId, + createdAfter, + createdBefore, cursor, includeDeletedData, includeRemoteData, includeShellData, + isActive, + modifiedAfter, + modifiedBefore, pageSize, + remoteId, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java index 81bb65dd7..489ff97e3 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java @@ -25,6 +25,8 @@ public final class PurchaseOrder { private final Optional id; + private final Optional purchaseOrderUrl; + private final Optional remoteId; private final Optional createdAt; @@ -57,7 +59,7 @@ public final class PurchaseOrder { private final Optional paymentTerm; - private final Optional> lineItems; + private final Optional> lineItems; private final Optional inclusiveOfTax; @@ -81,6 +83,7 @@ public final class PurchaseOrder { private PurchaseOrder( Optional id, + Optional purchaseOrderUrl, Optional remoteId, Optional createdAt, Optional modifiedAt, @@ -97,7 +100,7 @@ private PurchaseOrder( Optional currency, Optional exchangeRate, Optional paymentTerm, - Optional> lineItems, + Optional> lineItems, Optional inclusiveOfTax, Optional>> trackingCategories, Optional accountingPeriod, @@ -109,6 +112,7 @@ private PurchaseOrder( Optional> remoteFields, Map additionalProperties) { this.id = id; + this.purchaseOrderUrl = purchaseOrderUrl; this.remoteId = remoteId; this.createdAt = createdAt; this.modifiedAt = modifiedAt; @@ -143,6 +147,14 @@ public Optional getId() { return id; } + /** + * @return The 3rd party URL of the purchase order. + */ + @JsonProperty("purchase_order_url") + public Optional getPurchaseOrderUrl() { + return purchaseOrderUrl; + } + /** * @return The third-party API ID of the matching object. */ @@ -587,7 +599,7 @@ public Optional getPaymentTerm() { } @JsonProperty("line_items") - public Optional> getLineItems() { + public Optional> getLineItems() { return lineItems; } @@ -664,6 +676,7 @@ public Map getAdditionalProperties() { private boolean equalTo(PurchaseOrder other) { return id.equals(other.id) + && purchaseOrderUrl.equals(other.purchaseOrderUrl) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -696,6 +709,7 @@ private boolean equalTo(PurchaseOrder other) { public int hashCode() { return Objects.hash( this.id, + this.purchaseOrderUrl, this.remoteId, this.createdAt, this.modifiedAt, @@ -737,6 +751,8 @@ public static Builder builder() { public static final class Builder { private Optional id = Optional.empty(); + private Optional purchaseOrderUrl = Optional.empty(); + private Optional remoteId = Optional.empty(); private Optional createdAt = Optional.empty(); @@ -769,7 +785,7 @@ public static final class Builder { private Optional paymentTerm = Optional.empty(); - private Optional> lineItems = Optional.empty(); + private Optional> lineItems = Optional.empty(); private Optional inclusiveOfTax = Optional.empty(); @@ -796,6 +812,7 @@ private Builder() {} public Builder from(PurchaseOrder other) { id(other.getId()); + purchaseOrderUrl(other.getPurchaseOrderUrl()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); modifiedAt(other.getModifiedAt()); @@ -836,6 +853,20 @@ public Builder id(String id) { return this; } + /** + *

    The 3rd party URL of the purchase order.

    + */ + @JsonSetter(value = "purchase_order_url", nulls = Nulls.SKIP) + public Builder purchaseOrderUrl(Optional purchaseOrderUrl) { + this.purchaseOrderUrl = purchaseOrderUrl; + return this; + } + + public Builder purchaseOrderUrl(String purchaseOrderUrl) { + this.purchaseOrderUrl = Optional.ofNullable(purchaseOrderUrl); + return this; + } + /** *

    The third-party API ID of the matching object.

    */ @@ -1376,12 +1407,12 @@ public Builder paymentTerm(PurchaseOrderPaymentTerm paymentTerm) { } @JsonSetter(value = "line_items", nulls = Nulls.SKIP) - public Builder lineItems(Optional> lineItems) { + public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; return this; } - public Builder lineItems(List lineItems) { + public Builder lineItems(List lineItems) { this.lineItems = Optional.ofNullable(lineItems); return this; } @@ -1504,6 +1535,7 @@ public Builder remoteFields(List remoteFields) { public PurchaseOrder build() { return new PurchaseOrder( id, + purchaseOrderUrl, remoteId, createdAt, modifiedAt, diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemsItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemsItem.java new file mode 100644 index 000000000..7bd961d19 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderLineItemsItem.Deserializer.class) +public final class PurchaseOrderLineItemsItem { + private final Object value; + + private final int type; + + private PurchaseOrderLineItemsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PurchaseOrderLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderLineItemsItem && equalTo((PurchaseOrderLineItemsItem) other); + } + + private boolean equalTo(PurchaseOrderLineItemsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderLineItemsItem of(String value) { + return new PurchaseOrderLineItemsItem(value, 0); + } + + public static PurchaseOrderLineItemsItem of(PurchaseOrderLineItem value) { + return new PurchaseOrderLineItemsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PurchaseOrderLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderLineItemsItem.class); + } + + @java.lang.Override + public PurchaseOrderLineItemsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PurchaseOrderLineItem.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java index f0f9afb9b..ba34e8ff6 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java @@ -51,7 +51,7 @@ public final class PurchaseOrderRequest { private final Optional>> trackingCategories; - private final Optional> lineItems; + private final Optional> lineItems; private final Optional> integrationParams; @@ -76,7 +76,7 @@ private PurchaseOrderRequest( Optional inclusiveOfTax, Optional exchangeRate, Optional>> trackingCategories, - Optional> lineItems, + Optional> lineItems, Optional> integrationParams, Optional> linkedAccountParams, Optional> remoteFields, @@ -527,7 +527,7 @@ public Optional>> getT } @JsonProperty("line_items") - public Optional> getLineItems() { + public Optional> getLineItems() { return lineItems; } @@ -641,7 +641,7 @@ public static final class Builder { private Optional>> trackingCategories = Optional.empty(); - private Optional> lineItems = Optional.empty(); + private Optional> lineItems = Optional.empty(); private Optional> integrationParams = Optional.empty(); @@ -1187,12 +1187,12 @@ public Builder trackingCategories( } @JsonSetter(value = "line_items", nulls = Nulls.SKIP) - public Builder lineItems(Optional> lineItems) { + public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; return this; } - public Builder lineItems(List lineItems) { + public Builder lineItems(List lineItems) { this.lineItems = Optional.ofNullable(lineItems); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestLineItemsItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestLineItemsItem.java new file mode 100644 index 000000000..f2e824987 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequestLineItemsItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PurchaseOrderRequestLineItemsItem.Deserializer.class) +public final class PurchaseOrderRequestLineItemsItem { + private final Object value; + + private final int type; + + private PurchaseOrderRequestLineItemsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PurchaseOrderLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PurchaseOrderRequestLineItemsItem && equalTo((PurchaseOrderRequestLineItemsItem) other); + } + + private boolean equalTo(PurchaseOrderRequestLineItemsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PurchaseOrderRequestLineItemsItem of(String value) { + return new PurchaseOrderRequestLineItemsItem(value, 0); + } + + public static PurchaseOrderRequestLineItemsItem of(PurchaseOrderLineItem value) { + return new PurchaseOrderRequestLineItemsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PurchaseOrderLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PurchaseOrderRequestLineItemsItem.class); + } + + @java.lang.Override + public PurchaseOrderRequestLineItemsItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PurchaseOrderLineItem.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java index 0ab86e22b..99e1a472b 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java index 85f19b254..0838bcaeb 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java @@ -203,7 +203,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -546,7 +546,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java index b97aa8c73..a8da399f6 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java @@ -104,7 +104,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -271,7 +271,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/accounting/types/RegenerateAccountToken.java new file mode 100644 index 000000000..3b4be8fca --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteData.java b/src/main/java/com/merge/api/accounting/types/RemoteData.java index aae8477b5..39b391c0d 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteData.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteData.java @@ -42,6 +42,9 @@ public String getPath() { return path; } + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ @JsonProperty("data") public Optional getData() { return data; @@ -88,6 +91,9 @@ public interface PathStage { public interface _FinalStage { RemoteData build(); + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ _FinalStage data(Optional data); _FinalStage data(JsonNode data); @@ -123,12 +129,19 @@ public _FinalStage path(@NotNull String path) { return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage data(JsonNode data) { this.data = Optional.ofNullable(data); return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional data) { diff --git a/src/main/java/com/merge/api/accounting/types/RemoteField.java b/src/main/java/com/merge/api/accounting/types/RemoteField.java index 33c69744c..be58c7c53 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteField.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteField.java @@ -22,23 +22,21 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RemoteField.Builder.class) public final class RemoteField { - private final RemoteFieldRemoteFieldClass remoteFieldClass; + private final RemoteFieldClass remoteFieldClass; private final Optional value; private final Map additionalProperties; private RemoteField( - RemoteFieldRemoteFieldClass remoteFieldClass, - Optional value, - Map additionalProperties) { + RemoteFieldClass remoteFieldClass, Optional value, Map additionalProperties) { this.remoteFieldClass = remoteFieldClass; this.value = value; this.additionalProperties = additionalProperties; } @JsonProperty("remote_field_class") - public RemoteFieldRemoteFieldClass getRemoteFieldClass() { + public RemoteFieldClass getRemoteFieldClass() { return remoteFieldClass; } @@ -77,7 +75,7 @@ public static RemoteFieldClassStage builder() { } public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass); + _FinalStage remoteFieldClass(@NotNull RemoteFieldClass remoteFieldClass); Builder from(RemoteField other); } @@ -92,7 +90,7 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldRemoteFieldClass remoteFieldClass; + private RemoteFieldClass remoteFieldClass; private Optional value = Optional.empty(); @@ -110,7 +108,7 @@ public Builder from(RemoteField other) { @java.lang.Override @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteFieldClass) { + public _FinalStage remoteFieldClass(@NotNull RemoteFieldClass remoteFieldClass) { this.remoteFieldClass = remoteFieldClass; return this; } diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldApiResponse.java index 24f9d365a..b96acd3b3 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteFieldApiResponse.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldApiResponse.java @@ -41,6 +41,12 @@ public final class RemoteFieldApiResponse { private final Optional> purchaseOrder; + private final Optional> salesOrder; + + private final Optional> itemFulfillment; + + private final Optional> expenseReport; + private final Optional> trackingCategory; private final Optional> journalEntry; @@ -84,6 +90,9 @@ private RemoteFieldApiResponse( Optional> creditNote, Optional> item, Optional> purchaseOrder, + Optional> salesOrder, + Optional> itemFulfillment, + Optional> expenseReport, Optional> trackingCategory, Optional> journalEntry, Optional> taxRate, @@ -110,6 +119,9 @@ private RemoteFieldApiResponse( this.creditNote = creditNote; this.item = item; this.purchaseOrder = purchaseOrder; + this.salesOrder = salesOrder; + this.itemFulfillment = itemFulfillment; + this.expenseReport = expenseReport; this.trackingCategory = trackingCategory; this.journalEntry = journalEntry; this.taxRate = taxRate; @@ -178,6 +190,21 @@ public Optional> getPurchaseOrder() { return purchaseOrder; } + @JsonProperty("SalesOrder") + public Optional> getSalesOrder() { + return salesOrder; + } + + @JsonProperty("ItemFulfillment") + public Optional> getItemFulfillment() { + return itemFulfillment; + } + + @JsonProperty("ExpenseReport") + public Optional> getExpenseReport() { + return expenseReport; + } + @JsonProperty("TrackingCategory") public Optional> getTrackingCategory() { return trackingCategory; @@ -275,6 +302,9 @@ private boolean equalTo(RemoteFieldApiResponse other) { && creditNote.equals(other.creditNote) && item.equals(other.item) && purchaseOrder.equals(other.purchaseOrder) + && salesOrder.equals(other.salesOrder) + && itemFulfillment.equals(other.itemFulfillment) + && expenseReport.equals(other.expenseReport) && trackingCategory.equals(other.trackingCategory) && journalEntry.equals(other.journalEntry) && taxRate.equals(other.taxRate) @@ -305,6 +335,9 @@ public int hashCode() { this.creditNote, this.item, this.purchaseOrder, + this.salesOrder, + this.itemFulfillment, + this.expenseReport, this.trackingCategory, this.journalEntry, this.taxRate, @@ -353,6 +386,12 @@ public static final class Builder { private Optional> purchaseOrder = Optional.empty(); + private Optional> salesOrder = Optional.empty(); + + private Optional> itemFulfillment = Optional.empty(); + + private Optional> expenseReport = Optional.empty(); + private Optional> trackingCategory = Optional.empty(); private Optional> journalEntry = Optional.empty(); @@ -399,6 +438,9 @@ public Builder from(RemoteFieldApiResponse other) { creditNote(other.getCreditNote()); item(other.getItem()); purchaseOrder(other.getPurchaseOrder()); + salesOrder(other.getSalesOrder()); + itemFulfillment(other.getItemFulfillment()); + expenseReport(other.getExpenseReport()); trackingCategory(other.getTrackingCategory()); journalEntry(other.getJournalEntry()); taxRate(other.getTaxRate()); @@ -527,6 +569,39 @@ public Builder purchaseOrder(List purchaseOrder) { return this; } + @JsonSetter(value = "SalesOrder", nulls = Nulls.SKIP) + public Builder salesOrder(Optional> salesOrder) { + this.salesOrder = salesOrder; + return this; + } + + public Builder salesOrder(List salesOrder) { + this.salesOrder = Optional.ofNullable(salesOrder); + return this; + } + + @JsonSetter(value = "ItemFulfillment", nulls = Nulls.SKIP) + public Builder itemFulfillment(Optional> itemFulfillment) { + this.itemFulfillment = itemFulfillment; + return this; + } + + public Builder itemFulfillment(List itemFulfillment) { + this.itemFulfillment = Optional.ofNullable(itemFulfillment); + return this; + } + + @JsonSetter(value = "ExpenseReport", nulls = Nulls.SKIP) + public Builder expenseReport(Optional> expenseReport) { + this.expenseReport = expenseReport; + return this; + } + + public Builder expenseReport(List expenseReport) { + this.expenseReport = Optional.ofNullable(expenseReport); + return this; + } + @JsonSetter(value = "TrackingCategory", nulls = Nulls.SKIP) public Builder trackingCategory(Optional> trackingCategory) { this.trackingCategory = trackingCategory; @@ -704,6 +779,9 @@ public RemoteFieldApiResponse build() { creditNote, item, purchaseOrder, + salesOrder, + itemFulfillment, + expenseReport, trackingCategory, journalEntry, taxRate, diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldClass.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldClass.java index ed21f7a96..9ccb5f9c4 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteFieldClass.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldClass.java @@ -31,6 +31,8 @@ public final class RemoteFieldClass { private final Optional isCustom; + private final Optional isCommonModelField; + private final Optional isRequired; private final Optional fieldType; @@ -49,6 +51,7 @@ private RemoteFieldClass( Optional remoteKeyName, Optional description, Optional isCustom, + Optional isCommonModelField, Optional isRequired, Optional fieldType, Optional fieldFormat, @@ -60,6 +63,7 @@ private RemoteFieldClass( this.remoteKeyName = remoteKeyName; this.description = description; this.isCustom = isCustom; + this.isCommonModelField = isCommonModelField; this.isRequired = isRequired; this.fieldType = fieldType; this.fieldFormat = fieldFormat; @@ -93,6 +97,11 @@ public Optional getIsCustom() { return isCustom; } + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + @JsonProperty("is_required") public Optional getIsRequired() { return isRequired; @@ -135,6 +144,7 @@ private boolean equalTo(RemoteFieldClass other) { && remoteKeyName.equals(other.remoteKeyName) && description.equals(other.description) && isCustom.equals(other.isCustom) + && isCommonModelField.equals(other.isCommonModelField) && isRequired.equals(other.isRequired) && fieldType.equals(other.fieldType) && fieldFormat.equals(other.fieldFormat) @@ -150,6 +160,7 @@ public int hashCode() { this.remoteKeyName, this.description, this.isCustom, + this.isCommonModelField, this.isRequired, this.fieldType, this.fieldFormat, @@ -178,6 +189,8 @@ public static final class Builder { private Optional isCustom = Optional.empty(); + private Optional isCommonModelField = Optional.empty(); + private Optional isRequired = Optional.empty(); private Optional fieldType = Optional.empty(); @@ -199,6 +212,7 @@ public Builder from(RemoteFieldClass other) { remoteKeyName(other.getRemoteKeyName()); description(other.getDescription()); isCustom(other.getIsCustom()); + isCommonModelField(other.getIsCommonModelField()); isRequired(other.getIsRequired()); fieldType(other.getFieldType()); fieldFormat(other.getFieldFormat()); @@ -262,6 +276,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) public Builder isRequired(Optional isRequired) { this.isRequired = isRequired; @@ -324,6 +349,7 @@ public RemoteFieldClass build() { remoteKeyName, description, isCustom, + isCommonModelField, isRequired, fieldType, fieldFormat, diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java index c4f4f85d8..cbcf05ab1 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java @@ -22,23 +22,21 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = RemoteFieldRequest.Builder.class) public final class RemoteFieldRequest { - private final RemoteFieldRequestRemoteFieldClass remoteFieldClass; + private final String remoteFieldClass; private final Optional value; private final Map additionalProperties; private RemoteFieldRequest( - RemoteFieldRequestRemoteFieldClass remoteFieldClass, - Optional value, - Map additionalProperties) { + String remoteFieldClass, Optional value, Map additionalProperties) { this.remoteFieldClass = remoteFieldClass; this.value = value; this.additionalProperties = additionalProperties; } @JsonProperty("remote_field_class") - public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { + public String getRemoteFieldClass() { return remoteFieldClass; } @@ -77,7 +75,7 @@ public static RemoteFieldClassStage builder() { } public interface RemoteFieldClassStage { - _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass); + _FinalStage remoteFieldClass(@NotNull String remoteFieldClass); Builder from(RemoteFieldRequest other); } @@ -92,7 +90,7 @@ public interface _FinalStage { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements RemoteFieldClassStage, _FinalStage { - private RemoteFieldRequestRemoteFieldClass remoteFieldClass; + private String remoteFieldClass; private Optional value = Optional.empty(); @@ -110,7 +108,7 @@ public Builder from(RemoteFieldRequest other) { @java.lang.Override @JsonSetter("remote_field_class") - public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass remoteFieldClass) { + public _FinalStage remoteFieldClass(@NotNull String remoteFieldClass) { this.remoteFieldClass = remoteFieldClass; return this; } diff --git a/src/main/java/com/merge/api/accounting/types/RemoteResponse.java b/src/main/java/com/merge/api/accounting/types/RemoteResponse.java index 566d94c3e..7b3d45c6a 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteResponse.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteResponse.java @@ -32,7 +32,7 @@ public final class RemoteResponse { private final Optional> responseHeaders; - private final Optional responseType; + private final Optional responseType; private final Optional> headers; @@ -44,7 +44,7 @@ private RemoteResponse( int status, JsonNode response, Optional> responseHeaders, - Optional responseType, + Optional responseType, Optional> headers, Map additionalProperties) { this.method = method; @@ -83,7 +83,7 @@ public Optional> getResponseHeaders() { } @JsonProperty("response_type") - public Optional getResponseType() { + public Optional getResponseType() { return responseType; } @@ -159,9 +159,9 @@ public interface _FinalStage { _FinalStage responseHeaders(Map responseHeaders); - _FinalStage responseType(Optional responseType); + _FinalStage responseType(Optional responseType); - _FinalStage responseType(ResponseTypeEnum responseType); + _FinalStage responseType(RemoteResponseResponseType responseType); _FinalStage headers(Optional> headers); @@ -180,7 +180,7 @@ public static final class Builder implements MethodStage, PathStage, StatusStage private Optional> headers = Optional.empty(); - private Optional responseType = Optional.empty(); + private Optional responseType = Optional.empty(); private Optional> responseHeaders = Optional.empty(); @@ -243,14 +243,14 @@ public _FinalStage headers(Optional> headers) { } @java.lang.Override - public _FinalStage responseType(ResponseTypeEnum responseType) { + public _FinalStage responseType(RemoteResponseResponseType responseType) { this.responseType = Optional.ofNullable(responseType); return this; } @java.lang.Override @JsonSetter(value = "response_type", nulls = Nulls.SKIP) - public _FinalStage responseType(Optional responseType) { + public _FinalStage responseType(Optional responseType) { this.responseType = responseType; return this; } diff --git a/src/main/java/com/merge/api/accounting/types/RemoteResponseResponseType.java b/src/main/java/com/merge/api/accounting/types/RemoteResponseResponseType.java new file mode 100644 index 000000000..10a7f28c1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/RemoteResponseResponseType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteResponseResponseType.Deserializer.class) +public final class RemoteResponseResponseType { + private final Object value; + + private final int type; + + private RemoteResponseResponseType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ResponseTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponseResponseType && equalTo((RemoteResponseResponseType) other); + } + + private boolean equalTo(RemoteResponseResponseType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteResponseResponseType of(ResponseTypeEnum value) { + return new RemoteResponseResponseType(value, 0); + } + + public static RemoteResponseResponseType of(String value) { + return new RemoteResponseResponseType(value, 1); + } + + public interface Visitor { + T visit(ResponseTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteResponseResponseType.class); + } + + @java.lang.Override + public RemoteResponseResponseType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ResponseTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ReportItem.java b/src/main/java/com/merge/api/accounting/types/ReportItem.java index 2bb3861b5..af2736667 100644 --- a/src/main/java/com/merge/api/accounting/types/ReportItem.java +++ b/src/main/java/com/merge/api/accounting/types/ReportItem.java @@ -15,7 +15,6 @@ import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -33,7 +32,7 @@ public final class ReportItem { private final Optional value; - private final Optional>> subItems; + private final Optional> subItems; private final Optional company; @@ -47,7 +46,7 @@ private ReportItem( Optional modifiedAt, Optional name, Optional value, - Optional>> subItems, + Optional> subItems, Optional company, Optional remoteWasDeleted, Map additionalProperties) { @@ -103,7 +102,7 @@ public Optional getValue() { } @JsonProperty("sub_items") - public Optional>> getSubItems() { + public Optional> getSubItems() { return subItems; } @@ -179,7 +178,7 @@ public static final class Builder { private Optional value = Optional.empty(); - private Optional>> subItems = Optional.empty(); + private Optional> subItems = Optional.empty(); private Optional company = Optional.empty(); @@ -273,12 +272,12 @@ public Builder value(Double value) { } @JsonSetter(value = "sub_items", nulls = Nulls.SKIP) - public Builder subItems(Optional>> subItems) { + public Builder subItems(Optional> subItems) { this.subItems = subItems; return this; } - public Builder subItems(List> subItems) { + public Builder subItems(Map subItems) { this.subItems = Optional.ofNullable(subItems); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/RoleEnum.java b/src/main/java/com/merge/api/accounting/types/RoleEnum.java index f8971d919..096de562f 100644 --- a/src/main/java/com/merge/api/accounting/types/RoleEnum.java +++ b/src/main/java/com/merge/api/accounting/types/RoleEnum.java @@ -17,6 +17,8 @@ public final class RoleEnum { public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); private final Value value; @@ -60,6 +62,8 @@ public T visit(Visitor visitor) { return visitor.visitMember(); case SYSTEM: return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); case ADMIN: return visitor.visitAdmin(); case UNKNOWN: @@ -81,6 +85,8 @@ public static RoleEnum valueOf(String value) { return MEMBER; case "SYSTEM": return SYSTEM; + case "SUPPORT": + return SUPPORT; case "ADMIN": return ADMIN; default: @@ -101,6 +107,8 @@ public enum Value { MERGE_TEAM, + SUPPORT, + UNKNOWN } @@ -117,6 +125,8 @@ public interface Visitor { T visitMergeTeam(); + T visitSupport(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrder.java b/src/main/java/com/merge/api/accounting/types/SalesOrder.java new file mode 100644 index 000000000..9e9999f04 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrder.java @@ -0,0 +1,1442 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrder.Builder.class) +public final class SalesOrder { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional customer; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional salesOrderUrl; + + private final Optional status; + + private final Optional paymentTerm; + + private final Optional memo; + + private final Optional shippingAddress; + + private final Optional>> trackingCategories; + + private final Optional issueDate; + + private final Optional transactionNumber; + + private final Optional total; + + private final Optional> lines; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Optional> remoteData; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private SalesOrder( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional customer, + Optional currency, + Optional exchangeRate, + Optional company, + Optional salesOrderUrl, + Optional status, + Optional paymentTerm, + Optional memo, + Optional shippingAddress, + Optional>> trackingCategories, + Optional issueDate, + Optional transactionNumber, + Optional total, + Optional> lines, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> fieldMappings, + Optional> remoteData, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.customer = customer; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.salesOrderUrl = salesOrderUrl; + this.status = status; + this.paymentTerm = paymentTerm; + this.memo = memo; + this.shippingAddress = shippingAddress; + this.trackingCategories = trackingCategories; + this.issueDate = issueDate; + this.transactionNumber = transactionNumber; + this.total = total; + this.lines = lines; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The customer associated with the sales order. + */ + @JsonProperty("customer") + public Optional getCustomer() { + return customer; + } + + /** + * @return The currency code for the order. + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return The exchange rate applied if the order currency differs from the base currency. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The subsidiary associated with the order. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The 3rd party URL of the sales order. + */ + @JsonProperty("sales_order_url") + public Optional getSalesOrderUrl() { + return salesOrderUrl; + } + + /** + * @return The status of the sales order. + *
      + *
    • DRAFT - DRAFT
    • + *
    • PENDING_APPROVAL - PENDING_APPROVAL
    • + *
    • OPEN - OPEN
    • + *
    • PARTIALLY_COMPLETED - PARTIALLY_COMPLETED
    • + *
    • COMPLETED - COMPLETED
    • + *
    • CLOSED - CLOSED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The payment terms applied to this order. + */ + @JsonProperty("payment_term") + public Optional getPaymentTerm() { + return paymentTerm; + } + + /** + * @return Notes or comments attached to the order. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The shipping address for the order. + */ + @JsonProperty("shipping_address") + public Optional getShippingAddress() { + return shippingAddress; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The date the sales order was issued. + */ + @JsonProperty("issue_date") + public Optional getIssueDate() { + return issueDate; + } + + /** + * @return The human-readable sales order number or transaction reference. + */ + @JsonProperty("transaction_number") + public Optional getTransactionNumber() { + return transactionNumber; + } + + /** + * @return Total amount of order. + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + /** + * @return When the third party's sales order was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's sales order was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrder && equalTo((SalesOrder) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrder other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && customer.equals(other.customer) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && salesOrderUrl.equals(other.salesOrderUrl) + && status.equals(other.status) + && paymentTerm.equals(other.paymentTerm) + && memo.equals(other.memo) + && shippingAddress.equals(other.shippingAddress) + && trackingCategories.equals(other.trackingCategories) + && issueDate.equals(other.issueDate) + && transactionNumber.equals(other.transactionNumber) + && total.equals(other.total) + && lines.equals(other.lines) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.customer, + this.currency, + this.exchangeRate, + this.company, + this.salesOrderUrl, + this.status, + this.paymentTerm, + this.memo, + this.shippingAddress, + this.trackingCategories, + this.issueDate, + this.transactionNumber, + this.total, + this.lines, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional customer = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional salesOrderUrl = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional paymentTerm = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional shippingAddress = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional transactionNumber = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrder other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + customer(other.getCustomer()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + salesOrderUrl(other.getSalesOrderUrl()); + status(other.getStatus()); + paymentTerm(other.getPaymentTerm()); + memo(other.getMemo()); + shippingAddress(other.getShippingAddress()); + trackingCategories(other.getTrackingCategories()); + issueDate(other.getIssueDate()); + transactionNumber(other.getTransactionNumber()); + total(other.getTotal()); + lines(other.getLines()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    The customer associated with the sales order.

    + */ + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public Builder customer(Optional customer) { + this.customer = customer; + return this; + } + + public Builder customer(SalesOrderCustomer customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + /** + *

    The currency code for the order.

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(SalesOrderCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    The exchange rate applied if the order currency differs from the base currency.

    + */ + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + /** + *

    The subsidiary associated with the order.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(SalesOrderCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    The 3rd party URL of the sales order.

    + */ + @JsonSetter(value = "sales_order_url", nulls = Nulls.SKIP) + public Builder salesOrderUrl(Optional salesOrderUrl) { + this.salesOrderUrl = salesOrderUrl; + return this; + } + + public Builder salesOrderUrl(String salesOrderUrl) { + this.salesOrderUrl = Optional.ofNullable(salesOrderUrl); + return this; + } + + /** + *

    The status of the sales order.

    + *
      + *
    • DRAFT - DRAFT
    • + *
    • PENDING_APPROVAL - PENDING_APPROVAL
    • + *
    • OPEN - OPEN
    • + *
    • PARTIALLY_COMPLETED - PARTIALLY_COMPLETED
    • + *
    • COMPLETED - COMPLETED
    • + *
    • CLOSED - CLOSED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(SalesOrderStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    The payment terms applied to this order.

    + */ + @JsonSetter(value = "payment_term", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(SalesOrderPaymentTerm paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + + /** + *

    Notes or comments attached to the order.

    + */ + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + /** + *

    The shipping address for the order.

    + */ + @JsonSetter(value = "shipping_address", nulls = Nulls.SKIP) + public Builder shippingAddress(Optional shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + public Builder shippingAddress(SalesOrderShippingAddress shippingAddress) { + this.shippingAddress = Optional.ofNullable(shippingAddress); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + /** + *

    The date the sales order was issued.

    + */ + @JsonSetter(value = "issue_date", nulls = Nulls.SKIP) + public Builder issueDate(Optional issueDate) { + this.issueDate = issueDate; + return this; + } + + public Builder issueDate(OffsetDateTime issueDate) { + this.issueDate = Optional.ofNullable(issueDate); + return this; + } + + /** + *

    The human-readable sales order number or transaction reference.

    + */ + @JsonSetter(value = "transaction_number", nulls = Nulls.SKIP) + public Builder transactionNumber(Optional transactionNumber) { + this.transactionNumber = transactionNumber; + return this; + } + + public Builder transactionNumber(String transactionNumber) { + this.transactionNumber = Optional.ofNullable(transactionNumber); + return this; + } + + /** + *

    Total amount of order.

    + */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + /** + *

    When the third party's sales order was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's sales order was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public SalesOrder build() { + return new SalesOrder( + id, + remoteId, + createdAt, + modifiedAt, + customer, + currency, + exchangeRate, + company, + salesOrderUrl, + status, + paymentTerm, + memo, + shippingAddress, + trackingCategories, + issueDate, + transactionNumber, + total, + lines, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderBatchItemRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrderBatchItemRequest.java new file mode 100644 index 000000000..32b037a4b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderBatchItemRequest.java @@ -0,0 +1,136 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrderBatchItemRequest.Builder.class) +public final class SalesOrderBatchItemRequest { + private final String itemId; + + private final SalesOrderRequestRequest payload; + + private final Map additionalProperties; + + private SalesOrderBatchItemRequest( + String itemId, SalesOrderRequestRequest payload, Map additionalProperties) { + this.itemId = itemId; + this.payload = payload; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party item ID for this model in the bulk create request + */ + @JsonProperty("item_id") + public String getItemId() { + return itemId; + } + + @JsonProperty("payload") + public SalesOrderRequestRequest getPayload() { + return payload; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderBatchItemRequest && equalTo((SalesOrderBatchItemRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrderBatchItemRequest other) { + return itemId.equals(other.itemId) && payload.equals(other.payload); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.itemId, this.payload); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ItemIdStage builder() { + return new Builder(); + } + + public interface ItemIdStage { + /** + *

    The third-party item ID for this model in the bulk create request

    + */ + PayloadStage itemId(@NotNull String itemId); + + Builder from(SalesOrderBatchItemRequest other); + } + + public interface PayloadStage { + _FinalStage payload(@NotNull SalesOrderRequestRequest payload); + } + + public interface _FinalStage { + SalesOrderBatchItemRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ItemIdStage, PayloadStage, _FinalStage { + private String itemId; + + private SalesOrderRequestRequest payload; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SalesOrderBatchItemRequest other) { + itemId(other.getItemId()); + payload(other.getPayload()); + return this; + } + + /** + *

    The third-party item ID for this model in the bulk create request

    + *

    The third-party item ID for this model in the bulk create request

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("item_id") + public PayloadStage itemId(@NotNull String itemId) { + this.itemId = itemId; + return this; + } + + @java.lang.Override + @JsonSetter("payload") + public _FinalStage payload(@NotNull SalesOrderRequestRequest payload) { + this.payload = payload; + return this; + } + + @java.lang.Override + public SalesOrderBatchItemRequest build() { + return new SalesOrderBatchItemRequest(itemId, payload, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderBulkRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrderBulkRequest.java new file mode 100644 index 000000000..a9c659076 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderBulkRequest.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrderBulkRequest.Builder.class) +public final class SalesOrderBulkRequest { + private final List batchItems; + + private final Map additionalProperties; + + private SalesOrderBulkRequest( + List batchItems, Map additionalProperties) { + this.batchItems = batchItems; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("batch_items") + public List getBatchItems() { + return batchItems; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderBulkRequest && equalTo((SalesOrderBulkRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrderBulkRequest other) { + return batchItems.equals(other.batchItems); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.batchItems); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List batchItems = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrderBulkRequest other) { + batchItems(other.getBatchItems()); + return this; + } + + @JsonSetter(value = "batch_items", nulls = Nulls.SKIP) + public Builder batchItems(List batchItems) { + this.batchItems.clear(); + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public Builder addBatchItems(SalesOrderBatchItemRequest batchItems) { + this.batchItems.add(batchItems); + return this; + } + + public Builder addAllBatchItems(List batchItems) { + if (batchItems != null) { + this.batchItems.addAll(batchItems); + } + return this; + } + + public SalesOrderBulkRequest build() { + return new SalesOrderBulkRequest(batchItems, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderCompany.java b/src/main/java/com/merge/api/accounting/types/SalesOrderCompany.java new file mode 100644 index 000000000..7be36f839 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderCompany.Deserializer.class) +public final class SalesOrderCompany { + private final Object value; + + private final int type; + + private SalesOrderCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderCompany && equalTo((SalesOrderCompany) other); + } + + private boolean equalTo(SalesOrderCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderCompany of(String value) { + return new SalesOrderCompany(value, 0); + } + + public static SalesOrderCompany of(CompanyInfo value) { + return new SalesOrderCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderCompany.class); + } + + @java.lang.Override + public SalesOrderCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderCurrency.java b/src/main/java/com/merge/api/accounting/types/SalesOrderCurrency.java new file mode 100644 index 000000000..4ab4fe373 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderCurrency.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderCurrency.Deserializer.class) +public final class SalesOrderCurrency { + private final Object value; + + private final int type; + + private SalesOrderCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderCurrency && equalTo((SalesOrderCurrency) other); + } + + private boolean equalTo(SalesOrderCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderCurrency of(TransactionCurrencyEnum value) { + return new SalesOrderCurrency(value, 0); + } + + public static SalesOrderCurrency of(String value) { + return new SalesOrderCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderCurrency.class); + } + + @java.lang.Override + public SalesOrderCurrency deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderCustomer.java b/src/main/java/com/merge/api/accounting/types/SalesOrderCustomer.java new file mode 100644 index 000000000..e909bbf80 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderCustomer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderCustomer.Deserializer.class) +public final class SalesOrderCustomer { + private final Object value; + + private final int type; + + private SalesOrderCustomer(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderCustomer && equalTo((SalesOrderCustomer) other); + } + + private boolean equalTo(SalesOrderCustomer other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderCustomer of(String value) { + return new SalesOrderCustomer(value, 0); + } + + public static SalesOrderCustomer of(Contact value) { + return new SalesOrderCustomer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderCustomer.class); + } + + @java.lang.Override + public SalesOrderCustomer deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Contact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderEndpointRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrderEndpointRequest.java new file mode 100644 index 000000000..37d2fbc3a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderEndpointRequest.java @@ -0,0 +1,190 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrderEndpointRequest.Builder.class) +public final class SalesOrderEndpointRequest { + private final Optional isDebugMode; + + private final Optional runAsync; + + private final SalesOrderRequestRequest model; + + private final Map additionalProperties; + + private SalesOrderEndpointRequest( + Optional isDebugMode, + Optional runAsync, + SalesOrderRequestRequest model, + Map additionalProperties) { + this.isDebugMode = isDebugMode; + this.runAsync = runAsync; + this.model = model; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include debug fields (such as log file links) in the response. + */ + @JsonProperty("is_debug_mode") + public Optional getIsDebugMode() { + return isDebugMode; + } + + /** + * @return Whether or not third-party updates should be run asynchronously. + */ + @JsonProperty("run_async") + public Optional getRunAsync() { + return runAsync; + } + + @JsonProperty("model") + public SalesOrderRequestRequest getModel() { + return model; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderEndpointRequest && equalTo((SalesOrderEndpointRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrderEndpointRequest other) { + return isDebugMode.equals(other.isDebugMode) && runAsync.equals(other.runAsync) && model.equals(other.model); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isDebugMode, this.runAsync, this.model); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull SalesOrderRequestRequest model); + + Builder from(SalesOrderEndpointRequest other); + } + + public interface _FinalStage { + SalesOrderEndpointRequest build(); + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + _FinalStage isDebugMode(Optional isDebugMode); + + _FinalStage isDebugMode(Boolean isDebugMode); + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + _FinalStage runAsync(Optional runAsync); + + _FinalStage runAsync(Boolean runAsync); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private SalesOrderRequestRequest model; + + private Optional runAsync = Optional.empty(); + + private Optional isDebugMode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SalesOrderEndpointRequest other) { + isDebugMode(other.getIsDebugMode()); + runAsync(other.getRunAsync()); + model(other.getModel()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull SalesOrderRequestRequest model) { + this.model = model; + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage runAsync(Boolean runAsync) { + this.runAsync = Optional.ofNullable(runAsync); + return this; + } + + /** + *

    Whether or not third-party updates should be run asynchronously.

    + */ + @java.lang.Override + @JsonSetter(value = "run_async", nulls = Nulls.SKIP) + public _FinalStage runAsync(Optional runAsync) { + this.runAsync = runAsync; + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDebugMode(Boolean isDebugMode) { + this.isDebugMode = Optional.ofNullable(isDebugMode); + return this; + } + + /** + *

    Whether to include debug fields (such as log file links) in the response.

    + */ + @java.lang.Override + @JsonSetter(value = "is_debug_mode", nulls = Nulls.SKIP) + public _FinalStage isDebugMode(Optional isDebugMode) { + this.isDebugMode = isDebugMode; + return this; + } + + @java.lang.Override + public SalesOrderEndpointRequest build() { + return new SalesOrderEndpointRequest(isDebugMode, runAsync, model, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLine.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLine.java new file mode 100644 index 000000000..c71bca175 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLine.java @@ -0,0 +1,539 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrderLine.Builder.class) +public final class SalesOrderLine { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional description; + + private final Optional unitPrice; + + private final Optional quantity; + + private final Optional item; + + private final Optional taxRate; + + private final Optional>> trackingCategories; + + private final Optional company; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private SalesOrderLine( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional description, + Optional unitPrice, + Optional quantity, + Optional item, + Optional taxRate, + Optional>> trackingCategories, + Optional company, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional> remoteFields, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.description = description; + this.unitPrice = unitPrice; + this.quantity = quantity; + this.item = item; + this.taxRate = taxRate; + this.trackingCategories = trackingCategories; + this.company = company; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return Description of the line item. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The unit price of the item. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return Quantity ordered for this line. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The tax rate of the line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The dimensions or classification tags. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The subsidiary associated with the order. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return When the third party's sales order line item was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's sales order line item was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLine && equalTo((SalesOrderLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrderLine other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && description.equals(other.description) + && unitPrice.equals(other.unitPrice) + && quantity.equals(other.quantity) + && item.equals(other.item) + && taxRate.equals(other.taxRate) + && trackingCategories.equals(other.trackingCategories) + && company.equals(other.company) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.description, + this.unitPrice, + this.quantity, + this.item, + this.taxRate, + this.trackingCategories, + this.company, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional>> trackingCategories = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrderLine other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + description(other.getDescription()); + unitPrice(other.getUnitPrice()); + quantity(other.getQuantity()); + item(other.getItem()); + taxRate(other.getTaxRate()); + trackingCategories(other.getTrackingCategories()); + company(other.getCompany()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + remoteFields(other.getRemoteFields()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    Description of the line item.

    + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The unit price of the item.

    + */ + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(String unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + *

    Quantity ordered for this line.

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(SalesOrderLineItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + /** + *

    The tax rate of the line item.

    + */ + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(SalesOrderLineTaxRate taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + /** + *

    The dimensions or classification tags.

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories(List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + /** + *

    The subsidiary associated with the order.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(SalesOrderLineCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    When the third party's sales order line item was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's sales order line item was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public SalesOrderLine build() { + return new SalesOrderLine( + id, + remoteId, + createdAt, + modifiedAt, + description, + unitPrice, + quantity, + item, + taxRate, + trackingCategories, + company, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLineCompany.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineCompany.java new file mode 100644 index 000000000..5653097c8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderLineCompany.Deserializer.class) +public final class SalesOrderLineCompany { + private final Object value; + + private final int type; + + private SalesOrderLineCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLineCompany && equalTo((SalesOrderLineCompany) other); + } + + private boolean equalTo(SalesOrderLineCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderLineCompany of(String value) { + return new SalesOrderLineCompany(value, 0); + } + + public static SalesOrderLineCompany of(CompanyInfo value) { + return new SalesOrderLineCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderLineCompany.class); + } + + @java.lang.Override + public SalesOrderLineCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLineItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineItem.java new file mode 100644 index 000000000..949ba987d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderLineItem.Deserializer.class) +public final class SalesOrderLineItem { + private final Object value; + + private final int type; + + private SalesOrderLineItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLineItem && equalTo((SalesOrderLineItem) other); + } + + private boolean equalTo(SalesOrderLineItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderLineItem of(String value) { + return new SalesOrderLineItem(value, 0); + } + + public static SalesOrderLineItem of(Item value) { + return new SalesOrderLineItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderLineItem.class); + } + + @java.lang.Override + public SalesOrderLineItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Item.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequest.java new file mode 100644 index 000000000..3a7f0462a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequest.java @@ -0,0 +1,472 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrderLineRequest.Builder.class) +public final class SalesOrderLineRequest { + private final Optional remoteId; + + private final Optional description; + + private final Optional unitPrice; + + private final Optional quantity; + + private final Optional item; + + private final Optional taxRate; + + private final Optional>> trackingCategories; + + private final Optional company; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private SalesOrderLineRequest( + Optional remoteId, + Optional description, + Optional unitPrice, + Optional quantity, + Optional item, + Optional taxRate, + Optional>> trackingCategories, + Optional company, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.remoteId = remoteId; + this.description = description; + this.unitPrice = unitPrice; + this.quantity = quantity; + this.item = item; + this.taxRate = taxRate; + this.trackingCategories = trackingCategories; + this.company = company; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return Description of the line item. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The unit price of the item. + */ + @JsonProperty("unit_price") + public Optional getUnitPrice() { + return unitPrice; + } + + /** + * @return Quantity ordered for this line. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + @JsonProperty("item") + public Optional getItem() { + return item; + } + + /** + * @return The tax rate of the line item. + */ + @JsonProperty("tax_rate") + public Optional getTaxRate() { + return taxRate; + } + + /** + * @return The dimensions or classification tags. + */ + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The subsidiary associated with the order. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return When the third party's sales order line item was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's sales order line item was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLineRequest && equalTo((SalesOrderLineRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrderLineRequest other) { + return remoteId.equals(other.remoteId) + && description.equals(other.description) + && unitPrice.equals(other.unitPrice) + && quantity.equals(other.quantity) + && item.equals(other.item) + && taxRate.equals(other.taxRate) + && trackingCategories.equals(other.trackingCategories) + && company.equals(other.company) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.description, + this.unitPrice, + this.quantity, + this.item, + this.taxRate, + this.trackingCategories, + this.company, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteId = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional unitPrice = Optional.empty(); + + private Optional quantity = Optional.empty(); + + private Optional item = Optional.empty(); + + private Optional taxRate = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrderLineRequest other) { + remoteId(other.getRemoteId()); + description(other.getDescription()); + unitPrice(other.getUnitPrice()); + quantity(other.getQuantity()); + item(other.getItem()); + taxRate(other.getTaxRate()); + trackingCategories(other.getTrackingCategories()); + company(other.getCompany()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    Description of the line item.

    + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The unit price of the item.

    + */ + @JsonSetter(value = "unit_price", nulls = Nulls.SKIP) + public Builder unitPrice(Optional unitPrice) { + this.unitPrice = unitPrice; + return this; + } + + public Builder unitPrice(String unitPrice) { + this.unitPrice = Optional.ofNullable(unitPrice); + return this; + } + + /** + *

    Quantity ordered for this line.

    + */ + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public Builder quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + public Builder quantity(String quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + @JsonSetter(value = "item", nulls = Nulls.SKIP) + public Builder item(Optional item) { + this.item = item; + return this; + } + + public Builder item(SalesOrderLineRequestItem item) { + this.item = Optional.ofNullable(item); + return this; + } + + /** + *

    The tax rate of the line item.

    + */ + @JsonSetter(value = "tax_rate", nulls = Nulls.SKIP) + public Builder taxRate(Optional taxRate) { + this.taxRate = taxRate; + return this; + } + + public Builder taxRate(SalesOrderLineRequestTaxRate taxRate) { + this.taxRate = Optional.ofNullable(taxRate); + return this; + } + + /** + *

    The dimensions or classification tags.

    + */ + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + /** + *

    The subsidiary associated with the order.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(SalesOrderLineRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    When the third party's sales order line item was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's sales order line item was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public SalesOrderLineRequest build() { + return new SalesOrderLineRequest( + remoteId, + description, + unitPrice, + quantity, + item, + taxRate, + trackingCategories, + company, + remoteCreatedAt, + remoteUpdatedAt, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestCompany.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestCompany.java similarity index 73% rename from src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestCompany.java rename to src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestCompany.java index 2e2b7c020..94d489af6 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestCompany.java +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestCompany.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = PatchedPaymentRequestCompany.Deserializer.class) -public final class PatchedPaymentRequestCompany { +@JsonDeserialize(using = SalesOrderLineRequestCompany.Deserializer.class) +public final class SalesOrderLineRequestCompany { private final Object value; private final int type; - private PatchedPaymentRequestCompany(Object value, int type) { + private SalesOrderLineRequestCompany(Object value, int type) { this.value = value; this.type = type; } @@ -42,10 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof PatchedPaymentRequestCompany && equalTo((PatchedPaymentRequestCompany) other); + return other instanceof SalesOrderLineRequestCompany && equalTo((SalesOrderLineRequestCompany) other); } - private boolean equalTo(PatchedPaymentRequestCompany other) { + private boolean equalTo(SalesOrderLineRequestCompany other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static PatchedPaymentRequestCompany of(String value) { - return new PatchedPaymentRequestCompany(value, 0); + public static SalesOrderLineRequestCompany of(String value) { + return new SalesOrderLineRequestCompany(value, 0); } - public static PatchedPaymentRequestCompany of(CompanyInfo value) { - return new PatchedPaymentRequestCompany(value, 1); + public static SalesOrderLineRequestCompany of(CompanyInfo value) { + return new SalesOrderLineRequestCompany(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(CompanyInfo value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(PatchedPaymentRequestCompany.class); + super(SalesOrderLineRequestCompany.class); } @java.lang.Override - public PatchedPaymentRequestCompany deserialize(JsonParser p, DeserializationContext context) + public SalesOrderLineRequestCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestItem.java new file mode 100644 index 000000000..271373df0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderLineRequestItem.Deserializer.class) +public final class SalesOrderLineRequestItem { + private final Object value; + + private final int type; + + private SalesOrderLineRequestItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Item) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLineRequestItem && equalTo((SalesOrderLineRequestItem) other); + } + + private boolean equalTo(SalesOrderLineRequestItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderLineRequestItem of(String value) { + return new SalesOrderLineRequestItem(value, 0); + } + + public static SalesOrderLineRequestItem of(Item value) { + return new SalesOrderLineRequestItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Item value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderLineRequestItem.class); + } + + @java.lang.Override + public SalesOrderLineRequestItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Item.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestTaxRate.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestTaxRate.java new file mode 100644 index 000000000..36f8f321c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestTaxRate.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderLineRequestTaxRate.Deserializer.class) +public final class SalesOrderLineRequestTaxRate { + private final Object value; + + private final int type; + + private SalesOrderLineRequestTaxRate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TaxRate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLineRequestTaxRate && equalTo((SalesOrderLineRequestTaxRate) other); + } + + private boolean equalTo(SalesOrderLineRequestTaxRate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderLineRequestTaxRate of(String value) { + return new SalesOrderLineRequestTaxRate(value, 0); + } + + public static SalesOrderLineRequestTaxRate of(TaxRate value) { + return new SalesOrderLineRequestTaxRate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TaxRate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderLineRequestTaxRate.class); + } + + @java.lang.Override + public SalesOrderLineRequestTaxRate deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaxRate.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestTrackingCategoriesItem.java similarity index 73% rename from src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java rename to src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestTrackingCategoriesItem.java index 02ca01f6a..c613b5957 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequestTrackingCategoriesItem.java +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineRequestTrackingCategoriesItem.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = PatchedPaymentRequestTrackingCategoriesItem.Deserializer.class) -public final class PatchedPaymentRequestTrackingCategoriesItem { +@JsonDeserialize(using = SalesOrderLineRequestTrackingCategoriesItem.Deserializer.class) +public final class SalesOrderLineRequestTrackingCategoriesItem { private final Object value; private final int type; - private PatchedPaymentRequestTrackingCategoriesItem(Object value, int type) { + private SalesOrderLineRequestTrackingCategoriesItem(Object value, int type) { this.value = value; this.type = type; } @@ -42,11 +42,11 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof PatchedPaymentRequestTrackingCategoriesItem - && equalTo((PatchedPaymentRequestTrackingCategoriesItem) other); + return other instanceof SalesOrderLineRequestTrackingCategoriesItem + && equalTo((SalesOrderLineRequestTrackingCategoriesItem) other); } - private boolean equalTo(PatchedPaymentRequestTrackingCategoriesItem other) { + private boolean equalTo(SalesOrderLineRequestTrackingCategoriesItem other) { return value.equals(other.value); } @@ -60,12 +60,12 @@ public String toString() { return this.value.toString(); } - public static PatchedPaymentRequestTrackingCategoriesItem of(String value) { - return new PatchedPaymentRequestTrackingCategoriesItem(value, 0); + public static SalesOrderLineRequestTrackingCategoriesItem of(String value) { + return new SalesOrderLineRequestTrackingCategoriesItem(value, 0); } - public static PatchedPaymentRequestTrackingCategoriesItem of(TrackingCategory value) { - return new PatchedPaymentRequestTrackingCategoriesItem(value, 1); + public static SalesOrderLineRequestTrackingCategoriesItem of(TrackingCategory value) { + return new SalesOrderLineRequestTrackingCategoriesItem(value, 1); } public interface Visitor { @@ -74,13 +74,13 @@ public interface Visitor { T visit(TrackingCategory value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(PatchedPaymentRequestTrackingCategoriesItem.class); + super(SalesOrderLineRequestTrackingCategoriesItem.class); } @java.lang.Override - public PatchedPaymentRequestTrackingCategoriesItem deserialize(JsonParser p, DeserializationContext context) + public SalesOrderLineRequestTrackingCategoriesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLineTaxRate.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineTaxRate.java new file mode 100644 index 000000000..9e3cfd6fd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineTaxRate.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderLineTaxRate.Deserializer.class) +public final class SalesOrderLineTaxRate { + private final Object value; + + private final int type; + + private SalesOrderLineTaxRate(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TaxRate) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLineTaxRate && equalTo((SalesOrderLineTaxRate) other); + } + + private boolean equalTo(SalesOrderLineTaxRate other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderLineTaxRate of(String value) { + return new SalesOrderLineTaxRate(value, 0); + } + + public static SalesOrderLineTaxRate of(TaxRate value) { + return new SalesOrderLineTaxRate(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TaxRate value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderLineTaxRate.class); + } + + @java.lang.Override + public SalesOrderLineTaxRate deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TaxRate.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLineTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLineTrackingCategoriesItem.java new file mode 100644 index 000000000..e24ba5ad6 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLineTrackingCategoriesItem.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderLineTrackingCategoriesItem.Deserializer.class) +public final class SalesOrderLineTrackingCategoriesItem { + private final Object value; + + private final int type; + + private SalesOrderLineTrackingCategoriesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLineTrackingCategoriesItem + && equalTo((SalesOrderLineTrackingCategoriesItem) other); + } + + private boolean equalTo(SalesOrderLineTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderLineTrackingCategoriesItem of(String value) { + return new SalesOrderLineTrackingCategoriesItem(value, 0); + } + + public static SalesOrderLineTrackingCategoriesItem of(TrackingCategory value) { + return new SalesOrderLineTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderLineTrackingCategoriesItem.class); + } + + @java.lang.Override + public SalesOrderLineTrackingCategoriesItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TrackingCategory.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderLinesItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderLinesItem.java new file mode 100644 index 000000000..9f23592fc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderLinesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderLinesItem.Deserializer.class) +public final class SalesOrderLinesItem { + private final Object value; + + private final int type; + + private SalesOrderLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((SalesOrderLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderLinesItem && equalTo((SalesOrderLinesItem) other); + } + + private boolean equalTo(SalesOrderLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderLinesItem of(String value) { + return new SalesOrderLinesItem(value, 0); + } + + public static SalesOrderLinesItem of(SalesOrderLine value) { + return new SalesOrderLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(SalesOrderLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderLinesItem.class); + } + + @java.lang.Override + public SalesOrderLinesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrderLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderPaymentTerm.java b/src/main/java/com/merge/api/accounting/types/SalesOrderPaymentTerm.java new file mode 100644 index 000000000..c748c96ed --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderPaymentTerm.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderPaymentTerm.Deserializer.class) +public final class SalesOrderPaymentTerm { + private final Object value; + + private final int type; + + private SalesOrderPaymentTerm(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentTerm) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderPaymentTerm && equalTo((SalesOrderPaymentTerm) other); + } + + private boolean equalTo(SalesOrderPaymentTerm other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderPaymentTerm of(String value) { + return new SalesOrderPaymentTerm(value, 0); + } + + public static SalesOrderPaymentTerm of(PaymentTerm value) { + return new SalesOrderPaymentTerm(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentTerm value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderPaymentTerm.class); + } + + @java.lang.Override + public SalesOrderPaymentTerm deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTerm.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequest.java new file mode 100644 index 000000000..7fc28ea4f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequest.java @@ -0,0 +1,1194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrderRequestRequest.Builder.class) +public final class SalesOrderRequestRequest { + private final Optional customer; + + private final Optional currency; + + private final Optional exchangeRate; + + private final Optional company; + + private final Optional status; + + private final Optional paymentTerm; + + private final Optional memo; + + private final Optional shippingAddress; + + private final Optional>> trackingCategories; + + private final Optional issueDate; + + private final Optional transactionNumber; + + private final Optional total; + + private final Optional> lines; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Optional> remoteFields; + + private final Map additionalProperties; + + private SalesOrderRequestRequest( + Optional customer, + Optional currency, + Optional exchangeRate, + Optional company, + Optional status, + Optional paymentTerm, + Optional memo, + Optional shippingAddress, + Optional>> trackingCategories, + Optional issueDate, + Optional transactionNumber, + Optional total, + Optional> lines, + Optional> integrationParams, + Optional> linkedAccountParams, + Optional> remoteFields, + Map additionalProperties) { + this.customer = customer; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.company = company; + this.status = status; + this.paymentTerm = paymentTerm; + this.memo = memo; + this.shippingAddress = shippingAddress; + this.trackingCategories = trackingCategories; + this.issueDate = issueDate; + this.transactionNumber = transactionNumber; + this.total = total; + this.lines = lines; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.remoteFields = remoteFields; + this.additionalProperties = additionalProperties; + } + + /** + * @return The customer associated with the sales order. + */ + @JsonProperty("customer") + public Optional getCustomer() { + return customer; + } + + /** + * @return The currency code for the order. + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonProperty("currency") + public Optional getCurrency() { + return currency; + } + + /** + * @return The exchange rate applied if the order currency differs from the base currency. + */ + @JsonProperty("exchange_rate") + public Optional getExchangeRate() { + return exchangeRate; + } + + /** + * @return The subsidiary associated with the order. + */ + @JsonProperty("company") + public Optional getCompany() { + return company; + } + + /** + * @return The status of the sales order. + *
      + *
    • DRAFT - DRAFT
    • + *
    • PENDING_APPROVAL - PENDING_APPROVAL
    • + *
    • OPEN - OPEN
    • + *
    • PARTIALLY_COMPLETED - PARTIALLY_COMPLETED
    • + *
    • COMPLETED - COMPLETED
    • + *
    • CLOSED - CLOSED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The payment terms applied to this order. + */ + @JsonProperty("payment_term") + public Optional getPaymentTerm() { + return paymentTerm; + } + + /** + * @return Notes or comments attached to the order. + */ + @JsonProperty("memo") + public Optional getMemo() { + return memo; + } + + /** + * @return The shipping address for the order. + */ + @JsonProperty("shipping_address") + public Optional getShippingAddress() { + return shippingAddress; + } + + @JsonProperty("tracking_categories") + public Optional>> getTrackingCategories() { + return trackingCategories; + } + + /** + * @return The date the sales order was issued. + */ + @JsonProperty("issue_date") + public Optional getIssueDate() { + return issueDate; + } + + /** + * @return The human-readable sales order number or transaction reference. + */ + @JsonProperty("transaction_number") + public Optional getTransactionNumber() { + return transactionNumber; + } + + /** + * @return Total amount of order. + */ + @JsonProperty("total") + public Optional getTotal() { + return total; + } + + @JsonProperty("lines") + public Optional> getLines() { + return lines; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequest && equalTo((SalesOrderRequestRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrderRequestRequest other) { + return customer.equals(other.customer) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && company.equals(other.company) + && status.equals(other.status) + && paymentTerm.equals(other.paymentTerm) + && memo.equals(other.memo) + && shippingAddress.equals(other.shippingAddress) + && trackingCategories.equals(other.trackingCategories) + && issueDate.equals(other.issueDate) + && transactionNumber.equals(other.transactionNumber) + && total.equals(other.total) + && lines.equals(other.lines) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams) + && remoteFields.equals(other.remoteFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.customer, + this.currency, + this.exchangeRate, + this.company, + this.status, + this.paymentTerm, + this.memo, + this.shippingAddress, + this.trackingCategories, + this.issueDate, + this.transactionNumber, + this.total, + this.lines, + this.integrationParams, + this.linkedAccountParams, + this.remoteFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional customer = Optional.empty(); + + private Optional currency = Optional.empty(); + + private Optional exchangeRate = Optional.empty(); + + private Optional company = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional paymentTerm = Optional.empty(); + + private Optional memo = Optional.empty(); + + private Optional shippingAddress = Optional.empty(); + + private Optional>> trackingCategories = + Optional.empty(); + + private Optional issueDate = Optional.empty(); + + private Optional transactionNumber = Optional.empty(); + + private Optional total = Optional.empty(); + + private Optional> lines = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + private Optional> remoteFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrderRequestRequest other) { + customer(other.getCustomer()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + company(other.getCompany()); + status(other.getStatus()); + paymentTerm(other.getPaymentTerm()); + memo(other.getMemo()); + shippingAddress(other.getShippingAddress()); + trackingCategories(other.getTrackingCategories()); + issueDate(other.getIssueDate()); + transactionNumber(other.getTransactionNumber()); + total(other.getTotal()); + lines(other.getLines()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + remoteFields(other.getRemoteFields()); + return this; + } + + /** + *

    The customer associated with the sales order.

    + */ + @JsonSetter(value = "customer", nulls = Nulls.SKIP) + public Builder customer(Optional customer) { + this.customer = customer; + return this; + } + + public Builder customer(SalesOrderRequestRequestCustomer customer) { + this.customer = Optional.ofNullable(customer); + return this; + } + + /** + *

    The currency code for the order.

    + *
      + *
    • XUA - ADB Unit of Account
    • + *
    • AFN - Afghan Afghani
    • + *
    • AFA - Afghan Afghani (1927–2002)
    • + *
    • ALL - Albanian Lek
    • + *
    • ALK - Albanian Lek (1946–1965)
    • + *
    • DZD - Algerian Dinar
    • + *
    • ADP - Andorran Peseta
    • + *
    • AOA - Angolan Kwanza
    • + *
    • AOK - Angolan Kwanza (1977–1991)
    • + *
    • AON - Angolan New Kwanza (1990–2000)
    • + *
    • AOR - Angolan Readjusted Kwanza (1995–1999)
    • + *
    • ARA - Argentine Austral
    • + *
    • ARS - Argentine Peso
    • + *
    • ARM - Argentine Peso (1881–1970)
    • + *
    • ARP - Argentine Peso (1983–1985)
    • + *
    • ARL - Argentine Peso Ley (1970–1983)
    • + *
    • AMD - Armenian Dram
    • + *
    • AWG - Aruban Florin
    • + *
    • AUD - Australian Dollar
    • + *
    • ATS - Austrian Schilling
    • + *
    • AZN - Azerbaijani Manat
    • + *
    • AZM - Azerbaijani Manat (1993–2006)
    • + *
    • BSD - Bahamian Dollar
    • + *
    • BHD - Bahraini Dinar
    • + *
    • BDT - Bangladeshi Taka
    • + *
    • BBD - Barbadian Dollar
    • + *
    • BYN - Belarusian Ruble
    • + *
    • BYB - Belarusian Ruble (1994–1999)
    • + *
    • BYR - Belarusian Ruble (2000–2016)
    • + *
    • BEF - Belgian Franc
    • + *
    • BEC - Belgian Franc (convertible)
    • + *
    • BEL - Belgian Franc (financial)
    • + *
    • BZD - Belize Dollar
    • + *
    • BMD - Bermudan Dollar
    • + *
    • BTN - Bhutanese Ngultrum
    • + *
    • BOB - Bolivian Boliviano
    • + *
    • BOL - Bolivian Boliviano (1863–1963)
    • + *
    • BOV - Bolivian Mvdol
    • + *
    • BOP - Bolivian Peso
    • + *
    • BAM - Bosnia-Herzegovina Convertible Mark
    • + *
    • BAD - Bosnia-Herzegovina Dinar (1992–1994)
    • + *
    • BAN - Bosnia-Herzegovina New Dinar (1994–1997)
    • + *
    • BWP - Botswanan Pula
    • + *
    • BRC - Brazilian Cruzado (1986–1989)
    • + *
    • BRZ - Brazilian Cruzeiro (1942–1967)
    • + *
    • BRE - Brazilian Cruzeiro (1990–1993)
    • + *
    • BRR - Brazilian Cruzeiro (1993–1994)
    • + *
    • BRN - Brazilian New Cruzado (1989–1990)
    • + *
    • BRB - Brazilian New Cruzeiro (1967–1986)
    • + *
    • BRL - Brazilian Real
    • + *
    • GBP - British Pound
    • + *
    • BND - Brunei Dollar
    • + *
    • BGL - Bulgarian Hard Lev
    • + *
    • BGN - Bulgarian Lev
    • + *
    • BGO - Bulgarian Lev (1879–1952)
    • + *
    • BGM - Bulgarian Socialist Lev
    • + *
    • BUK - Burmese Kyat
    • + *
    • BIF - Burundian Franc
    • + *
    • XPF - CFP Franc
    • + *
    • KHR - Cambodian Riel
    • + *
    • CAD - Canadian Dollar
    • + *
    • CVE - Cape Verdean Escudo
    • + *
    • KYD - Cayman Islands Dollar
    • + *
    • XAF - Central African CFA Franc
    • + *
    • CLE - Chilean Escudo
    • + *
    • CLP - Chilean Peso
    • + *
    • CLF - Chilean Unit of Account (UF)
    • + *
    • CNX - Chinese People’s Bank Dollar
    • + *
    • CNY - Chinese Yuan
    • + *
    • CNH - Chinese Yuan (offshore)
    • + *
    • COP - Colombian Peso
    • + *
    • COU - Colombian Real Value Unit
    • + *
    • KMF - Comorian Franc
    • + *
    • CDF - Congolese Franc
    • + *
    • CRC - Costa Rican Colón
    • + *
    • HRD - Croatian Dinar
    • + *
    • HRK - Croatian Kuna
    • + *
    • CUC - Cuban Convertible Peso
    • + *
    • CUP - Cuban Peso
    • + *
    • CYP - Cypriot Pound
    • + *
    • CZK - Czech Koruna
    • + *
    • CSK - Czechoslovak Hard Koruna
    • + *
    • DKK - Danish Krone
    • + *
    • DJF - Djiboutian Franc
    • + *
    • DOP - Dominican Peso
    • + *
    • NLG - Dutch Guilder
    • + *
    • XCD - East Caribbean Dollar
    • + *
    • DDM - East German Mark
    • + *
    • ECS - Ecuadorian Sucre
    • + *
    • ECV - Ecuadorian Unit of Constant Value
    • + *
    • EGP - Egyptian Pound
    • + *
    • GQE - Equatorial Guinean Ekwele
    • + *
    • ERN - Eritrean Nakfa
    • + *
    • EEK - Estonian Kroon
    • + *
    • ETB - Ethiopian Birr
    • + *
    • EUR - Euro
    • + *
    • XBA - European Composite Unit
    • + *
    • XEU - European Currency Unit
    • + *
    • XBB - European Monetary Unit
    • + *
    • XBC - European Unit of Account (XBC)
    • + *
    • XBD - European Unit of Account (XBD)
    • + *
    • FKP - Falkland Islands Pound
    • + *
    • FJD - Fijian Dollar
    • + *
    • FIM - Finnish Markka
    • + *
    • FRF - French Franc
    • + *
    • XFO - French Gold Franc
    • + *
    • XFU - French UIC-Franc
    • + *
    • GMD - Gambian Dalasi
    • + *
    • GEK - Georgian Kupon Larit
    • + *
    • GEL - Georgian Lari
    • + *
    • DEM - German Mark
    • + *
    • GHS - Ghanaian Cedi
    • + *
    • GHC - Ghanaian Cedi (1979–2007)
    • + *
    • GIP - Gibraltar Pound
    • + *
    • XAU - Gold
    • + *
    • GRD - Greek Drachma
    • + *
    • GTQ - Guatemalan Quetzal
    • + *
    • GWP - Guinea-Bissau Peso
    • + *
    • GNF - Guinean Franc
    • + *
    • GNS - Guinean Syli
    • + *
    • GYD - Guyanaese Dollar
    • + *
    • HTG - Haitian Gourde
    • + *
    • HNL - Honduran Lempira
    • + *
    • HKD - Hong Kong Dollar
    • + *
    • HUF - Hungarian Forint
    • + *
    • IMP - IMP
    • + *
    • ISK - Icelandic Króna
    • + *
    • ISJ - Icelandic Króna (1918–1981)
    • + *
    • INR - Indian Rupee
    • + *
    • IDR - Indonesian Rupiah
    • + *
    • IRR - Iranian Rial
    • + *
    • IQD - Iraqi Dinar
    • + *
    • IEP - Irish Pound
    • + *
    • ILS - Israeli New Shekel
    • + *
    • ILP - Israeli Pound
    • + *
    • ILR - Israeli Shekel (1980–1985)
    • + *
    • ITL - Italian Lira
    • + *
    • JMD - Jamaican Dollar
    • + *
    • JPY - Japanese Yen
    • + *
    • JOD - Jordanian Dinar
    • + *
    • KZT - Kazakhstani Tenge
    • + *
    • KES - Kenyan Shilling
    • + *
    • KWD - Kuwaiti Dinar
    • + *
    • KGS - Kyrgystani Som
    • + *
    • LAK - Laotian Kip
    • + *
    • LVL - Latvian Lats
    • + *
    • LVR - Latvian Ruble
    • + *
    • LBP - Lebanese Pound
    • + *
    • LSL - Lesotho Loti
    • + *
    • LRD - Liberian Dollar
    • + *
    • LYD - Libyan Dinar
    • + *
    • LTL - Lithuanian Litas
    • + *
    • LTT - Lithuanian Talonas
    • + *
    • LUL - Luxembourg Financial Franc
    • + *
    • LUC - Luxembourgian Convertible Franc
    • + *
    • LUF - Luxembourgian Franc
    • + *
    • MOP - Macanese Pataca
    • + *
    • MKD - Macedonian Denar
    • + *
    • MKN - Macedonian Denar (1992–1993)
    • + *
    • MGA - Malagasy Ariary
    • + *
    • MGF - Malagasy Franc
    • + *
    • MWK - Malawian Kwacha
    • + *
    • MYR - Malaysian Ringgit
    • + *
    • MVR - Maldivian Rufiyaa
    • + *
    • MVP - Maldivian Rupee (1947–1981)
    • + *
    • MLF - Malian Franc
    • + *
    • MTL - Maltese Lira
    • + *
    • MTP - Maltese Pound
    • + *
    • MRU - Mauritanian Ouguiya
    • + *
    • MRO - Mauritanian Ouguiya (1973–2017)
    • + *
    • MUR - Mauritian Rupee
    • + *
    • MXV - Mexican Investment Unit
    • + *
    • MXN - Mexican Peso
    • + *
    • MXP - Mexican Silver Peso (1861–1992)
    • + *
    • MDC - Moldovan Cupon
    • + *
    • MDL - Moldovan Leu
    • + *
    • MCF - Monegasque Franc
    • + *
    • MNT - Mongolian Tugrik
    • + *
    • MAD - Moroccan Dirham
    • + *
    • MAF - Moroccan Franc
    • + *
    • MZE - Mozambican Escudo
    • + *
    • MZN - Mozambican Metical
    • + *
    • MZM - Mozambican Metical (1980–2006)
    • + *
    • MMK - Myanmar Kyat
    • + *
    • NAD - Namibian Dollar
    • + *
    • NPR - Nepalese Rupee
    • + *
    • ANG - Netherlands Antillean Guilder
    • + *
    • TWD - New Taiwan Dollar
    • + *
    • NZD - New Zealand Dollar
    • + *
    • NIO - Nicaraguan Córdoba
    • + *
    • NIC - Nicaraguan Córdoba (1988–1991)
    • + *
    • NGN - Nigerian Naira
    • + *
    • KPW - North Korean Won
    • + *
    • NOK - Norwegian Krone
    • + *
    • OMR - Omani Rial
    • + *
    • PKR - Pakistani Rupee
    • + *
    • XPD - Palladium
    • + *
    • PAB - Panamanian Balboa
    • + *
    • PGK - Papua New Guinean Kina
    • + *
    • PYG - Paraguayan Guarani
    • + *
    • PEI - Peruvian Inti
    • + *
    • PEN - Peruvian Sol
    • + *
    • PES - Peruvian Sol (1863–1965)
    • + *
    • PHP - Philippine Peso
    • + *
    • XPT - Platinum
    • + *
    • PLN - Polish Zloty
    • + *
    • PLZ - Polish Zloty (1950–1995)
    • + *
    • PTE - Portuguese Escudo
    • + *
    • GWE - Portuguese Guinea Escudo
    • + *
    • QAR - Qatari Rial
    • + *
    • XRE - RINET Funds
    • + *
    • RHD - Rhodesian Dollar
    • + *
    • RON - Romanian Leu
    • + *
    • ROL - Romanian Leu (1952–2006)
    • + *
    • RUB - Russian Ruble
    • + *
    • RUR - Russian Ruble (1991–1998)
    • + *
    • RWF - Rwandan Franc
    • + *
    • SVC - Salvadoran Colón
    • + *
    • WST - Samoan Tala
    • + *
    • SAR - Saudi Riyal
    • + *
    • RSD - Serbian Dinar
    • + *
    • CSD - Serbian Dinar (2002–2006)
    • + *
    • SCR - Seychellois Rupee
    • + *
    • SLL - Sierra Leonean Leone
    • + *
    • XAG - Silver
    • + *
    • SGD - Singapore Dollar
    • + *
    • SKK - Slovak Koruna
    • + *
    • SIT - Slovenian Tolar
    • + *
    • SBD - Solomon Islands Dollar
    • + *
    • SOS - Somali Shilling
    • + *
    • ZAR - South African Rand
    • + *
    • ZAL - South African Rand (financial)
    • + *
    • KRH - South Korean Hwan (1953–1962)
    • + *
    • KRW - South Korean Won
    • + *
    • KRO - South Korean Won (1945–1953)
    • + *
    • SSP - South Sudanese Pound
    • + *
    • SUR - Soviet Rouble
    • + *
    • ESP - Spanish Peseta
    • + *
    • ESA - Spanish Peseta (A account)
    • + *
    • ESB - Spanish Peseta (convertible account)
    • + *
    • XDR - Special Drawing Rights
    • + *
    • LKR - Sri Lankan Rupee
    • + *
    • SHP - St. Helena Pound
    • + *
    • XSU - Sucre
    • + *
    • SDD - Sudanese Dinar (1992–2007)
    • + *
    • SDG - Sudanese Pound
    • + *
    • SDP - Sudanese Pound (1957–1998)
    • + *
    • SRD - Surinamese Dollar
    • + *
    • SRG - Surinamese Guilder
    • + *
    • SZL - Swazi Lilangeni
    • + *
    • SEK - Swedish Krona
    • + *
    • CHF - Swiss Franc
    • + *
    • SYP - Syrian Pound
    • + *
    • STN - São Tomé & Príncipe Dobra
    • + *
    • STD - São Tomé & Príncipe Dobra (1977–2017)
    • + *
    • TVD - TVD
    • + *
    • TJR - Tajikistani Ruble
    • + *
    • TJS - Tajikistani Somoni
    • + *
    • TZS - Tanzanian Shilling
    • + *
    • XTS - Testing Currency Code
    • + *
    • THB - Thai Baht
    • + *
    • XXX - The codes assigned for transactions where no currency is involved
    • + *
    • TPE - Timorese Escudo
    • + *
    • TOP - Tongan Paʻanga
    • + *
    • TTD - Trinidad & Tobago Dollar
    • + *
    • TND - Tunisian Dinar
    • + *
    • TRY - Turkish Lira
    • + *
    • TRL - Turkish Lira (1922–2005)
    • + *
    • TMT - Turkmenistani Manat
    • + *
    • TMM - Turkmenistani Manat (1993–2009)
    • + *
    • USD - US Dollar
    • + *
    • USN - US Dollar (Next day)
    • + *
    • USS - US Dollar (Same day)
    • + *
    • UGX - Ugandan Shilling
    • + *
    • UGS - Ugandan Shilling (1966–1987)
    • + *
    • UAH - Ukrainian Hryvnia
    • + *
    • UAK - Ukrainian Karbovanets
    • + *
    • AED - United Arab Emirates Dirham
    • + *
    • UYW - Uruguayan Nominal Wage Index Unit
    • + *
    • UYU - Uruguayan Peso
    • + *
    • UYP - Uruguayan Peso (1975–1993)
    • + *
    • UYI - Uruguayan Peso (Indexed Units)
    • + *
    • UZS - Uzbekistani Som
    • + *
    • VUV - Vanuatu Vatu
    • + *
    • VES - Venezuelan Bolívar
    • + *
    • VEB - Venezuelan Bolívar (1871–2008)
    • + *
    • VEF - Venezuelan Bolívar (2008–2018)
    • + *
    • VND - Vietnamese Dong
    • + *
    • VNN - Vietnamese Dong (1978–1985)
    • + *
    • CHE - WIR Euro
    • + *
    • CHW - WIR Franc
    • + *
    • XOF - West African CFA Franc
    • + *
    • YDD - Yemeni Dinar
    • + *
    • YER - Yemeni Rial
    • + *
    • YUN - Yugoslavian Convertible Dinar (1990–1992)
    • + *
    • YUD - Yugoslavian Hard Dinar (1966–1990)
    • + *
    • YUM - Yugoslavian New Dinar (1994–2002)
    • + *
    • YUR - Yugoslavian Reformed Dinar (1992–1993)
    • + *
    • ZWN - ZWN
    • + *
    • ZRN - Zairean New Zaire (1993–1998)
    • + *
    • ZRZ - Zairean Zaire (1971–1993)
    • + *
    • ZMW - Zambian Kwacha
    • + *
    • ZMK - Zambian Kwacha (1968–2012)
    • + *
    • ZWD - Zimbabwean Dollar (1980–2008)
    • + *
    • ZWR - Zimbabwean Dollar (2008)
    • + *
    • ZWL - Zimbabwean Dollar (2009)
    • + *
    + */ + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public Builder currency(Optional currency) { + this.currency = currency; + return this; + } + + public Builder currency(SalesOrderRequestRequestCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

    The exchange rate applied if the order currency differs from the base currency.

    + */ + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public Builder exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + public Builder exchangeRate(String exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + /** + *

    The subsidiary associated with the order.

    + */ + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public Builder company(Optional company) { + this.company = company; + return this; + } + + public Builder company(SalesOrderRequestRequestCompany company) { + this.company = Optional.ofNullable(company); + return this; + } + + /** + *

    The status of the sales order.

    + *
      + *
    • DRAFT - DRAFT
    • + *
    • PENDING_APPROVAL - PENDING_APPROVAL
    • + *
    • OPEN - OPEN
    • + *
    • PARTIALLY_COMPLETED - PARTIALLY_COMPLETED
    • + *
    • COMPLETED - COMPLETED
    • + *
    • CLOSED - CLOSED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(SalesOrderRequestRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    The payment terms applied to this order.

    + */ + @JsonSetter(value = "payment_term", nulls = Nulls.SKIP) + public Builder paymentTerm(Optional paymentTerm) { + this.paymentTerm = paymentTerm; + return this; + } + + public Builder paymentTerm(SalesOrderRequestRequestPaymentTerm paymentTerm) { + this.paymentTerm = Optional.ofNullable(paymentTerm); + return this; + } + + /** + *

    Notes or comments attached to the order.

    + */ + @JsonSetter(value = "memo", nulls = Nulls.SKIP) + public Builder memo(Optional memo) { + this.memo = memo; + return this; + } + + public Builder memo(String memo) { + this.memo = Optional.ofNullable(memo); + return this; + } + + /** + *

    The shipping address for the order.

    + */ + @JsonSetter(value = "shipping_address", nulls = Nulls.SKIP) + public Builder shippingAddress(Optional shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + public Builder shippingAddress(SalesOrderRequestRequestShippingAddress shippingAddress) { + this.shippingAddress = Optional.ofNullable(shippingAddress); + return this; + } + + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) + public Builder trackingCategories( + Optional>> trackingCategories) { + this.trackingCategories = trackingCategories; + return this; + } + + public Builder trackingCategories( + List> trackingCategories) { + this.trackingCategories = Optional.ofNullable(trackingCategories); + return this; + } + + /** + *

    The date the sales order was issued.

    + */ + @JsonSetter(value = "issue_date", nulls = Nulls.SKIP) + public Builder issueDate(Optional issueDate) { + this.issueDate = issueDate; + return this; + } + + public Builder issueDate(OffsetDateTime issueDate) { + this.issueDate = Optional.ofNullable(issueDate); + return this; + } + + /** + *

    The human-readable sales order number or transaction reference.

    + */ + @JsonSetter(value = "transaction_number", nulls = Nulls.SKIP) + public Builder transactionNumber(Optional transactionNumber) { + this.transactionNumber = transactionNumber; + return this; + } + + public Builder transactionNumber(String transactionNumber) { + this.transactionNumber = Optional.ofNullable(transactionNumber); + return this; + } + + /** + *

    Total amount of order.

    + */ + @JsonSetter(value = "total", nulls = Nulls.SKIP) + public Builder total(Optional total) { + this.total = total; + return this; + } + + public Builder total(Double total) { + this.total = Optional.ofNullable(total); + return this; + } + + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public Builder lines(Optional> lines) { + this.lines = lines; + return this; + } + + public Builder lines(List lines) { + this.lines = Optional.ofNullable(lines); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + public SalesOrderRequestRequest build() { + return new SalesOrderRequestRequest( + customer, + currency, + exchangeRate, + company, + status, + paymentTerm, + memo, + shippingAddress, + trackingCategories, + issueDate, + transactionNumber, + total, + lines, + integrationParams, + linkedAccountParams, + remoteFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCompany.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCompany.java new file mode 100644 index 000000000..e180105d1 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCompany.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestCompany.Deserializer.class) +public final class SalesOrderRequestRequestCompany { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestCompany && equalTo((SalesOrderRequestRequestCompany) other); + } + + private boolean equalTo(SalesOrderRequestRequestCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestCompany of(String value) { + return new SalesOrderRequestRequestCompany(value, 0); + } + + public static SalesOrderRequestRequestCompany of(CompanyInfo value) { + return new SalesOrderRequestRequestCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestCompany.class); + } + + @java.lang.Override + public SalesOrderRequestRequestCompany deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCurrency.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCurrency.java new file mode 100644 index 000000000..bac1e145d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCurrency.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestCurrency.Deserializer.class) +public final class SalesOrderRequestRequestCurrency { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestCurrency(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TransactionCurrencyEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestCurrency && equalTo((SalesOrderRequestRequestCurrency) other); + } + + private boolean equalTo(SalesOrderRequestRequestCurrency other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestCurrency of(TransactionCurrencyEnum value) { + return new SalesOrderRequestRequestCurrency(value, 0); + } + + public static SalesOrderRequestRequestCurrency of(String value) { + return new SalesOrderRequestRequestCurrency(value, 1); + } + + public interface Visitor { + T visit(TransactionCurrencyEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestCurrency.class); + } + + @java.lang.Override + public SalesOrderRequestRequestCurrency deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionCurrencyEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCustomer.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCustomer.java new file mode 100644 index 000000000..e0446da59 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestCustomer.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestCustomer.Deserializer.class) +public final class SalesOrderRequestRequestCustomer { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestCustomer(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestCustomer && equalTo((SalesOrderRequestRequestCustomer) other); + } + + private boolean equalTo(SalesOrderRequestRequestCustomer other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestCustomer of(String value) { + return new SalesOrderRequestRequestCustomer(value, 0); + } + + public static SalesOrderRequestRequestCustomer of(Contact value) { + return new SalesOrderRequestRequestCustomer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestCustomer.class); + } + + @java.lang.Override + public SalesOrderRequestRequestCustomer deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Contact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestLinesItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestLinesItem.java new file mode 100644 index 000000000..d455c44a4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestLinesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestLinesItem.Deserializer.class) +public final class SalesOrderRequestRequestLinesItem { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((SalesOrderLineRequest) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestLinesItem && equalTo((SalesOrderRequestRequestLinesItem) other); + } + + private boolean equalTo(SalesOrderRequestRequestLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestLinesItem of(String value) { + return new SalesOrderRequestRequestLinesItem(value, 0); + } + + public static SalesOrderRequestRequestLinesItem of(SalesOrderLineRequest value) { + return new SalesOrderRequestRequestLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(SalesOrderLineRequest value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestLinesItem.class); + } + + @java.lang.Override + public SalesOrderRequestRequestLinesItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrderLineRequest.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestPaymentTerm.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestPaymentTerm.java new file mode 100644 index 000000000..212eea081 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestPaymentTerm.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestPaymentTerm.Deserializer.class) +public final class SalesOrderRequestRequestPaymentTerm { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestPaymentTerm(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((PaymentTerm) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestPaymentTerm + && equalTo((SalesOrderRequestRequestPaymentTerm) other); + } + + private boolean equalTo(SalesOrderRequestRequestPaymentTerm other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestPaymentTerm of(String value) { + return new SalesOrderRequestRequestPaymentTerm(value, 0); + } + + public static SalesOrderRequestRequestPaymentTerm of(PaymentTerm value) { + return new SalesOrderRequestRequestPaymentTerm(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(PaymentTerm value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestPaymentTerm.class); + } + + @java.lang.Override + public SalesOrderRequestRequestPaymentTerm deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PaymentTerm.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestShippingAddress.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestShippingAddress.java new file mode 100644 index 000000000..eea95cf52 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestShippingAddress.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestShippingAddress.Deserializer.class) +public final class SalesOrderRequestRequestShippingAddress { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestShippingAddress(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Address) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestShippingAddress + && equalTo((SalesOrderRequestRequestShippingAddress) other); + } + + private boolean equalTo(SalesOrderRequestRequestShippingAddress other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestShippingAddress of(String value) { + return new SalesOrderRequestRequestShippingAddress(value, 0); + } + + public static SalesOrderRequestRequestShippingAddress of(Address value) { + return new SalesOrderRequestRequestShippingAddress(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Address value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestShippingAddress.class); + } + + @java.lang.Override + public SalesOrderRequestRequestShippingAddress deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Address.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestStatus.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestStatus.java new file mode 100644 index 000000000..f5c762613 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestStatus.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestStatus.Deserializer.class) +public final class SalesOrderRequestRequestStatus { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((SalesOrderStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestStatus && equalTo((SalesOrderRequestRequestStatus) other); + } + + private boolean equalTo(SalesOrderRequestRequestStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestStatus of(SalesOrderStatusEnum value) { + return new SalesOrderRequestRequestStatus(value, 0); + } + + public static SalesOrderRequestRequestStatus of(String value) { + return new SalesOrderRequestRequestStatus(value, 1); + } + + public interface Visitor { + T visit(SalesOrderStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestStatus.class); + } + + @java.lang.Override + public SalesOrderRequestRequestStatus deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrderStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestTrackingCategoriesItem.java new file mode 100644 index 000000000..1e84232b4 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderRequestRequestTrackingCategoriesItem.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderRequestRequestTrackingCategoriesItem.Deserializer.class) +public final class SalesOrderRequestRequestTrackingCategoriesItem { + private final Object value; + + private final int type; + + private SalesOrderRequestRequestTrackingCategoriesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderRequestRequestTrackingCategoriesItem + && equalTo((SalesOrderRequestRequestTrackingCategoriesItem) other); + } + + private boolean equalTo(SalesOrderRequestRequestTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderRequestRequestTrackingCategoriesItem of(String value) { + return new SalesOrderRequestRequestTrackingCategoriesItem(value, 0); + } + + public static SalesOrderRequestRequestTrackingCategoriesItem of(TrackingCategory value) { + return new SalesOrderRequestRequestTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderRequestRequestTrackingCategoriesItem.class); + } + + @java.lang.Override + public SalesOrderRequestRequestTrackingCategoriesItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TrackingCategory.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderResponse.java b/src/main/java/com/merge/api/accounting/types/SalesOrderResponse.java new file mode 100644 index 000000000..2fb254fcc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderResponse.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrderResponse.Builder.class) +public final class SalesOrderResponse { + private final SalesOrder model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private SalesOrderResponse( + SalesOrder model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public SalesOrder getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderResponse && equalTo((SalesOrderResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrderResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull SalesOrder model); + + Builder from(SalesOrderResponse other); + } + + public interface _FinalStage { + SalesOrderResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private SalesOrder model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SalesOrderResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull SalesOrder model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public SalesOrderResponse build() { + return new SalesOrderResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderShippingAddress.java b/src/main/java/com/merge/api/accounting/types/SalesOrderShippingAddress.java new file mode 100644 index 000000000..53c730bcd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderShippingAddress.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderShippingAddress.Deserializer.class) +public final class SalesOrderShippingAddress { + private final Object value; + + private final int type; + + private SalesOrderShippingAddress(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Address) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderShippingAddress && equalTo((SalesOrderShippingAddress) other); + } + + private boolean equalTo(SalesOrderShippingAddress other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderShippingAddress of(String value) { + return new SalesOrderShippingAddress(value, 0); + } + + public static SalesOrderShippingAddress of(Address value) { + return new SalesOrderShippingAddress(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Address value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderShippingAddress.class); + } + + @java.lang.Override + public SalesOrderShippingAddress deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Address.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderStatus.java b/src/main/java/com/merge/api/accounting/types/SalesOrderStatus.java new file mode 100644 index 000000000..72ac8ae82 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderStatus.Deserializer.class) +public final class SalesOrderStatus { + private final Object value; + + private final int type; + + private SalesOrderStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((SalesOrderStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderStatus && equalTo((SalesOrderStatus) other); + } + + private boolean equalTo(SalesOrderStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderStatus of(SalesOrderStatusEnum value) { + return new SalesOrderStatus(value, 0); + } + + public static SalesOrderStatus of(String value) { + return new SalesOrderStatus(value, 1); + } + + public interface Visitor { + T visit(SalesOrderStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderStatus.class); + } + + @java.lang.Override + public SalesOrderStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, SalesOrderStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderStatusEnum.java b/src/main/java/com/merge/api/accounting/types/SalesOrderStatusEnum.java new file mode 100644 index 000000000..ef5d9a24a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderStatusEnum.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SalesOrderStatusEnum { + public static final SalesOrderStatusEnum PENDING_APPROVAL = + new SalesOrderStatusEnum(Value.PENDING_APPROVAL, "PENDING_APPROVAL"); + + public static final SalesOrderStatusEnum CLOSED = new SalesOrderStatusEnum(Value.CLOSED, "CLOSED"); + + public static final SalesOrderStatusEnum DRAFT = new SalesOrderStatusEnum(Value.DRAFT, "DRAFT"); + + public static final SalesOrderStatusEnum OPEN = new SalesOrderStatusEnum(Value.OPEN, "OPEN"); + + public static final SalesOrderStatusEnum PARTIALLY_COMPLETED = + new SalesOrderStatusEnum(Value.PARTIALLY_COMPLETED, "PARTIALLY_COMPLETED"); + + public static final SalesOrderStatusEnum COMPLETED = new SalesOrderStatusEnum(Value.COMPLETED, "COMPLETED"); + + private final Value value; + + private final String string; + + SalesOrderStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SalesOrderStatusEnum && this.string.equals(((SalesOrderStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PENDING_APPROVAL: + return visitor.visitPendingApproval(); + case CLOSED: + return visitor.visitClosed(); + case DRAFT: + return visitor.visitDraft(); + case OPEN: + return visitor.visitOpen(); + case PARTIALLY_COMPLETED: + return visitor.visitPartiallyCompleted(); + case COMPLETED: + return visitor.visitCompleted(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SalesOrderStatusEnum valueOf(String value) { + switch (value) { + case "PENDING_APPROVAL": + return PENDING_APPROVAL; + case "CLOSED": + return CLOSED; + case "DRAFT": + return DRAFT; + case "OPEN": + return OPEN; + case "PARTIALLY_COMPLETED": + return PARTIALLY_COMPLETED; + case "COMPLETED": + return COMPLETED; + default: + return new SalesOrderStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + DRAFT, + + PENDING_APPROVAL, + + OPEN, + + PARTIALLY_COMPLETED, + + COMPLETED, + + CLOSED, + + UNKNOWN + } + + public interface Visitor { + T visitDraft(); + + T visitPendingApproval(); + + T visitOpen(); + + T visitPartiallyCompleted(); + + T visitCompleted(); + + T visitClosed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrderTrackingCategoriesItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrderTrackingCategoriesItem.java new file mode 100644 index 000000000..eb58c91c9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrderTrackingCategoriesItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SalesOrderTrackingCategoriesItem.Deserializer.class) +public final class SalesOrderTrackingCategoriesItem { + private final Object value; + + private final int type; + + private SalesOrderTrackingCategoriesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TrackingCategory) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrderTrackingCategoriesItem && equalTo((SalesOrderTrackingCategoriesItem) other); + } + + private boolean equalTo(SalesOrderTrackingCategoriesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SalesOrderTrackingCategoriesItem of(String value) { + return new SalesOrderTrackingCategoriesItem(value, 0); + } + + public static SalesOrderTrackingCategoriesItem of(TrackingCategory value) { + return new SalesOrderTrackingCategoriesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TrackingCategory value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SalesOrderTrackingCategoriesItem.class); + } + + @java.lang.Override + public SalesOrderTrackingCategoriesItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TrackingCategory.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrdersLinesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrdersLinesRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..0a8df0428 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrdersLinesRemoteFieldClassesListRequest.java @@ -0,0 +1,299 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrdersLinesRemoteFieldClassesListRequest.Builder.class) +public final class SalesOrdersLinesRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional isCustom; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SalesOrdersLinesRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonModelField, + Optional isCustom, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.isCustom = isCustom; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return If provided, will only return remote fields classes with this is_custom value + */ + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrdersLinesRemoteFieldClassesListRequest + && equalTo((SalesOrdersLinesRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrdersLinesRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && isCustom.equals(other.isCustom) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.isCustom, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrdersLinesRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + isCustom(other.getIsCustom()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, will only return remote field classes with this is_common_model_field value

    + */ + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + /** + *

    If provided, will only return remote fields classes with this is_custom value

    + */ + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SalesOrdersLinesRemoteFieldClassesListRequest build() { + return new SalesOrdersLinesRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + isCustom, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrdersListRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrdersListRequest.java new file mode 100644 index 000000000..d861586a8 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrdersListRequest.java @@ -0,0 +1,626 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrdersListRequest.Builder.class) +public final class SalesOrdersListRequest { + private final Optional> expand; + + private final Optional companyId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional issueDateAfter; + + private final Optional issueDateBefore; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteFields; + + private final Optional remoteId; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private SalesOrdersListRequest( + Optional> expand, + Optional companyId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional issueDateAfter, + Optional issueDateBefore, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteFields, + Optional remoteId, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.companyId = companyId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.issueDateAfter = issueDateAfter; + this.issueDateBefore = issueDateBefore; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteFields = remoteFields; + this.remoteId = remoteId; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return sales orders for this company. + */ + @JsonProperty("company_id") + public Optional getCompanyId() { + return companyId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("issue_date_after") + public Optional getIssueDateAfter() { + return issueDateAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("issue_date_before") + public Optional getIssueDateBefore() { + return issueDateBefore; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return 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 + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrdersListRequest && equalTo((SalesOrdersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrdersListRequest other) { + return expand.equals(other.expand) + && companyId.equals(other.companyId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && issueDateAfter.equals(other.issueDateAfter) + && issueDateBefore.equals(other.issueDateBefore) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteFields.equals(other.remoteFields) + && remoteId.equals(other.remoteId) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.companyId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.issueDateAfter, + this.issueDateBefore, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteFields, + this.remoteId, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional companyId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional issueDateAfter = Optional.empty(); + + private Optional issueDateBefore = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrdersListRequest other) { + expand(other.getExpand()); + companyId(other.getCompanyId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + issueDateAfter(other.getIssueDateAfter()); + issueDateBefore(other.getIssueDateBefore()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteFields(other.getRemoteFields()); + remoteId(other.getRemoteId()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(SalesOrdersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    If provided, will only return sales orders for this company.

    + */ + @JsonSetter(value = "company_id", nulls = Nulls.SKIP) + public Builder companyId(Optional companyId) { + this.companyId = companyId; + return this; + } + + public Builder companyId(String companyId) { + this.companyId = Optional.ofNullable(companyId); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

    + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "issue_date_after", nulls = Nulls.SKIP) + public Builder issueDateAfter(Optional issueDateAfter) { + this.issueDateAfter = issueDateAfter; + return this; + } + + public Builder issueDateAfter(OffsetDateTime issueDateAfter) { + this.issueDateAfter = Optional.ofNullable(issueDateAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "issue_date_before", nulls = Nulls.SKIP) + public Builder issueDateBefore(Optional issueDateBefore) { + this.issueDateBefore = issueDateBefore; + return this; + } + + public Builder issueDateBefore(OffsetDateTime issueDateBefore) { + this.issueDateBefore = Optional.ofNullable(issueDateBefore); + return this; + } + + /** + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    Deprecated. Use show_enum_origins.

    + */ + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    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

    + */ + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public SalesOrdersListRequest build() { + return new SalesOrdersListRequest( + expand, + companyId, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeRemoteFields, + includeShellData, + issueDateAfter, + issueDateBefore, + modifiedAfter, + modifiedBefore, + pageSize, + remoteFields, + remoteId, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrdersListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrdersListRequestExpandItem.java new file mode 100644 index 000000000..03124fa76 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrdersListRequestExpandItem.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SalesOrdersListRequestExpandItem { + public static final SalesOrdersListRequestExpandItem TRACKING_CATEGORIES = + new SalesOrdersListRequestExpandItem(Value.TRACKING_CATEGORIES, "tracking_categories"); + + public static final SalesOrdersListRequestExpandItem SHIPPING_ADDRESS = + new SalesOrdersListRequestExpandItem(Value.SHIPPING_ADDRESS, "shipping_address"); + + public static final SalesOrdersListRequestExpandItem CUSTOMER = + new SalesOrdersListRequestExpandItem(Value.CUSTOMER, "customer"); + + public static final SalesOrdersListRequestExpandItem PAYMENT_TERM = + new SalesOrdersListRequestExpandItem(Value.PAYMENT_TERM, "payment_term"); + + public static final SalesOrdersListRequestExpandItem LINES = + new SalesOrdersListRequestExpandItem(Value.LINES, "lines"); + + public static final SalesOrdersListRequestExpandItem COMPANY = + new SalesOrdersListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + SalesOrdersListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SalesOrdersListRequestExpandItem + && this.string.equals(((SalesOrdersListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TRACKING_CATEGORIES: + return visitor.visitTrackingCategories(); + case SHIPPING_ADDRESS: + return visitor.visitShippingAddress(); + case CUSTOMER: + return visitor.visitCustomer(); + case PAYMENT_TERM: + return visitor.visitPaymentTerm(); + case LINES: + return visitor.visitLines(); + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SalesOrdersListRequestExpandItem valueOf(String value) { + switch (value) { + case "tracking_categories": + return TRACKING_CATEGORIES; + case "shipping_address": + return SHIPPING_ADDRESS; + case "customer": + return CUSTOMER; + case "payment_term": + return PAYMENT_TERM; + case "lines": + return LINES; + case "company": + return COMPANY; + default: + return new SalesOrdersListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + CUSTOMER, + + LINES, + + PAYMENT_TERM, + + SHIPPING_ADDRESS, + + TRACKING_CATEGORIES, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitCustomer(); + + T visitLines(); + + T visitPaymentTerm(); + + T visitShippingAddress(); + + T visitTrackingCategories(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrdersRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrdersRemoteFieldClassesListRequest.java new file mode 100644 index 000000000..4862bb67f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrdersRemoteFieldClassesListRequest.java @@ -0,0 +1,299 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrdersRemoteFieldClassesListRequest.Builder.class) +public final class SalesOrdersRemoteFieldClassesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional isCommonModelField; + + private final Optional isCustom; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SalesOrdersRemoteFieldClassesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional isCommonModelField, + Optional isCustom, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.isCommonModelField = isCommonModelField; + this.isCustom = isCustom; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, will only return remote field classes with this is_common_model_field value + */ + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + + /** + * @return If provided, will only return remote fields classes with this is_custom value + */ + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrdersRemoteFieldClassesListRequest + && equalTo((SalesOrdersRemoteFieldClassesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrdersRemoteFieldClassesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && isCommonModelField.equals(other.isCommonModelField) + && isCustom.equals(other.isCustom) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.isCommonModelField, + this.isCustom, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional isCommonModelField = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrdersRemoteFieldClassesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + isCommonModelField(other.getIsCommonModelField()); + isCustom(other.getIsCustom()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, will only return remote field classes with this is_common_model_field value

    + */ + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + + /** + *

    If provided, will only return remote fields classes with this is_custom value

    + */ + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public Builder isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + public Builder isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SalesOrdersRemoteFieldClassesListRequest build() { + return new SalesOrdersRemoteFieldClassesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + isCommonModelField, + isCustom, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrdersRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/SalesOrdersRetrieveRequest.java new file mode 100644 index 000000000..8b6d74e84 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrdersRetrieveRequest.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SalesOrdersRetrieveRequest.Builder.class) +public final class SalesOrdersRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private SalesOrdersRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeRemoteFields, + Optional includeShellData, + Optional remoteFields, + Optional showEnumOrigins, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return 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 + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SalesOrdersRetrieveRequest && equalTo((SalesOrdersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SalesOrdersRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.includeRemoteData, + this.includeRemoteFields, + this.includeShellData, + this.remoteFields, + this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SalesOrdersRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(SalesOrdersRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

    + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    Deprecated. Use show_enum_origins.

    + */ + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(String remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + /** + *

    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

    + */ + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public SalesOrdersRetrieveRequest build() { + return new SalesOrdersRetrieveRequest( + expand, + includeRemoteData, + includeRemoteFields, + includeShellData, + remoteFields, + showEnumOrigins, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SalesOrdersRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/SalesOrdersRetrieveRequestExpandItem.java new file mode 100644 index 000000000..7a6e35d0f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/SalesOrdersRetrieveRequestExpandItem.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SalesOrdersRetrieveRequestExpandItem { + public static final SalesOrdersRetrieveRequestExpandItem TRACKING_CATEGORIES = + new SalesOrdersRetrieveRequestExpandItem(Value.TRACKING_CATEGORIES, "tracking_categories"); + + public static final SalesOrdersRetrieveRequestExpandItem SHIPPING_ADDRESS = + new SalesOrdersRetrieveRequestExpandItem(Value.SHIPPING_ADDRESS, "shipping_address"); + + public static final SalesOrdersRetrieveRequestExpandItem CUSTOMER = + new SalesOrdersRetrieveRequestExpandItem(Value.CUSTOMER, "customer"); + + public static final SalesOrdersRetrieveRequestExpandItem PAYMENT_TERM = + new SalesOrdersRetrieveRequestExpandItem(Value.PAYMENT_TERM, "payment_term"); + + public static final SalesOrdersRetrieveRequestExpandItem LINES = + new SalesOrdersRetrieveRequestExpandItem(Value.LINES, "lines"); + + public static final SalesOrdersRetrieveRequestExpandItem COMPANY = + new SalesOrdersRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + SalesOrdersRetrieveRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SalesOrdersRetrieveRequestExpandItem + && this.string.equals(((SalesOrdersRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TRACKING_CATEGORIES: + return visitor.visitTrackingCategories(); + case SHIPPING_ADDRESS: + return visitor.visitShippingAddress(); + case CUSTOMER: + return visitor.visitCustomer(); + case PAYMENT_TERM: + return visitor.visitPaymentTerm(); + case LINES: + return visitor.visitLines(); + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SalesOrdersRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "tracking_categories": + return TRACKING_CATEGORIES; + case "shipping_address": + return SHIPPING_ADDRESS; + case "customer": + return CUSTOMER; + case "payment_term": + return PAYMENT_TERM; + case "lines": + return LINES; + case "company": + return COMPANY; + default: + return new SalesOrdersRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + CUSTOMER, + + LINES, + + PAYMENT_TERM, + + SHIPPING_ADDRESS, + + TRACKING_CATEGORIES, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitCustomer(); + + T visitLines(); + + T visitPaymentTerm(); + + T visitShippingAddress(); + + T visitTrackingCategories(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/accounting/types/SyncStatusListRequest.java index e95623702..b37be04c4 100644 --- a/src/main/java/com/merge/api/accounting/types/SyncStatusListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/SyncStatusListRequest.java @@ -42,7 +42,7 @@ public Optional getCursor() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -110,7 +110,7 @@ public Builder cursor(String cursor) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/TaxRate.java b/src/main/java/com/merge/api/accounting/types/TaxRate.java index f40bc1482..72f721f0c 100644 --- a/src/main/java/com/merge/api/accounting/types/TaxRate.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRate.java @@ -47,7 +47,7 @@ public final class TaxRate { private final Optional effectiveTaxRate; - private final Optional> taxComponents; + private final Optional> taxComponents; private final Optional remoteWasDeleted; @@ -70,7 +70,7 @@ private TaxRate( Optional country, Optional totalTaxRate, Optional effectiveTaxRate, - Optional> taxComponents, + Optional> taxComponents, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -195,7 +195,7 @@ public Optional getEffectiveTaxRate() { * @return The related tax components of the tax rate. */ @JsonProperty("tax_components") - public Optional> getTaxComponents() { + public Optional> getTaxComponents() { return taxComponents; } @@ -303,7 +303,7 @@ public static final class Builder { private Optional effectiveTaxRate = Optional.empty(); - private Optional> taxComponents = Optional.empty(); + private Optional> taxComponents = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -509,12 +509,12 @@ public Builder effectiveTaxRate(Double effectiveTaxRate) { *

    The related tax components of the tax rate.

    */ @JsonSetter(value = "tax_components", nulls = Nulls.SKIP) - public Builder taxComponents(Optional> taxComponents) { + public Builder taxComponents(Optional> taxComponents) { this.taxComponents = taxComponents; return this; } - public Builder taxComponents(List taxComponents) { + public Builder taxComponents(List taxComponents) { this.taxComponents = Optional.ofNullable(taxComponents); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/TaxRatesListRequest.java b/src/main/java/com/merge/api/accounting/types/TaxRatesListRequest.java index 8a2a3f07c..727541554 100644 --- a/src/main/java/com/merge/api/accounting/types/TaxRatesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRatesListRequest.java @@ -171,7 +171,7 @@ public Optional getName() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -450,7 +450,7 @@ public Builder name(String name) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java index 5ccfd48f7..13206eefc 100644 --- a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java @@ -195,7 +195,7 @@ public Optional getName() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -532,7 +532,7 @@ public Builder name(String name) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategory.java b/src/main/java/com/merge/api/accounting/types/TrackingCategory.java index 595e44f3f..fa012150e 100644 --- a/src/main/java/com/merge/api/accounting/types/TrackingCategory.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategory.java @@ -44,6 +44,8 @@ public final class TrackingCategory { private final Optional> fieldMappings; + private final Optional trackingCategoryUrl; + private final Map additionalProperties; private TrackingCategory( @@ -58,6 +60,7 @@ private TrackingCategory( Optional company, Optional remoteWasDeleted, Optional> fieldMappings, + Optional trackingCategoryUrl, Map additionalProperties) { this.id = id; this.remoteId = remoteId; @@ -70,6 +73,7 @@ private TrackingCategory( this.company = company; this.remoteWasDeleted = remoteWasDeleted; this.fieldMappings = fieldMappings; + this.trackingCategoryUrl = trackingCategoryUrl; this.additionalProperties = additionalProperties; } @@ -160,6 +164,14 @@ public Optional> getFieldMappings() { return fieldMappings; } + /** + * @return The 3rd party URL of the tracking category. + */ + @JsonProperty("tracking_category_url") + public Optional getTrackingCategoryUrl() { + return trackingCategoryUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -182,7 +194,8 @@ private boolean equalTo(TrackingCategory other) { && parentCategory.equals(other.parentCategory) && company.equals(other.company) && remoteWasDeleted.equals(other.remoteWasDeleted) - && fieldMappings.equals(other.fieldMappings); + && fieldMappings.equals(other.fieldMappings) + && trackingCategoryUrl.equals(other.trackingCategoryUrl); } @java.lang.Override @@ -198,7 +211,8 @@ public int hashCode() { this.parentCategory, this.company, this.remoteWasDeleted, - this.fieldMappings); + this.fieldMappings, + this.trackingCategoryUrl); } @java.lang.Override @@ -234,6 +248,8 @@ public static final class Builder { private Optional> fieldMappings = Optional.empty(); + private Optional trackingCategoryUrl = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -251,6 +267,7 @@ public Builder from(TrackingCategory other) { company(other.getCompany()); remoteWasDeleted(other.getRemoteWasDeleted()); fieldMappings(other.getFieldMappings()); + trackingCategoryUrl(other.getTrackingCategoryUrl()); return this; } @@ -407,6 +424,20 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + /** + *

    The 3rd party URL of the tracking category.

    + */ + @JsonSetter(value = "tracking_category_url", nulls = Nulls.SKIP) + public Builder trackingCategoryUrl(Optional trackingCategoryUrl) { + this.trackingCategoryUrl = trackingCategoryUrl; + return this; + } + + public Builder trackingCategoryUrl(String trackingCategoryUrl) { + this.trackingCategoryUrl = Optional.ofNullable(trackingCategoryUrl); + return this; + } + public TrackingCategory build() { return new TrackingCategory( id, @@ -420,6 +451,7 @@ public TrackingCategory build() { company, remoteWasDeleted, fieldMappings, + trackingCategoryUrl, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/Transaction.java b/src/main/java/com/merge/api/accounting/types/Transaction.java index eecc843ef..c3c5b7788 100644 --- a/src/main/java/com/merge/api/accounting/types/Transaction.java +++ b/src/main/java/com/merge/api/accounting/types/Transaction.java @@ -49,11 +49,11 @@ public final class Transaction { private final Optional exchangeRate; - private final Optional company; + private final Optional company; private final Optional>> trackingCategories; - private final Optional> lineItems; + private final Optional> lineItems; private final Optional remoteWasDeleted; @@ -63,6 +63,8 @@ public final class Transaction { private final Optional> remoteData; + private final Optional transactionUrl; + private final Map additionalProperties; private Transaction( @@ -79,13 +81,14 @@ private Transaction( Optional totalAmount, Optional currency, Optional exchangeRate, - Optional company, + Optional company, Optional>> trackingCategories, - Optional> lineItems, + Optional> lineItems, Optional remoteWasDeleted, Optional accountingPeriod, Optional> fieldMappings, Optional> remoteData, + Optional transactionUrl, Map additionalProperties) { this.id = id; this.remoteId = remoteId; @@ -107,6 +110,7 @@ private Transaction( this.accountingPeriod = accountingPeriod; this.fieldMappings = fieldMappings; this.remoteData = remoteData; + this.transactionUrl = transactionUrl; this.additionalProperties = additionalProperties; } @@ -523,7 +527,7 @@ public Optional getExchangeRate() { * @return The company the transaction belongs to. */ @JsonProperty("company") - public Optional getCompany() { + public Optional getCompany() { return company; } @@ -533,7 +537,7 @@ public Optional>> getTrackingCa } @JsonProperty("line_items") - public Optional> getLineItems() { + public Optional> getLineItems() { return lineItems; } @@ -563,6 +567,14 @@ public Optional> getRemoteData() { return remoteData; } + /** + * @return The 3rd party URL of the transaction. + */ + @JsonProperty("transaction_url") + public Optional getTransactionUrl() { + return transactionUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -594,7 +606,8 @@ private boolean equalTo(Transaction other) { && remoteWasDeleted.equals(other.remoteWasDeleted) && accountingPeriod.equals(other.accountingPeriod) && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); + && remoteData.equals(other.remoteData) + && transactionUrl.equals(other.transactionUrl); } @java.lang.Override @@ -619,7 +632,8 @@ public int hashCode() { this.remoteWasDeleted, this.accountingPeriod, this.fieldMappings, - this.remoteData); + this.remoteData, + this.transactionUrl); } @java.lang.Override @@ -659,11 +673,11 @@ public static final class Builder { private Optional exchangeRate = Optional.empty(); - private Optional company = Optional.empty(); + private Optional company = Optional.empty(); private Optional>> trackingCategories = Optional.empty(); - private Optional> lineItems = Optional.empty(); + private Optional> lineItems = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -673,6 +687,8 @@ public static final class Builder { private Optional> remoteData = Optional.empty(); + private Optional transactionUrl = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -699,6 +715,7 @@ public Builder from(Transaction other) { accountingPeriod(other.getAccountingPeriod()); fieldMappings(other.getFieldMappings()); remoteData(other.getRemoteData()); + transactionUrl(other.getTransactionUrl()); return this; } @@ -1193,12 +1210,12 @@ public Builder exchangeRate(String exchangeRate) { *

    The company the transaction belongs to.

    */ @JsonSetter(value = "company", nulls = Nulls.SKIP) - public Builder company(Optional company) { + public Builder company(Optional company) { this.company = company; return this; } - public Builder company(String company) { + public Builder company(TransactionCompany company) { this.company = Optional.ofNullable(company); return this; } @@ -1216,12 +1233,12 @@ public Builder trackingCategories(List> lineItems) { + public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; return this; } - public Builder lineItems(List lineItems) { + public Builder lineItems(List lineItems) { this.lineItems = Optional.ofNullable(lineItems); return this; } @@ -1276,6 +1293,20 @@ public Builder remoteData(List remoteData) { return this; } + /** + *

    The 3rd party URL of the transaction.

    + */ + @JsonSetter(value = "transaction_url", nulls = Nulls.SKIP) + public Builder transactionUrl(Optional transactionUrl) { + this.transactionUrl = transactionUrl; + return this; + } + + public Builder transactionUrl(String transactionUrl) { + this.transactionUrl = Optional.ofNullable(transactionUrl); + return this; + } + public Transaction build() { return new Transaction( id, @@ -1298,6 +1329,7 @@ public Transaction build() { accountingPeriod, fieldMappings, remoteData, + transactionUrl, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/TransactionCompany.java b/src/main/java/com/merge/api/accounting/types/TransactionCompany.java new file mode 100644 index 000000000..56ca42a6c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TransactionCompany.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransactionCompany.Deserializer.class) +public final class TransactionCompany { + private final Object value; + + private final int type; + + private TransactionCompany(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((CompanyInfo) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionCompany && equalTo((TransactionCompany) other); + } + + private boolean equalTo(TransactionCompany other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TransactionCompany of(String value) { + return new TransactionCompany(value, 0); + } + + public static TransactionCompany of(CompanyInfo value) { + return new TransactionCompany(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(CompanyInfo value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransactionCompany.class); + } + + @java.lang.Override + public TransactionCompany deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CompanyInfo.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TransactionLineItemsItem.java b/src/main/java/com/merge/api/accounting/types/TransactionLineItemsItem.java new file mode 100644 index 000000000..7f4b91881 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TransactionLineItemsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TransactionLineItemsItem.Deserializer.class) +public final class TransactionLineItemsItem { + private final Object value; + + private final int type; + + private TransactionLineItemsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((TransactionLineItem) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TransactionLineItemsItem && equalTo((TransactionLineItemsItem) other); + } + + private boolean equalTo(TransactionLineItemsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TransactionLineItemsItem of(String value) { + return new TransactionLineItemsItem(value, 0); + } + + public static TransactionLineItemsItem of(TransactionLineItem value) { + return new TransactionLineItemsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(TransactionLineItem value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TransactionLineItemsItem.class); + } + + @java.lang.Override + public TransactionLineItemsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TransactionLineItem.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TransactionsListRequest.java b/src/main/java/com/merge/api/accounting/types/TransactionsListRequest.java index de7923c65..8a74af4c1 100644 --- a/src/main/java/com/merge/api/accounting/types/TransactionsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionsListRequest.java @@ -167,7 +167,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -453,7 +453,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/TransactionsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TransactionsListRequestExpandItem.java index 988b2f696..898c02288 100644 --- a/src/main/java/com/merge/api/accounting/types/TransactionsListRequestExpandItem.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionsListRequestExpandItem.java @@ -22,6 +22,9 @@ public final class TransactionsListRequestExpandItem { public static final TransactionsListRequestExpandItem CONTACT = new TransactionsListRequestExpandItem(Value.CONTACT, "contact"); + public static final TransactionsListRequestExpandItem COMPANY = + new TransactionsListRequestExpandItem(Value.COMPANY, "company"); + private final Value value; private final String string; @@ -65,6 +68,8 @@ public T visit(Visitor visitor) { return visitor.visitAccount(); case CONTACT: return visitor.visitContact(); + case COMPANY: + return visitor.visitCompany(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -84,6 +89,8 @@ public static TransactionsListRequestExpandItem valueOf(String value) { return ACCOUNT; case "contact": return CONTACT; + case "company": + return COMPANY; default: return new TransactionsListRequestExpandItem(Value.UNKNOWN, value); } @@ -94,6 +101,8 @@ public enum Value { ACCOUNTING_PERIOD, + COMPANY, + CONTACT, LINE_ITEMS, @@ -108,6 +117,8 @@ public interface Visitor { T visitAccountingPeriod(); + T visitCompany(); + T visitContact(); T visitLineItems(); diff --git a/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequestExpandItem.java index a2a4f8075..82d5afcb8 100644 --- a/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequestExpandItem.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionsRetrieveRequestExpandItem.java @@ -22,6 +22,9 @@ public final class TransactionsRetrieveRequestExpandItem { public static final TransactionsRetrieveRequestExpandItem CONTACT = new TransactionsRetrieveRequestExpandItem(Value.CONTACT, "contact"); + public static final TransactionsRetrieveRequestExpandItem COMPANY = + new TransactionsRetrieveRequestExpandItem(Value.COMPANY, "company"); + private final Value value; private final String string; @@ -65,6 +68,8 @@ public T visit(Visitor visitor) { return visitor.visitAccount(); case CONTACT: return visitor.visitContact(); + case COMPANY: + return visitor.visitCompany(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -84,6 +89,8 @@ public static TransactionsRetrieveRequestExpandItem valueOf(String value) { return ACCOUNT; case "contact": return CONTACT; + case "company": + return COMPANY; default: return new TransactionsRetrieveRequestExpandItem(Value.UNKNOWN, value); } @@ -94,6 +101,8 @@ public enum Value { ACCOUNTING_PERIOD, + COMPANY, + CONTACT, LINE_ITEMS, @@ -108,6 +117,8 @@ public interface Visitor { T visitAccountingPeriod(); + T visitCompany(); + T visitContact(); T visitLineItems(); diff --git a/src/main/java/com/merge/api/accounting/types/VendorCredit.java b/src/main/java/com/merge/api/accounting/types/VendorCredit.java index e11139317..2b37bc09a 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCredit.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCredit.java @@ -47,7 +47,7 @@ public final class VendorCredit { private final Optional company; - private final Optional> lines; + private final Optional> lines; private final Optional>> trackingCategories; @@ -61,6 +61,8 @@ public final class VendorCredit { private final Optional> remoteData; + private final Optional vendorCreditUrl; + private final Map additionalProperties; private VendorCredit( @@ -76,13 +78,14 @@ private VendorCredit( Optional exchangeRate, Optional inclusiveOfTax, Optional company, - Optional> lines, + Optional> lines, Optional>> trackingCategories, Optional> appliedToLines, Optional remoteWasDeleted, Optional accountingPeriod, Optional> fieldMappings, Optional> remoteData, + Optional vendorCreditUrl, Map additionalProperties) { this.id = id; this.remoteId = remoteId; @@ -103,6 +106,7 @@ private VendorCredit( this.accountingPeriod = accountingPeriod; this.fieldMappings = fieldMappings; this.remoteData = remoteData; + this.vendorCreditUrl = vendorCreditUrl; this.additionalProperties = additionalProperties; } @@ -508,7 +512,7 @@ public Optional getCompany() { } @JsonProperty("lines") - public Optional> getLines() { + public Optional> getLines() { return lines; } @@ -551,6 +555,14 @@ public Optional> getRemoteData() { return remoteData; } + /** + * @return The 3rd party URL of the vendor credit. + */ + @JsonProperty("vendor_credit_url") + public Optional getVendorCreditUrl() { + return vendorCreditUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -581,7 +593,8 @@ private boolean equalTo(VendorCredit other) { && remoteWasDeleted.equals(other.remoteWasDeleted) && accountingPeriod.equals(other.accountingPeriod) && fieldMappings.equals(other.fieldMappings) - && remoteData.equals(other.remoteData); + && remoteData.equals(other.remoteData) + && vendorCreditUrl.equals(other.vendorCreditUrl); } @java.lang.Override @@ -605,7 +618,8 @@ public int hashCode() { this.remoteWasDeleted, this.accountingPeriod, this.fieldMappings, - this.remoteData); + this.remoteData, + this.vendorCreditUrl); } @java.lang.Override @@ -643,7 +657,7 @@ public static final class Builder { private Optional company = Optional.empty(); - private Optional> lines = Optional.empty(); + private Optional> lines = Optional.empty(); private Optional>> trackingCategories = Optional.empty(); @@ -657,6 +671,8 @@ public static final class Builder { private Optional> remoteData = Optional.empty(); + private Optional vendorCreditUrl = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -682,6 +698,7 @@ public Builder from(VendorCredit other) { accountingPeriod(other.getAccountingPeriod()); fieldMappings(other.getFieldMappings()); remoteData(other.getRemoteData()); + vendorCreditUrl(other.getVendorCreditUrl()); return this; } @@ -1159,12 +1176,12 @@ public Builder company(VendorCreditCompany company) { } @JsonSetter(value = "lines", nulls = Nulls.SKIP) - public Builder lines(Optional> lines) { + public Builder lines(Optional> lines) { this.lines = lines; return this; } - public Builder lines(List lines) { + public Builder lines(List lines) { this.lines = Optional.ofNullable(lines); return this; } @@ -1245,6 +1262,20 @@ public Builder remoteData(List remoteData) { return this; } + /** + *

    The 3rd party URL of the vendor credit.

    + */ + @JsonSetter(value = "vendor_credit_url", nulls = Nulls.SKIP) + public Builder vendorCreditUrl(Optional vendorCreditUrl) { + this.vendorCreditUrl = vendorCreditUrl; + return this; + } + + public Builder vendorCreditUrl(String vendorCreditUrl) { + this.vendorCreditUrl = Optional.ofNullable(vendorCreditUrl); + return this; + } + public VendorCredit build() { return new VendorCredit( id, @@ -1266,6 +1297,7 @@ public VendorCredit build() { accountingPeriod, fieldMappings, remoteData, + vendorCreditUrl, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditLinesItem.java b/src/main/java/com/merge/api/accounting/types/VendorCreditLinesItem.java new file mode 100644 index 000000000..84e7a232d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditLinesItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.accounting.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = VendorCreditLinesItem.Deserializer.class) +public final class VendorCreditLinesItem { + private final Object value; + + private final int type; + + private VendorCreditLinesItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((VendorCreditLine) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VendorCreditLinesItem && equalTo((VendorCreditLinesItem) other); + } + + private boolean equalTo(VendorCreditLinesItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static VendorCreditLinesItem of(String value) { + return new VendorCreditLinesItem(value, 0); + } + + public static VendorCreditLinesItem of(VendorCreditLine value) { + return new VendorCreditLinesItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(VendorCreditLine value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(VendorCreditLinesItem.class); + } + + @java.lang.Override + public VendorCreditLinesItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, VendorCreditLine.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditRequest.java index 33d3ccd9d..63eb3d34a 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditRequest.java @@ -49,6 +49,8 @@ public final class VendorCreditRequest { private final Optional> linkedAccountParams; + private final Optional vendorCreditUrl; + private final Map additionalProperties; private VendorCreditRequest( @@ -65,6 +67,7 @@ private VendorCreditRequest( Optional accountingPeriod, Optional> integrationParams, Optional> linkedAccountParams, + Optional vendorCreditUrl, Map additionalProperties) { this.number = number; this.transactionDate = transactionDate; @@ -79,6 +82,7 @@ private VendorCreditRequest( this.accountingPeriod = accountingPeriod; this.integrationParams = integrationParams; this.linkedAccountParams = linkedAccountParams; + this.vendorCreditUrl = vendorCreditUrl; this.additionalProperties = additionalProperties; } @@ -485,6 +489,14 @@ public Optional> getLinkedAccountParams() { return linkedAccountParams; } + /** + * @return The 3rd party URL of the vendor credit. + */ + @JsonProperty("vendor_credit_url") + public Optional getVendorCreditUrl() { + return vendorCreditUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -509,7 +521,8 @@ private boolean equalTo(VendorCreditRequest other) { && appliedToLines.equals(other.appliedToLines) && accountingPeriod.equals(other.accountingPeriod) && integrationParams.equals(other.integrationParams) - && linkedAccountParams.equals(other.linkedAccountParams); + && linkedAccountParams.equals(other.linkedAccountParams) + && vendorCreditUrl.equals(other.vendorCreditUrl); } @java.lang.Override @@ -527,7 +540,8 @@ public int hashCode() { this.appliedToLines, this.accountingPeriod, this.integrationParams, - this.linkedAccountParams); + this.linkedAccountParams, + this.vendorCreditUrl); } @java.lang.Override @@ -568,6 +582,8 @@ public static final class Builder { private Optional> linkedAccountParams = Optional.empty(); + private Optional vendorCreditUrl = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -587,6 +603,7 @@ public Builder from(VendorCreditRequest other) { accountingPeriod(other.getAccountingPeriod()); integrationParams(other.getIntegrationParams()); linkedAccountParams(other.getLinkedAccountParams()); + vendorCreditUrl(other.getVendorCreditUrl()); return this; } @@ -1073,6 +1090,20 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + /** + *

    The 3rd party URL of the vendor credit.

    + */ + @JsonSetter(value = "vendor_credit_url", nulls = Nulls.SKIP) + public Builder vendorCreditUrl(Optional vendorCreditUrl) { + this.vendorCreditUrl = vendorCreditUrl; + return this; + } + + public Builder vendorCreditUrl(String vendorCreditUrl) { + this.vendorCreditUrl = Optional.ofNullable(vendorCreditUrl); + return this; + } + public VendorCreditRequest build() { return new VendorCreditRequest( number, @@ -1088,6 +1119,7 @@ public VendorCreditRequest build() { accountingPeriod, integrationParams, linkedAccountParams, + vendorCreditUrl, additionalProperties); } } diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java index 79d4716c5..72b890056 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java @@ -167,7 +167,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -453,7 +453,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/accounting/types/WarningValidationProblem.java b/src/main/java/com/merge/api/accounting/types/WarningValidationProblem.java index 12be0ced9..fc1caf0b5 100644 --- a/src/main/java/com/merge/api/accounting/types/WarningValidationProblem.java +++ b/src/main/java/com/merge/api/accounting/types/WarningValidationProblem.java @@ -29,6 +29,12 @@ public final class WarningValidationProblem { private final String problemType; + private final Optional blockMergeLink; + + private final Optional rawError; + + private final Optional errorCode; + private final Map additionalProperties; private WarningValidationProblem( @@ -36,11 +42,17 @@ private WarningValidationProblem( String title, String detail, String problemType, + Optional blockMergeLink, + Optional rawError, + Optional errorCode, Map additionalProperties) { this.source = source; this.title = title; this.detail = detail; this.problemType = problemType; + this.blockMergeLink = blockMergeLink; + this.rawError = rawError; + this.errorCode = errorCode; this.additionalProperties = additionalProperties; } @@ -64,6 +76,21 @@ public String getProblemType() { return problemType; } + @JsonProperty("block_merge_link") + public Optional getBlockMergeLink() { + return blockMergeLink; + } + + @JsonProperty("raw_error") + public Optional getRawError() { + return rawError; + } + + @JsonProperty("error_code") + public Optional getErrorCode() { + return errorCode; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -79,12 +106,22 @@ private boolean equalTo(WarningValidationProblem other) { return source.equals(other.source) && title.equals(other.title) && detail.equals(other.detail) - && problemType.equals(other.problemType); + && problemType.equals(other.problemType) + && blockMergeLink.equals(other.blockMergeLink) + && rawError.equals(other.rawError) + && errorCode.equals(other.errorCode); } @java.lang.Override public int hashCode() { - return Objects.hash(this.source, this.title, this.detail, this.problemType); + return Objects.hash( + this.source, + this.title, + this.detail, + this.problemType, + this.blockMergeLink, + this.rawError, + this.errorCode); } @java.lang.Override @@ -116,6 +153,18 @@ public interface _FinalStage { _FinalStage source(Optional source); _FinalStage source(ValidationProblemSource source); + + _FinalStage blockMergeLink(Optional blockMergeLink); + + _FinalStage blockMergeLink(Boolean blockMergeLink); + + _FinalStage rawError(Optional rawError); + + _FinalStage rawError(String rawError); + + _FinalStage errorCode(Optional errorCode); + + _FinalStage errorCode(Integer errorCode); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -126,6 +175,12 @@ public static final class Builder implements TitleStage, DetailStage, ProblemTyp private String problemType; + private Optional errorCode = Optional.empty(); + + private Optional rawError = Optional.empty(); + + private Optional blockMergeLink = Optional.empty(); + private Optional source = Optional.empty(); @JsonAnySetter @@ -139,6 +194,9 @@ public Builder from(WarningValidationProblem other) { title(other.getTitle()); detail(other.getDetail()); problemType(other.getProblemType()); + blockMergeLink(other.getBlockMergeLink()); + rawError(other.getRawError()); + errorCode(other.getErrorCode()); return this; } @@ -163,6 +221,45 @@ public _FinalStage problemType(@NotNull String problemType) { return this; } + @java.lang.Override + public _FinalStage errorCode(Integer errorCode) { + this.errorCode = Optional.ofNullable(errorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_code", nulls = Nulls.SKIP) + public _FinalStage errorCode(Optional errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + public _FinalStage rawError(String rawError) { + this.rawError = Optional.ofNullable(rawError); + return this; + } + + @java.lang.Override + @JsonSetter(value = "raw_error", nulls = Nulls.SKIP) + public _FinalStage rawError(Optional rawError) { + this.rawError = rawError; + return this; + } + + @java.lang.Override + public _FinalStage blockMergeLink(Boolean blockMergeLink) { + this.blockMergeLink = Optional.ofNullable(blockMergeLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "block_merge_link", nulls = Nulls.SKIP) + public _FinalStage blockMergeLink(Optional blockMergeLink) { + this.blockMergeLink = blockMergeLink; + return this; + } + @java.lang.Override public _FinalStage source(ValidationProblemSource source) { this.source = Optional.ofNullable(source); @@ -178,7 +275,8 @@ public _FinalStage source(Optional source) { @java.lang.Override public WarningValidationProblem build() { - return new WarningValidationProblem(source, title, detail, problemType, additionalProperties); + return new WarningValidationProblem( + source, title, detail, problemType, blockMergeLink, rawError, errorCode, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/ats/AccountTokenClient.java b/src/main/java/com/merge/api/ats/AccountTokenClient.java index 6a4214805..2a393916a 100644 --- a/src/main/java/com/merge/api/ats/AccountTokenClient.java +++ b/src/main/java/com/merge/api/ats/AccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.ats; import com.merge.api.ats.types.AccountToken; +import com.merge.api.ats.types.RegenerateAccountToken; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; @@ -37,4 +38,18 @@ public AccountToken retrieve(String publicToken) { public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).body(); } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } } diff --git a/src/main/java/com/merge/api/ats/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/ats/AsyncAccountTokenClient.java index 24a6e3af5..ad39c9ef6 100644 --- a/src/main/java/com/merge/api/ats/AsyncAccountTokenClient.java +++ b/src/main/java/com/merge/api/ats/AsyncAccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.ats; import com.merge.api.ats.types.AccountToken; +import com.merge.api.ats.types.RegenerateAccountToken; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import java.util.concurrent.CompletableFuture; @@ -38,4 +39,18 @@ public CompletableFuture retrieve(String publicToken) { public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/merge/api/ats/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/ats/AsyncLinkTokenClient.java index 6b8f75234..cf0cc9e40 100644 --- a/src/main/java/com/merge/api/ats/AsyncLinkTokenClient.java +++ b/src/main/java/com/merge/api/ats/AsyncLinkTokenClient.java @@ -27,14 +27,14 @@ public AsyncRawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request) { return this.rawClient.create(request).thenApply(response -> response.body()); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); diff --git a/src/main/java/com/merge/api/ats/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/ats/AsyncRawAccountDetailsClient.java index ec6fa2cc4..2328b501e 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAccountDetailsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(RequestO @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/ats/AsyncRawAccountTokenClient.java index 3dd75672f..63c8b8b16 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAccountTokenClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.ats; import com.merge.api.ats.types.AccountToken; +import com.merge.api.ats.types.RegenerateAccountToken; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -18,6 +19,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; @@ -61,18 +63,70 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("ats/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java b/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java index f2b220afa..dd36a42b2 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -144,9 +142,10 @@ public CompletableFuture>> lis @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedActivityList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedActivityList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedActivityList.class); Optional startingAfter = parsedResponse.getNext(); ActivitiesListRequest nextRequest = ActivitiesListRequest.builder() .from(request) @@ -167,12 +166,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -210,13 +206,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -236,18 +229,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ActivityResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ActivityResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -323,17 +314,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Activity.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Activity.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -378,18 +367,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java b/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java index 844da1578..ccb0208b2 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java @@ -23,9 +23,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -159,9 +157,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedApplicationList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedApplicationList.class); + PaginatedApplicationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedApplicationList.class); Optional startingAfter = parsedResponse.getNext(); ApplicationsListRequest nextRequest = ApplicationsListRequest.builder() .from(request) @@ -182,12 +181,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -229,13 +225,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -255,18 +248,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApplicationResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -335,18 +326,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Application.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Application.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -394,17 +382,10 @@ public CompletableFuture> changeStageC QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - if (request.getJobInterviewStage().isPresent()) { - properties.put("job_interview_stage", request.getJobInterviewStage()); - } - if (request.getRemoteUserId().isPresent()) { - properties.put("remote_user_id", request.getRemoteUserId()); - } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -424,18 +405,16 @@ public CompletableFuture> changeStageC @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApplicationResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -495,18 +474,15 @@ public CompletableFuture> metaPostRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java index 61c7ce08a..6592100e1 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java @@ -73,19 +73,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -133,19 +130,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + responseBodyString, AsyncPassthroughRetrieveResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java b/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java index 363f95acc..3c4195e9f 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -145,9 +143,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedAttachmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAttachmentList.class); + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); Optional startingAfter = parsedResponse.getNext(); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) @@ -168,12 +167,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -211,13 +207,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -237,18 +230,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AttachmentResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AttachmentResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -324,18 +315,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Attachment.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,18 +368,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java index 6d26ba9db..e91a94f24 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java @@ -99,9 +99,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAuditLogEventList.class); + responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -122,12 +123,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/ats/AsyncRawAvailableActionsClient.java index 0f8544713..28585911d 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAvailableActionsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java b/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java index 2cbebbbf9..5d7e7710e 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java @@ -24,9 +24,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -151,9 +149,10 @@ public CompletableFuture>> li @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedCandidateList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedCandidateList.class); + PaginatedCandidateList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCandidateList.class); Optional startingAfter = parsedResponse.getNext(); CandidatesListRequest nextRequest = CandidatesListRequest.builder() .from(request) @@ -174,12 +173,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -217,13 +213,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -243,18 +236,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CandidateResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -322,17 +313,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Candidate.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Candidate.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -372,13 +361,10 @@ public CompletableFuture> partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -398,18 +384,16 @@ public CompletableFuture> partialUpdate( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CandidateResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -469,11 +453,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -520,18 +502,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -576,18 +555,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/ats/AsyncRawDeleteAccountClient.java index 9949058f1..0e31b3625 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawDeleteAccountClient.java @@ -63,11 +63,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java b/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java index a27ebbde7..c97dcd4d1 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java @@ -122,9 +122,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedDepartmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedDepartmentList.class); + PaginatedDepartmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDepartmentList.class); Optional startingAfter = parsedResponse.getNext(); DepartmentsListRequest nextRequest = DepartmentsListRequest.builder() .from(request) @@ -145,12 +146,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -214,18 +212,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Department.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Department.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java b/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java index b8de1feef..98fa9e69b 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java @@ -137,9 +137,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEeocList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEeocList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEeocList.class); Optional startingAfter = parsedResponse.getNext(); EeocsListRequest nextRequest = EeocsListRequest.builder() .from(request) @@ -159,12 +160,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -240,17 +238,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Eeoc.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Eeoc.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java index ea2205c76..008c04d60 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.ats; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.ats.types.CreateFieldMappingRequest; import com.merge.api.ats.types.ExternalTargetFieldApiResponse; import com.merge.api.ats.types.FieldMappingApiInstanceResponse; @@ -21,8 +20,6 @@ import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -87,19 +84,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + responseBodyString, FieldMappingApiInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -137,17 +132,10 @@ public CompletableFuture> fie request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -167,19 +155,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,19 +213,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -276,25 +260,31 @@ public CompletableFuture> fie */ public CompletableFuture> fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -304,19 +294,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,19 +368,16 @@ public CompletableFuture> remoteFie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -438,19 +423,17 @@ public CompletableFuture> t @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + responseBodyString, ExternalTargetFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/ats/AsyncRawForceResyncClient.java index d35a86847..49e7044ad 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawForceResyncClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawForceResyncClient.java @@ -63,19 +63,17 @@ public CompletableFuture>> syncStatusResyn @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/ats/AsyncRawGenerateKeyClient.java index bb0c4c389..991cb972f 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawGenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java b/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java index fe78fcf54..eb0475943 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -161,9 +159,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); InterviewsListRequest nextRequest = InterviewsListRequest.builder() .from(request) @@ -185,12 +184,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -229,13 +225,10 @@ public CompletableFuture> creat QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -255,19 +248,17 @@ public CompletableFuture> creat @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ScheduledInterviewResponse.class), + responseBodyString, ScheduledInterviewResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -344,18 +335,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ScheduledInterview.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ScheduledInterview.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -400,18 +389,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java index cf29392f7..6f32cc579 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java @@ -145,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -167,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,17 +216,15 @@ public CompletableFuture> retrieve(String id, Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java b/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java index 8a3ee758b..cbf9ecd21 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java @@ -131,9 +131,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); JobInterviewStagesListRequest nextRequest = JobInterviewStagesListRequest.builder() .from(request) @@ -155,12 +156,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -229,18 +227,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobInterviewStage.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JobInterviewStage.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java b/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java index 69f91bdb8..8ef65dc1a 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java @@ -130,9 +130,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedJobPostingList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedJobPostingList.class); + PaginatedJobPostingList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobPostingList.class); Optional startingAfter = parsedResponse.getNext(); JobPostingsListRequest nextRequest = JobPostingsListRequest.builder() .from(request) @@ -153,12 +154,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -226,18 +224,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobPosting.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JobPosting.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java b/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java index 9e9d8723d..f76e5abdd 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java @@ -148,9 +148,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedJobList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJobList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobList.class); Optional startingAfter = parsedResponse.getNext(); JobsListRequest nextRequest = JobsListRequest.builder() .from(request) @@ -170,12 +171,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -251,17 +249,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Job.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Job.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -349,9 +345,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); JobsScreeningQuestionsListRequest nextRequest = JobsScreeningQuestionsListRequest.builder() .from(request) @@ -373,12 +370,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java index dc05b56df..02ec3abc2 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java @@ -34,14 +34,14 @@ public AsyncRawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create( EndUserDetailsRequest request, RequestOptions requestOptions) { @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java index 004dd82b6..cb4b0e2d3 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java @@ -138,9 +138,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -162,12 +163,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java b/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java index a558e70e0..c5eed9024 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java @@ -122,6 +122,10 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -141,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedOfferList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfferList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfferList.class); Optional startingAfter = parsedResponse.getNext(); OffersListRequest nextRequest = OffersListRequest.builder() .from(request) @@ -163,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -244,17 +246,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Offer.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Offer.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java b/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java index 0a8158af9..c575a1497 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java @@ -121,9 +121,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedOfficeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfficeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfficeList.class); Optional startingAfter = parsedResponse.getNext(); OfficesListRequest nextRequest = OfficesListRequest.builder() .from(request) @@ -144,12 +145,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -213,17 +211,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Office.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Office.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/ats/AsyncRawPassthroughClient.java index d26f4af70..d9edefe87 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawPassthroughClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawPassthroughClient.java @@ -72,18 +72,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/ats/AsyncRawRegenerateKeyClient.java index 408bb26a0..19c94589f 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawRegenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java b/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java index 2ba7f682b..3234fbb33 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java @@ -122,9 +122,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRejectReasonList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedRejectReasonList.class); + responseBodyString, PaginatedRejectReasonList.class); Optional startingAfter = parsedResponse.getNext(); RejectReasonsListRequest nextRequest = RejectReasonsListRequest.builder() .from(request) @@ -145,12 +146,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -215,18 +213,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RejectReason.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RejectReason.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawScopesClient.java b/src/main/java/com/merge/api/ats/AsyncRawScopesClient.java index 04a038078..97dc34d3a 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawScopesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawScopesClient.java @@ -64,18 +64,16 @@ public CompletableFuture> defaultScope @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -121,18 +119,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -187,18 +183,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java b/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java index 7cc715c44..5cb80a724 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java @@ -145,9 +145,10 @@ public CompletableFuture>> li @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedScorecardList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedScorecardList.class); + PaginatedScorecardList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScorecardList.class); Optional startingAfter = parsedResponse.getNext(); ScorecardsListRequest nextRequest = ScorecardsListRequest.builder() .from(request) @@ -168,12 +169,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -249,17 +247,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Scorecard.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Scorecard.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java index dbea60b99..f8a047ed8 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java @@ -82,9 +82,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedSyncStatusList.class); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -105,12 +106,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java b/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java index 066a73215..fbfd14eef 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java @@ -120,9 +120,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTagList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); Optional startingAfter = parsedResponse.getNext(); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) @@ -142,12 +143,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java b/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java index f42e93de9..189a8c8b0 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java @@ -133,9 +133,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedRemoteUserList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedRemoteUserList.class); + PaginatedRemoteUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -156,12 +157,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -233,18 +231,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteUser.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteUser.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/ats/AsyncRawWebhookReceiversClient.java index 789da2d78..3ece36b69 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawWebhookReceiversClient.java @@ -65,19 +65,17 @@ public CompletableFuture>> list(Reque @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -131,18 +129,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ats/LinkTokenClient.java b/src/main/java/com/merge/api/ats/LinkTokenClient.java index 640d5ef3f..667a6bfcb 100644 --- a/src/main/java/com/merge/api/ats/LinkTokenClient.java +++ b/src/main/java/com/merge/api/ats/LinkTokenClient.java @@ -26,14 +26,14 @@ public RawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request) { return this.rawClient.create(request).body(); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); diff --git a/src/main/java/com/merge/api/ats/RawAccountDetailsClient.java b/src/main/java/com/merge/api/ats/RawAccountDetailsClient.java index 24d5bb03f..30803b755 100644 --- a/src/main/java/com/merge/api/ats/RawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/ats/RawAccountDetailsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOptio } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawAccountTokenClient.java b/src/main/java/com/merge/api/ats/RawAccountTokenClient.java index 8d1ea04e1..2f3de6bfc 100644 --- a/src/main/java/com/merge/api/ats/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/ats/RawAccountTokenClient.java @@ -4,6 +4,7 @@ package com.merge.api.ats; import com.merge.api.ats.types.AccountToken; +import com.merge.api.ats.types.RegenerateAccountToken; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -15,6 +16,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; @@ -53,16 +55,53 @@ public MergeApiHttpResponse retrieve(String publicToken, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("ats/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawActivitiesClient.java b/src/main/java/com/merge/api/ats/RawActivitiesClient.java index 83b35924e..8c37ec550 100644 --- a/src/main/java/com/merge/api/ats/RawActivitiesClient.java +++ b/src/main/java/com/merge/api/ats/RawActivitiesClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -136,9 +134,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedActivityList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedActivityList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedActivityList.class); Optional startingAfter = parsedResponse.getNext(); ActivitiesListRequest nextRequest = ActivitiesListRequest.builder() .from(request) @@ -151,12 +150,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -185,13 +180,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -208,16 +200,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ActivityResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ActivityResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -281,16 +270,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Activity.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Activity.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -323,16 +309,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawApplicationsClient.java b/src/main/java/com/merge/api/ats/RawApplicationsClient.java index 02c628c7c..4c154a293 100644 --- a/src/main/java/com/merge/api/ats/RawApplicationsClient.java +++ b/src/main/java/com/merge/api/ats/RawApplicationsClient.java @@ -23,9 +23,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -150,9 +148,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedApplicationList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedApplicationList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedApplicationList.class); Optional startingAfter = parsedResponse.getNext(); ApplicationsListRequest nextRequest = ApplicationsListRequest.builder() .from(request) @@ -166,12 +165,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -204,13 +199,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -227,17 +219,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApplicationResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -293,16 +281,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Application.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Application.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -341,17 +326,10 @@ public MergeApiHttpResponse changeStageCreate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - if (request.getJobInterviewStage().isPresent()) { - properties.put("job_interview_stage", request.getJobInterviewStage()); - } - if (request.getRemoteUserId().isPresent()) { - properties.put("remote_user_id", request.getRemoteUserId()); - } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -368,17 +346,13 @@ public MergeApiHttpResponse changeStageCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ApplicationResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ApplicationResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -425,16 +399,13 @@ public MergeApiHttpResponse metaPostRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java index 3059d9d63..d190310a0 100644 --- a/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java @@ -66,17 +66,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -111,18 +108,14 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawAttachmentsClient.java b/src/main/java/com/merge/api/ats/RawAttachmentsClient.java index c640eab44..5285c83a4 100644 --- a/src/main/java/com/merge/api/ats/RawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ats/RawAttachmentsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -136,9 +134,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAttachmentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAttachmentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); Optional startingAfter = parsedResponse.getNext(); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) @@ -152,12 +151,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -186,13 +181,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -209,16 +201,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AttachmentResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AttachmentResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -282,16 +271,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Attachment.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -324,16 +310,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawAuditTrailClient.java b/src/main/java/com/merge/api/ats/RawAuditTrailClient.java index 71d09b7b0..fc2dfff27 100644 --- a/src/main/java/com/merge/api/ats/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ats/RawAuditTrailClient.java @@ -90,9 +90,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -106,12 +107,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawAvailableActionsClient.java b/src/main/java/com/merge/api/ats/RawAvailableActionsClient.java index 25c90497d..e89aa1a85 100644 --- a/src/main/java/com/merge/api/ats/RawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/ats/RawAvailableActionsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawCandidatesClient.java b/src/main/java/com/merge/api/ats/RawCandidatesClient.java index 39ddae212..56aed10c5 100644 --- a/src/main/java/com/merge/api/ats/RawCandidatesClient.java +++ b/src/main/java/com/merge/api/ats/RawCandidatesClient.java @@ -24,9 +24,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -143,9 +141,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCandidateList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCandidateList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCandidateList.class); Optional startingAfter = parsedResponse.getNext(); CandidatesListRequest nextRequest = CandidatesListRequest.builder() .from(request) @@ -158,12 +157,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -192,13 +187,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -215,16 +207,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CandidateResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -280,16 +269,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Candidate.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Candidate.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -319,13 +305,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -342,16 +325,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CandidateResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CandidateResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -397,11 +377,8 @@ public MergeApiHttpResponse ignoreCreate( return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -435,16 +412,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -477,16 +451,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawDeleteAccountClient.java b/src/main/java/com/merge/api/ats/RawDeleteAccountClient.java index 1afcccdfd..33f103afb 100644 --- a/src/main/java/com/merge/api/ats/RawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/ats/RawDeleteAccountClient.java @@ -55,11 +55,8 @@ public MergeApiHttpResponse delete(RequestOptions requestOptions) { return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawDepartmentsClient.java b/src/main/java/com/merge/api/ats/RawDepartmentsClient.java index aa787ef3f..f246d2a1e 100644 --- a/src/main/java/com/merge/api/ats/RawDepartmentsClient.java +++ b/src/main/java/com/merge/api/ats/RawDepartmentsClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedDepartmentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDepartmentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDepartmentList.class); Optional startingAfter = parsedResponse.getNext(); DepartmentsListRequest nextRequest = DepartmentsListRequest.builder() .from(request) @@ -129,12 +130,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -186,16 +183,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Department.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Department.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawEeocsClient.java b/src/main/java/com/merge/api/ats/RawEeocsClient.java index 757c5f1de..da3cd646d 100644 --- a/src/main/java/com/merge/api/ats/RawEeocsClient.java +++ b/src/main/java/com/merge/api/ats/RawEeocsClient.java @@ -129,9 +129,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEeocList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEeocList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEeocList.class); Optional startingAfter = parsedResponse.getNext(); EeocsListRequest nextRequest = EeocsListRequest.builder() .from(request) @@ -144,12 +145,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -212,16 +209,13 @@ public MergeApiHttpResponse retrieve(String id, EeocsRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Eeoc.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Eeoc.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawFieldMappingClient.java b/src/main/java/com/merge/api/ats/RawFieldMappingClient.java index 774502bcf..1328b7df8 100644 --- a/src/main/java/com/merge/api/ats/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ats/RawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.ats; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.ats.types.CreateFieldMappingRequest; import com.merge.api.ats.types.ExternalTargetFieldApiResponse; import com.merge.api.ats.types.FieldMappingApiInstanceResponse; @@ -21,8 +20,6 @@ import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -80,18 +77,14 @@ public MergeApiHttpResponse fieldMappingsRetrie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -119,17 +112,10 @@ public MergeApiHttpResponse fieldMappingsCreate( request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -146,17 +132,14 @@ public MergeApiHttpResponse fieldMappingsCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,17 +174,14 @@ public MergeApiHttpResponse fieldMappingsDestroy( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -228,42 +208,45 @@ public MergeApiHttpResponse fieldMappingsPartialUp */ public MergeApiHttpResponse fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -314,17 +297,14 @@ public MergeApiHttpResponse remoteFieldsRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -357,18 +337,14 @@ public MergeApiHttpResponse targetFieldsRetrieve } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawForceResyncClient.java b/src/main/java/com/merge/api/ats/RawForceResyncClient.java index d4ec4a02f..a4f5a5917 100644 --- a/src/main/java/com/merge/api/ats/RawForceResyncClient.java +++ b/src/main/java/com/merge/api/ats/RawForceResyncClient.java @@ -55,18 +55,15 @@ public MergeApiHttpResponse> syncStatusResyncCreate(RequestOpti } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawGenerateKeyClient.java b/src/main/java/com/merge/api/ats/RawGenerateKeyClient.java index 5160c6b18..9c7f62eee 100644 --- a/src/main/java/com/merge/api/ats/RawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/ats/RawGenerateKeyClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawInterviewsClient.java b/src/main/java/com/merge/api/ats/RawInterviewsClient.java index 347a49239..03ed5a205 100644 --- a/src/main/java/com/merge/api/ats/RawInterviewsClient.java +++ b/src/main/java/com/merge/api/ats/RawInterviewsClient.java @@ -21,9 +21,7 @@ import com.merge.api.core.SyncPagingIterable; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -151,9 +149,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedScheduledInterviewList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedScheduledInterviewList.class); + PaginatedScheduledInterviewList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScheduledInterviewList.class); Optional startingAfter = parsedResponse.getNext(); InterviewsListRequest nextRequest = InterviewsListRequest.builder() .from(request) @@ -167,12 +166,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -201,13 +196,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); - properties.put("remote_user_id", request.getRemoteUserId()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -224,17 +216,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ScheduledInterviewResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ScheduledInterviewResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -298,16 +287,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), ScheduledInterview.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ScheduledInterview.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -340,16 +326,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawIssuesClient.java b/src/main/java/com/merge/api/ats/RawIssuesClient.java index fe32d31e7..9c0e57a77 100644 --- a/src/main/java/com/merge/api/ats/RawIssuesClient.java +++ b/src/main/java/com/merge/api/ats/RawIssuesClient.java @@ -137,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -152,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,16 +188,13 @@ public MergeApiHttpResponse retrieve(String id, RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java b/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java index 9cfdac863..c85c9d5a9 100644 --- a/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java +++ b/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java @@ -121,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedJobInterviewStageList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedJobInterviewStageList.class); + PaginatedJobInterviewStageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobInterviewStageList.class); Optional startingAfter = parsedResponse.getNext(); JobInterviewStagesListRequest nextRequest = JobInterviewStagesListRequest.builder() .from(request) @@ -137,12 +138,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,16 +195,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobInterviewStage.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JobInterviewStage.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawJobPostingsClient.java b/src/main/java/com/merge/api/ats/RawJobPostingsClient.java index c2092e589..febcc8a96 100644 --- a/src/main/java/com/merge/api/ats/RawJobPostingsClient.java +++ b/src/main/java/com/merge/api/ats/RawJobPostingsClient.java @@ -121,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedJobPostingList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJobPostingList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobPostingList.class); Optional startingAfter = parsedResponse.getNext(); JobPostingsListRequest nextRequest = JobPostingsListRequest.builder() .from(request) @@ -137,12 +138,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,16 +195,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), JobPosting.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, JobPosting.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawJobsClient.java b/src/main/java/com/merge/api/ats/RawJobsClient.java index d68bd444a..5a7e83b98 100644 --- a/src/main/java/com/merge/api/ats/RawJobsClient.java +++ b/src/main/java/com/merge/api/ats/RawJobsClient.java @@ -139,9 +139,10 @@ public MergeApiHttpResponse> list(JobsListRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedJobList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedJobList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobList.class); Optional startingAfter = parsedResponse.getNext(); JobsListRequest nextRequest = JobsListRequest.builder() .from(request) @@ -154,12 +155,8 @@ public MergeApiHttpResponse> list(JobsListRequest reques .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -222,16 +219,13 @@ public MergeApiHttpResponse retrieve(String id, JobsRetrieveRequest request } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Job.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Job.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -305,9 +299,10 @@ public MergeApiHttpResponse> screeningQues } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedScreeningQuestionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedScreeningQuestionList.class); + PaginatedScreeningQuestionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScreeningQuestionList.class); Optional startingAfter = parsedResponse.getNext(); JobsScreeningQuestionsListRequest nextRequest = JobsScreeningQuestionsListRequest.builder() .from(request) @@ -321,12 +316,8 @@ public MergeApiHttpResponse> screeningQues .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawLinkTokenClient.java b/src/main/java/com/merge/api/ats/RawLinkTokenClient.java index fee541b98..29499bce5 100644 --- a/src/main/java/com/merge/api/ats/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ats/RawLinkTokenClient.java @@ -30,14 +30,14 @@ public RawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(EndUserDetailsRequest request, Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java index 38de4f704..a285f669f 100644 --- a/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java @@ -128,9 +128,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); Optional startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -145,12 +146,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawOffersClient.java b/src/main/java/com/merge/api/ats/RawOffersClient.java index 4e5777f10..aaabd60de 100644 --- a/src/main/java/com/merge/api/ats/RawOffersClient.java +++ b/src/main/java/com/merge/api/ats/RawOffersClient.java @@ -117,6 +117,10 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -133,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedOfferList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfferList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfferList.class); Optional startingAfter = parsedResponse.getNext(); OffersListRequest nextRequest = OffersListRequest.builder() .from(request) @@ -148,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -217,16 +218,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Offer.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Offer.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawOfficesClient.java b/src/main/java/com/merge/api/ats/RawOfficesClient.java index d4ce078d8..a28666d8d 100644 --- a/src/main/java/com/merge/api/ats/RawOfficesClient.java +++ b/src/main/java/com/merge/api/ats/RawOfficesClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedOfficeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOfficeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfficeList.class); Optional startingAfter = parsedResponse.getNext(); OfficesListRequest nextRequest = OfficesListRequest.builder() .from(request) @@ -128,12 +129,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -185,16 +182,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Office.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Office.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawPassthroughClient.java b/src/main/java/com/merge/api/ats/RawPassthroughClient.java index 23ea82355..99a810622 100644 --- a/src/main/java/com/merge/api/ats/RawPassthroughClient.java +++ b/src/main/java/com/merge/api/ats/RawPassthroughClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(DataPassthroughRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/ats/RawRegenerateKeyClient.java index a8763a267..b87e8fed9 100644 --- a/src/main/java/com/merge/api/ats/RawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/ats/RawRegenerateKeyClient.java @@ -65,16 +65,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java b/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java index 2a0471b1d..c3d97c697 100644 --- a/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java +++ b/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRejectReasonList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRejectReasonList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRejectReasonList.class); Optional startingAfter = parsedResponse.getNext(); RejectReasonsListRequest nextRequest = RejectReasonsListRequest.builder() .from(request) @@ -129,12 +130,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -186,16 +183,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RejectReason.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RejectReason.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawScopesClient.java b/src/main/java/com/merge/api/ats/RawScopesClient.java index 38e30f22e..e2a7ef271 100644 --- a/src/main/java/com/merge/api/ats/RawScopesClient.java +++ b/src/main/java/com/merge/api/ats/RawScopesClient.java @@ -56,17 +56,13 @@ public MergeApiHttpResponse defaultScopesRetrieve(RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -99,17 +95,13 @@ public MergeApiHttpResponse linkedAccountScopesRetrieve(Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -152,17 +144,13 @@ public MergeApiHttpResponse linkedAccountScopesCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawScorecardsClient.java b/src/main/java/com/merge/api/ats/RawScorecardsClient.java index 7dab6d7f0..df5bbfaee 100644 --- a/src/main/java/com/merge/api/ats/RawScorecardsClient.java +++ b/src/main/java/com/merge/api/ats/RawScorecardsClient.java @@ -137,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedScorecardList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedScorecardList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScorecardList.class); Optional startingAfter = parsedResponse.getNext(); ScorecardsListRequest nextRequest = ScorecardsListRequest.builder() .from(request) @@ -152,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -221,16 +218,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Scorecard.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Scorecard.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawSyncStatusClient.java b/src/main/java/com/merge/api/ats/RawSyncStatusClient.java index 561a6145a..a0fe8e967 100644 --- a/src/main/java/com/merge/api/ats/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ats/RawSyncStatusClient.java @@ -74,9 +74,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedSyncStatusList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -90,12 +91,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawTagsClient.java b/src/main/java/com/merge/api/ats/RawTagsClient.java index 0aeb7bda1..43784f72c 100644 --- a/src/main/java/com/merge/api/ats/RawTagsClient.java +++ b/src/main/java/com/merge/api/ats/RawTagsClient.java @@ -111,9 +111,10 @@ public MergeApiHttpResponse> list(TagsListRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTagList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); Optional startingAfter = parsedResponse.getNext(); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) @@ -126,12 +127,8 @@ public MergeApiHttpResponse> list(TagsListRequest reques .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawUsersClient.java b/src/main/java/com/merge/api/ats/RawUsersClient.java index 19b0f7a85..4179b2daf 100644 --- a/src/main/java/com/merge/api/ats/RawUsersClient.java +++ b/src/main/java/com/merge/api/ats/RawUsersClient.java @@ -125,9 +125,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -141,12 +142,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -206,16 +203,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteUser.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteUser.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/ats/RawWebhookReceiversClient.java index 9d5248ce5..45b3fde9a 100644 --- a/src/main/java/com/merge/api/ats/RawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/ats/RawWebhookReceiversClient.java @@ -58,18 +58,15 @@ public MergeApiHttpResponse> list(RequestOptions requestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -110,16 +107,13 @@ public MergeApiHttpResponse create(WebhookReceiverRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ats/types/AccountDetails.java b/src/main/java/com/merge/api/ats/types/AccountDetails.java index f699537d6..d0ab74366 100644 --- a/src/main/java/com/merge/api/ats/types/AccountDetails.java +++ b/src/main/java/com/merge/api/ats/types/AccountDetails.java @@ -45,6 +45,10 @@ public final class AccountDetails { private final Optional completedAt; + private final Optional instanceId; + + private final Optional instanceDisplayValue; + private final Map additionalProperties; private AccountDetails( @@ -60,6 +64,8 @@ private AccountDetails( Optional isDuplicate, Optional accountType, Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, Map additionalProperties) { this.id = id; this.integration = integration; @@ -73,6 +79,8 @@ private AccountDetails( this.isDuplicate = isDuplicate; this.accountType = accountType; this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; this.additionalProperties = additionalProperties; } @@ -142,6 +150,16 @@ public Optional getCompletedAt() { return completedAt; } + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -165,7 +183,9 @@ private boolean equalTo(AccountDetails other) { && webhookListenerUrl.equals(other.webhookListenerUrl) && isDuplicate.equals(other.isDuplicate) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); } @java.lang.Override @@ -182,7 +202,9 @@ public int hashCode() { this.webhookListenerUrl, this.isDuplicate, this.accountType, - this.completedAt); + this.completedAt, + this.instanceId, + this.instanceDisplayValue); } @java.lang.Override @@ -220,6 +242,10 @@ public static final class Builder { private Optional completedAt = Optional.empty(); + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -238,6 +264,8 @@ public Builder from(AccountDetails other) { isDuplicate(other.getIsDuplicate()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); return this; } @@ -379,6 +407,28 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + public AccountDetails build() { return new AccountDetails( id, @@ -393,6 +443,8 @@ public AccountDetails build() { isDuplicate, accountType, completedAt, + instanceId, + instanceDisplayValue, additionalProperties); } } diff --git a/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java index cfcdd90f9..431c27480 100644 --- a/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -48,6 +49,8 @@ public final class AccountDetailsAndActions { private final OffsetDateTime completedAt; + private final Optional> integrationSpecificFields; + private final Map additionalProperties; private AccountDetailsAndActions( @@ -64,6 +67,7 @@ private AccountDetailsAndActions( Optional integration, String accountType, OffsetDateTime completedAt, + Optional> integrationSpecificFields, Map additionalProperties) { this.id = id; this.category = category; @@ -78,6 +82,7 @@ private AccountDetailsAndActions( this.integration = integration; this.accountType = accountType; this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; this.additionalProperties = additionalProperties; } @@ -152,6 +157,11 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -176,7 +186,8 @@ private boolean equalTo(AccountDetailsAndActions other) { && isDuplicate.equals(other.isDuplicate) && integration.equals(other.integration) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); } @java.lang.Override @@ -194,7 +205,8 @@ public int hashCode() { this.isDuplicate, this.integration, this.accountType, - this.completedAt); + this.completedAt, + this.integrationSpecificFields); } @java.lang.Override @@ -268,6 +280,10 @@ public interface _FinalStage { _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -294,6 +310,8 @@ public static final class Builder private OffsetDateTime completedAt; + private Optional> integrationSpecificFields = Optional.empty(); + private Optional integration = Optional.empty(); private Optional isDuplicate = Optional.empty(); @@ -326,6 +344,7 @@ public Builder from(AccountDetailsAndActions other) { integration(other.getIntegration()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); return this; } @@ -378,6 +397,19 @@ public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { return this; } + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + @java.lang.Override public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { this.integration = Optional.ofNullable(integration); @@ -486,6 +518,7 @@ public AccountDetailsAndActions build() { integration, accountType, completedAt, + integrationSpecificFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java b/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java index 982c573c6..4a6d9dc31 100644 --- a/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -439,7 +439,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/AuditLogEvent.java b/src/main/java/com/merge/api/ats/types/AuditLogEvent.java index 0e4e3a10e..7469c9d2c 100644 --- a/src/main/java/com/merge/api/ats/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/ats/types/AuditLogEvent.java @@ -91,6 +91,7 @@ public Optional getUserEmail() { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ @JsonProperty("role") @@ -220,6 +221,7 @@ public interface RoleStage { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ IpAddressStage role(@NotNull AuditLogEventRole role); @@ -359,6 +361,7 @@ public Builder from(AuditLogEvent other) { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * *

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    *
      @@ -368,6 +371,7 @@ public Builder from(AuditLogEvent other) { *
    • API - API
    • *
    • SYSTEM - SYSTEM
    • *
    • MERGE_TEAM - MERGE_TEAM
    • + *
    • SUPPORT - SUPPORT
    • *
    * @return Reference to {@code this} so that method calls can be chained together. */ diff --git a/src/main/java/com/merge/api/ats/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/ats/types/AuditTrailListRequest.java index e4d9e0adf..5c3d58fe6 100644 --- a/src/main/java/com/merge/api/ats/types/AuditTrailListRequest.java +++ b/src/main/java/com/merge/api/ats/types/AuditTrailListRequest.java @@ -76,7 +76,7 @@ public Optional getEventType() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -205,7 +205,7 @@ public Builder eventType(String eventType) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/ats/types/CreateFieldMappingRequest.java index 32e46ee62..e0b195344 100644 --- a/src/main/java/com/merge/api/ats/types/CreateFieldMappingRequest.java +++ b/src/main/java/com/merge/api/ats/types/CreateFieldMappingRequest.java @@ -38,6 +38,8 @@ public final class CreateFieldMappingRequest { private final String commonModelName; + private final Optional jmesPath; + private final Map additionalProperties; private CreateFieldMappingRequest( @@ -48,6 +50,7 @@ private CreateFieldMappingRequest( String remoteMethod, String remoteUrlPath, String commonModelName, + Optional jmesPath, Map additionalProperties) { this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; this.targetFieldName = targetFieldName; @@ -56,6 +59,7 @@ private CreateFieldMappingRequest( this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; this.commonModelName = commonModelName; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -115,6 +119,14 @@ public String getCommonModelName() { return commonModelName; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -133,7 +145,8 @@ private boolean equalTo(CreateFieldMappingRequest other) { && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath); } @java.lang.Override @@ -145,7 +158,8 @@ public int hashCode() { this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath, - this.commonModelName); + this.commonModelName, + this.jmesPath); } @java.lang.Override @@ -212,6 +226,13 @@ public interface _FinalStage { _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -232,6 +253,8 @@ public static final class Builder private String commonModelName; + private Optional jmesPath = Optional.empty(); + private List remoteFieldTraversalPath = new ArrayList<>(); private Optional excludeRemoteFieldMetadata = Optional.empty(); @@ -250,6 +273,7 @@ public Builder from(CreateFieldMappingRequest other) { remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); return this; } @@ -313,6 +337,26 @@ public _FinalStage commonModelName(@NotNull String commonModelName) { return this; } + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -378,6 +422,7 @@ public CreateFieldMappingRequest build() { remoteMethod, remoteUrlPath, commonModelName, + jmesPath, additionalProperties); } } diff --git a/src/main/java/com/merge/api/ats/types/EeocsListRequest.java b/src/main/java/com/merge/api/ats/types/EeocsListRequest.java index 60862372b..0628e492e 100644 --- a/src/main/java/com/merge/api/ats/types/EeocsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/EeocsListRequest.java @@ -167,7 +167,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -453,7 +453,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java index 98cc4621b..e13b76cb9 100644 --- a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java @@ -28,6 +28,8 @@ public final class FieldMappingApiInstance { private final Optional remoteField; + private final Optional jmesPath; + private final Map additionalProperties; private FieldMappingApiInstance( @@ -35,11 +37,13 @@ private FieldMappingApiInstance( Optional isIntegrationWide, Optional targetField, Optional remoteField, + Optional jmesPath, Map additionalProperties) { this.id = id; this.isIntegrationWide = isIntegrationWide; this.targetField = targetField; this.remoteField = remoteField; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -63,6 +67,11 @@ public Optional getRemoteField() { return remoteField; } + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +87,13 @@ private boolean equalTo(FieldMappingApiInstance other) { return id.equals(other.id) && isIntegrationWide.equals(other.isIntegrationWide) && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField, this.jmesPath); } @java.lang.Override @@ -105,6 +115,8 @@ public static final class Builder { private Optional remoteField = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -115,6 +127,7 @@ public Builder from(FieldMappingApiInstance other) { isIntegrationWide(other.getIsIntegrationWide()); targetField(other.getTargetField()); remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); return this; } @@ -162,8 +175,20 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + return new FieldMappingApiInstance( + id, isIntegrationWide, targetField, remoteField, jmesPath, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java b/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java index 049c44c7a..1f013db4a 100644 --- a/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java @@ -203,7 +203,7 @@ public Optional getOrganizerId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -546,7 +546,7 @@ public Builder organizerId(String organizerId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/IssuesListRequest.java b/src/main/java/com/merge/api/ats/types/IssuesListRequest.java index 91e1fb998..724c34da9 100644 --- a/src/main/java/com/merge/api/ats/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/IssuesListRequest.java @@ -164,7 +164,7 @@ public Optional getLinkedAccountId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -446,7 +446,7 @@ public Builder linkedAccountId(String linkedAccountId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java b/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java index 9cce5eac0..c10158a87 100644 --- a/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/JobPostingsListRequest.java b/src/main/java/com/merge/api/ats/types/JobPostingsListRequest.java index 4a9307524..e8e44808e 100644 --- a/src/main/java/com/merge/api/ats/types/JobPostingsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobPostingsListRequest.java @@ -151,7 +151,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -412,7 +412,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/JobsListRequest.java b/src/main/java/com/merge/api/ats/types/JobsListRequest.java index 5014df543..64016d9ce 100644 --- a/src/main/java/com/merge/api/ats/types/JobsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobsListRequest.java @@ -183,7 +183,7 @@ public Optional getOffices() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -508,7 +508,7 @@ public Builder offices(String offices) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequest.java b/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequest.java index 52a738579..f742ef30d 100644 --- a/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobsScreeningQuestionsListRequest.java @@ -94,7 +94,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -246,7 +246,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java index 099dbe8b9..f85893f1d 100644 --- a/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java @@ -174,7 +174,7 @@ public Optional getIsTestAccount() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -454,7 +454,7 @@ public Builder isTestAccount(String isTestAccount) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/OffersListRequest.java b/src/main/java/com/merge/api/ats/types/OffersListRequest.java index a72ad7e72..95b5d45d2 100644 --- a/src/main/java/com/merge/api/ats/types/OffersListRequest.java +++ b/src/main/java/com/merge/api/ats/types/OffersListRequest.java @@ -53,6 +53,8 @@ public final class OffersListRequest { private final Optional showEnumOrigins; + private final Optional status; + private final Map additionalProperties; private OffersListRequest( @@ -71,6 +73,7 @@ private OffersListRequest( Optional remoteFields, Optional remoteId, Optional showEnumOrigins, + Optional status, Map additionalProperties) { this.expand = expand; this.applicationId = applicationId; @@ -87,6 +90,7 @@ private OffersListRequest( this.remoteFields = remoteFields; this.remoteId = remoteId; this.showEnumOrigins = showEnumOrigins; + this.status = status; this.additionalProperties = additionalProperties; } @@ -210,6 +214,25 @@ public Optional getShowEnumOrigins() { return showEnumOrigins; } + /** + * @return If provided, will only return offers with this status. Options: ('DRAFT', 'APPROVAL-SENT', 'APPROVED', 'SENT', 'SENT-MANUALLY', 'OPENED', 'DENIED', 'SIGNED', 'DEPRECATED') + *
      + *
    • DRAFT - DRAFT
    • + *
    • APPROVAL-SENT - APPROVAL-SENT
    • + *
    • APPROVED - APPROVED
    • + *
    • SENT - SENT
    • + *
    • SENT-MANUALLY - SENT-MANUALLY
    • + *
    • OPENED - OPENED
    • + *
    • DENIED - DENIED
    • + *
    • SIGNED - SIGNED
    • + *
    • DEPRECATED - DEPRECATED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -236,7 +259,8 @@ private boolean equalTo(OffersListRequest other) { && pageSize.equals(other.pageSize) && remoteFields.equals(other.remoteFields) && remoteId.equals(other.remoteId) - && showEnumOrigins.equals(other.showEnumOrigins); + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status); } @java.lang.Override @@ -256,7 +280,8 @@ public int hashCode() { this.pageSize, this.remoteFields, this.remoteId, - this.showEnumOrigins); + this.showEnumOrigins, + this.status); } @java.lang.Override @@ -300,6 +325,8 @@ public static final class Builder { private Optional showEnumOrigins = Optional.empty(); + private Optional status = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -321,6 +348,7 @@ public Builder from(OffersListRequest other) { remoteFields(other.getRemoteFields()); remoteId(other.getRemoteId()); showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); return this; } @@ -539,6 +567,31 @@ public Builder showEnumOrigins(String showEnumOrigins) { return this; } + /** + *

    If provided, will only return offers with this status. Options: ('DRAFT', 'APPROVAL-SENT', 'APPROVED', 'SENT', 'SENT-MANUALLY', 'OPENED', 'DENIED', 'SIGNED', 'DEPRECATED')

    + *
      + *
    • DRAFT - DRAFT
    • + *
    • APPROVAL-SENT - APPROVAL-SENT
    • + *
    • APPROVED - APPROVED
    • + *
    • SENT - SENT
    • + *
    • SENT-MANUALLY - SENT-MANUALLY
    • + *
    • OPENED - OPENED
    • + *
    • DENIED - DENIED
    • + *
    • SIGNED - SIGNED
    • + *
    • DEPRECATED - DEPRECATED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(OffersListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + public OffersListRequest build() { return new OffersListRequest( expand, @@ -556,6 +609,7 @@ public OffersListRequest build() { remoteFields, remoteId, showEnumOrigins, + status, additionalProperties); } } diff --git a/src/main/java/com/merge/api/ats/types/OffersListRequestStatus.java b/src/main/java/com/merge/api/ats/types/OffersListRequestStatus.java new file mode 100644 index 000000000..bba0c490e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersListRequestStatus.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class OffersListRequestStatus { + public static final OffersListRequestStatus DEPRECATED = + new OffersListRequestStatus(Value.DEPRECATED, "DEPRECATED"); + + public static final OffersListRequestStatus OPENED = new OffersListRequestStatus(Value.OPENED, "OPENED"); + + public static final OffersListRequestStatus SIGNED = new OffersListRequestStatus(Value.SIGNED, "SIGNED"); + + public static final OffersListRequestStatus DENIED = new OffersListRequestStatus(Value.DENIED, "DENIED"); + + public static final OffersListRequestStatus DRAFT = new OffersListRequestStatus(Value.DRAFT, "DRAFT"); + + public static final OffersListRequestStatus SENT_MANUALLY = + new OffersListRequestStatus(Value.SENT_MANUALLY, "SENT-MANUALLY"); + + public static final OffersListRequestStatus SENT = new OffersListRequestStatus(Value.SENT, "SENT"); + + public static final OffersListRequestStatus APPROVED = new OffersListRequestStatus(Value.APPROVED, "APPROVED"); + + public static final OffersListRequestStatus APPROVAL_SENT = + new OffersListRequestStatus(Value.APPROVAL_SENT, "APPROVAL-SENT"); + + private final Value value; + + private final String string; + + OffersListRequestStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof OffersListRequestStatus + && this.string.equals(((OffersListRequestStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DEPRECATED: + return visitor.visitDeprecated(); + case OPENED: + return visitor.visitOpened(); + case SIGNED: + return visitor.visitSigned(); + case DENIED: + return visitor.visitDenied(); + case DRAFT: + return visitor.visitDraft(); + case SENT_MANUALLY: + return visitor.visitSentManually(); + case SENT: + return visitor.visitSent(); + case APPROVED: + return visitor.visitApproved(); + case APPROVAL_SENT: + return visitor.visitApprovalSent(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OffersListRequestStatus valueOf(String value) { + switch (value) { + case "DEPRECATED": + return DEPRECATED; + case "OPENED": + return OPENED; + case "SIGNED": + return SIGNED; + case "DENIED": + return DENIED; + case "DRAFT": + return DRAFT; + case "SENT-MANUALLY": + return SENT_MANUALLY; + case "SENT": + return SENT; + case "APPROVED": + return APPROVED; + case "APPROVAL-SENT": + return APPROVAL_SENT; + default: + return new OffersListRequestStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + APPROVAL_SENT, + + APPROVED, + + DENIED, + + DEPRECATED, + + DRAFT, + + OPENED, + + SENT, + + SENT_MANUALLY, + + SIGNED, + + UNKNOWN + } + + public interface Visitor { + T visitApprovalSent(); + + T visitApproved(); + + T visitDenied(); + + T visitDeprecated(); + + T visitDraft(); + + T visitOpened(); + + T visitSent(); + + T visitSentManually(); + + T visitSigned(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/OfficesListRequest.java b/src/main/java/com/merge/api/ats/types/OfficesListRequest.java index 21317ceae..2593874ca 100644 --- a/src/main/java/com/merge/api/ats/types/OfficesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/OfficesListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/ats/types/PatchedEditFieldMappingRequest.java index 8152e9e50..7f4c201d8 100644 --- a/src/main/java/com/merge/api/ats/types/PatchedEditFieldMappingRequest.java +++ b/src/main/java/com/merge/api/ats/types/PatchedEditFieldMappingRequest.java @@ -22,25 +22,41 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + private final Optional> remoteFieldTraversalPath; private final Optional remoteMethod; private final Optional remoteUrlPath; + private final Optional jmesPath; + private final Map additionalProperties; private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, Optional> remoteFieldTraversalPath, Optional remoteMethod, Optional remoteUrlPath, + Optional jmesPath, Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. */ @@ -65,6 +81,14 @@ public Optional getRemoteUrlPath() { return remoteUrlPath; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +101,21 @@ public Map getAdditionalProperties() { } private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath); } @java.lang.Override @@ -98,21 +129,41 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + private Optional> remoteFieldTraversalPath = Optional.empty(); private Optional remoteMethod = Optional.empty(); private Optional remoteUrlPath = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); return this; } @@ -158,9 +209,28 @@ public Builder remoteUrlPath(String remoteUrlPath) { return this; } + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public PatchedEditFieldMappingRequest build() { return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/ats/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/ats/types/RegenerateAccountToken.java new file mode 100644 index 000000000..bd6a96871 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java b/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java index fbcd79bf5..7a1f80549 100644 --- a/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/RemoteData.java b/src/main/java/com/merge/api/ats/types/RemoteData.java index 897d6f542..0b380761f 100644 --- a/src/main/java/com/merge/api/ats/types/RemoteData.java +++ b/src/main/java/com/merge/api/ats/types/RemoteData.java @@ -42,6 +42,9 @@ public String getPath() { return path; } + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ @JsonProperty("data") public Optional getData() { return data; @@ -88,6 +91,9 @@ public interface PathStage { public interface _FinalStage { RemoteData build(); + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ _FinalStage data(Optional data); _FinalStage data(JsonNode data); @@ -123,12 +129,19 @@ public _FinalStage path(@NotNull String path) { return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage data(JsonNode data) { this.data = Optional.ofNullable(data); return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional data) { diff --git a/src/main/java/com/merge/api/ats/types/RoleEnum.java b/src/main/java/com/merge/api/ats/types/RoleEnum.java index 9fa4cb5c0..11af23bb5 100644 --- a/src/main/java/com/merge/api/ats/types/RoleEnum.java +++ b/src/main/java/com/merge/api/ats/types/RoleEnum.java @@ -17,6 +17,8 @@ public final class RoleEnum { public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); private final Value value; @@ -60,6 +62,8 @@ public T visit(Visitor visitor) { return visitor.visitMember(); case SYSTEM: return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); case ADMIN: return visitor.visitAdmin(); case UNKNOWN: @@ -81,6 +85,8 @@ public static RoleEnum valueOf(String value) { return MEMBER; case "SYSTEM": return SYSTEM; + case "SUPPORT": + return SUPPORT; case "ADMIN": return ADMIN; default: @@ -101,6 +107,8 @@ public enum Value { MERGE_TEAM, + SUPPORT, + UNKNOWN } @@ -117,6 +125,8 @@ public interface Visitor { T visitMergeTeam(); + T visitSupport(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java b/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java index f517e5cee..7437cae54 100644 --- a/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java @@ -191,7 +191,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -515,7 +515,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java index 7b6b7c60b..98ae6c730 100644 --- a/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -41,7 +40,7 @@ public final class ScreeningQuestion { private final Optional required; - private final Optional> options; + private final Optional> options; private final Optional remoteWasDeleted; @@ -57,7 +56,7 @@ private ScreeningQuestion( Optional title, Optional type, Optional required, - Optional> options, + Optional> options, Optional remoteWasDeleted, Map additionalProperties) { this.id = id; @@ -154,7 +153,7 @@ public Optional getRequired() { } @JsonProperty("options") - public Optional> getOptions() { + public Optional> getOptions() { return options; } @@ -236,7 +235,7 @@ public static final class Builder { private Optional required = Optional.empty(); - private Optional> options = Optional.empty(); + private Optional> options = Optional.empty(); private Optional remoteWasDeleted = Optional.empty(); @@ -394,12 +393,12 @@ public Builder required(Boolean required) { } @JsonSetter(value = "options", nulls = Nulls.SKIP) - public Builder options(Optional> options) { + public Builder options(Optional> options) { this.options = options; return this; } - public Builder options(List options) { + public Builder options(List options) { this.options = Optional.ofNullable(options); return this; } diff --git a/src/main/java/com/merge/api/ats/types/ScreeningQuestionOptionsItem.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionOptionsItem.java new file mode 100644 index 000000000..25bd62c6b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionOptionsItem.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ats.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ScreeningQuestionOptionsItem.Deserializer.class) +public final class ScreeningQuestionOptionsItem { + private final Object value; + + private final int type; + + private ScreeningQuestionOptionsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((ScreeningQuestionOption) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ScreeningQuestionOptionsItem && equalTo((ScreeningQuestionOptionsItem) other); + } + + private boolean equalTo(ScreeningQuestionOptionsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ScreeningQuestionOptionsItem of(String value) { + return new ScreeningQuestionOptionsItem(value, 0); + } + + public static ScreeningQuestionOptionsItem of(ScreeningQuestionOption value) { + return new ScreeningQuestionOptionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(ScreeningQuestionOption value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ScreeningQuestionOptionsItem.class); + } + + @java.lang.Override + public ScreeningQuestionOptionsItem deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ScreeningQuestionOption.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/ats/types/SyncStatusListRequest.java index 118fb03f0..9b55179c3 100644 --- a/src/main/java/com/merge/api/ats/types/SyncStatusListRequest.java +++ b/src/main/java/com/merge/api/ats/types/SyncStatusListRequest.java @@ -42,7 +42,7 @@ public Optional getCursor() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -110,7 +110,7 @@ public Builder cursor(String cursor) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/TagsListRequest.java b/src/main/java/com/merge/api/ats/types/TagsListRequest.java index 4c5e68590..f993599d3 100644 --- a/src/main/java/com/merge/api/ats/types/TagsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/TagsListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ats/types/UsersListRequest.java b/src/main/java/com/merge/api/ats/types/UsersListRequest.java index e26e628e1..bfaa458a1 100644 --- a/src/main/java/com/merge/api/ats/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/ats/types/UsersListRequest.java @@ -153,7 +153,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -415,7 +415,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/chat/AccountDetailsClient.java b/src/main/java/com/merge/api/chat/AccountDetailsClient.java new file mode 100644 index 000000000..b56524f50 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetails; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/AccountTokenClient.java b/src/main/java/com/merge/api/chat/AccountTokenClient.java new file mode 100644 index 000000000..1e543e199 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AccountTokenClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountToken; +import com.merge.api.chat.types.RegenerateAccountToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/chat/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..a8094fe66 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetails; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/chat/AsyncAccountTokenClient.java new file mode 100644 index 000000000..1d42c41e7 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncAccountTokenClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountToken; +import com.merge.api.chat.types.RegenerateAccountToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/chat/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..77fa7fe7a --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AsyncPassthroughReciept; +import com.merge.api.chat.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.chat.types.DataPassthroughRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/chat/AsyncAuditTrailClient.java new file mode 100644 index 000000000..55888258d --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AuditLogEvent; +import com.merge.api.chat.types.AuditTrailListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/chat/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..7139ddd14 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AvailableActions; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncChatClient.java b/src/main/java/com/merge/api/chat/AsyncChatClient.java new file mode 100644 index 000000000..9cd60a0e3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncChatClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncChatClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier conversationsClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier groupsClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier messagesClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public AsyncChatClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.conversationsClient = Suppliers.memoize(() -> new AsyncConversationsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.groupsClient = Suppliers.memoize(() -> new AsyncGroupsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.messagesClient = Suppliers.memoize(() -> new AsyncMessagesClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncConversationsClient conversations() { + return this.conversationsClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncGroupsClient groups() { + return this.groupsClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncMessagesClient messages() { + return this.messagesClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncConversationsClient.java b/src/main/java/com/merge/api/chat/AsyncConversationsClient.java new file mode 100644 index 000000000..282eb160d --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncConversationsClient.java @@ -0,0 +1,101 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Conversation; +import com.merge.api.chat.types.ConversationsListRequest; +import com.merge.api.chat.types.ConversationsMembersListRequest; +import com.merge.api.chat.types.ConversationsRetrieveRequest; +import com.merge.api.chat.types.Member; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncConversationsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawConversationsClient rawClient; + + public AsyncConversationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawConversationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawConversationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Conversation objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Conversation objects. + */ + public CompletableFuture> list(ConversationsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Conversation objects. + */ + public CompletableFuture> list( + ConversationsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of Member objects. + */ + public CompletableFuture> membersList(String conversationId) { + return this.rawClient.membersList(conversationId).thenApply(response -> response.body()); + } + + /** + * Returns a list of Member objects. + */ + public CompletableFuture> membersList( + String conversationId, ConversationsMembersListRequest request) { + return this.rawClient.membersList(conversationId, request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Member objects. + */ + public CompletableFuture> membersList( + String conversationId, ConversationsMembersListRequest request, RequestOptions requestOptions) { + return this.rawClient + .membersList(conversationId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * Returns a Conversation object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Conversation object with the given id. + */ + public CompletableFuture retrieve(String id, ConversationsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Conversation object with the given id. + */ + public CompletableFuture retrieve( + String id, ConversationsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/chat/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..0d2ddea78 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/chat/AsyncFieldMappingClient.java new file mode 100644 index 000000000..0656955e4 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncFieldMappingClient.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.CreateFieldMappingRequest; +import com.merge.api.chat.types.CreateTargetFieldRequest; +import com.merge.api.chat.types.ExternalTargetFieldApiResponse; +import com.merge.api.chat.types.FieldMappingApiInstanceResponse; +import com.merge.api.chat.types.FieldMappingInstanceResponse; +import com.merge.api.chat.types.FieldMappingsRetrieveRequest; +import com.merge.api.chat.types.PatchedEditFieldMappingRequest; +import com.merge.api.chat.types.RemoteFieldApiResponse; +import com.merge.api.chat.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture targetFieldsCreate(CreateTargetFieldRequest request) { + return this.rawClient.targetFieldsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + return this.rawClient.targetFieldsCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncForceResyncClient.java b/src/main/java/com/merge/api/chat/AsyncForceResyncClient.java new file mode 100644 index 000000000..f85d65799 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/chat/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..636af5394 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.GenerateRemoteKeyRequest; +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncGroupsClient.java b/src/main/java/com/merge/api/chat/AsyncGroupsClient.java new file mode 100644 index 000000000..5f3486fb0 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncGroupsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Group; +import com.merge.api.chat.types.GroupsListRequest; +import com.merge.api.chat.types.GroupsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncGroupsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGroupsClient rawClient; + + public AsyncGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncIssuesClient.java b/src/main/java/com/merge/api/chat/AsyncIssuesClient.java new file mode 100644 index 000000000..291c1484e --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Issue; +import com.merge.api.chat.types.IssuesListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/chat/AsyncLinkTokenClient.java new file mode 100644 index 000000000..fd83e1988 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.EndUserDetailsRequest; +import com.merge.api.chat.types.LinkToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/chat/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..df33ce7b4 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetailsAndActions; +import com.merge.api.chat.types.LinkedAccountsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncMessagesClient.java b/src/main/java/com/merge/api/chat/AsyncMessagesClient.java new file mode 100644 index 000000000..2963dde59 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncMessagesClient.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Message; +import com.merge.api.chat.types.MessagesListRequest; +import com.merge.api.chat.types.MessagesRepliesListRequest; +import com.merge.api.chat.types.MessagesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncMessagesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawMessagesClient rawClient; + + public AsyncMessagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawMessagesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawMessagesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture> list(MessagesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture> list( + MessagesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Message object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Message object with the given id. + */ + public CompletableFuture retrieve(String id, MessagesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Message object with the given id. + */ + public CompletableFuture retrieve( + String id, MessagesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture> repliesList(String messageId) { + return this.rawClient.repliesList(messageId).thenApply(response -> response.body()); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture> repliesList( + String messageId, MessagesRepliesListRequest request) { + return this.rawClient.repliesList(messageId, request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture> repliesList( + String messageId, MessagesRepliesListRequest request, RequestOptions requestOptions) { + return this.rawClient.repliesList(messageId, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncPassthroughClient.java b/src/main/java/com/merge/api/chat/AsyncPassthroughClient.java new file mode 100644 index 000000000..2c973a136 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.DataPassthroughRequest; +import com.merge.api.chat.types.RemoteResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/chat/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..f0f0d9f88 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawAccountDetailsClient.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetails; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/chat/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..6aa95bd75 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawAccountTokenClient.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountToken; +import com.merge.api.chat.types.RegenerateAccountToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/chat/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..c55648901 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.AsyncPassthroughReciept; +import com.merge.api.chat.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.chat.types.DataPassthroughRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/chat/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..9d8c08604 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawAuditTrailClient.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AuditLogEvent; +import com.merge.api.chat.types.AuditTrailListRequest; +import com.merge.api.chat.types.PaginatedAuditLogEventList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/chat/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..d91f51313 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawAvailableActionsClient.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AvailableActions; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawConversationsClient.java b/src/main/java/com/merge/api/chat/AsyncRawConversationsClient.java new file mode 100644 index 000000000..d90dd2613 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawConversationsClient.java @@ -0,0 +1,361 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Conversation; +import com.merge.api.chat.types.ConversationsListRequest; +import com.merge.api.chat.types.ConversationsMembersListRequest; +import com.merge.api.chat.types.ConversationsRetrieveRequest; +import com.merge.api.chat.types.Member; +import com.merge.api.chat.types.PaginatedConversationList; +import com.merge.api.chat.types.PaginatedMemberList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawConversationsClient { + protected final ClientOptions clientOptions; + + public AsyncRawConversationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Conversation objects. + */ + public CompletableFuture>> list() { + return list(ConversationsListRequest.builder().build()); + } + + /** + * Returns a list of Conversation objects. + */ + public CompletableFuture>> list( + ConversationsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Conversation objects. + */ + public CompletableFuture>> list( + ConversationsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/conversations"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedConversationList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedConversationList.class); + Optional startingAfter = parsedResponse.getNext(); + ConversationsListRequest nextRequest = ConversationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of Member objects. + */ + public CompletableFuture>> membersList(String conversationId) { + return membersList( + conversationId, ConversationsMembersListRequest.builder().build()); + } + + /** + * Returns a list of Member objects. + */ + public CompletableFuture>> membersList( + String conversationId, ConversationsMembersListRequest request) { + return membersList(conversationId, request, null); + } + + /** + * Returns a list of Member objects. + */ + public CompletableFuture>> membersList( + String conversationId, ConversationsMembersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/conversations") + .addPathSegment(conversationId) + .addPathSegments("members"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedMemberList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedMemberList.class); + Optional startingAfter = parsedResponse.getNext(); + ConversationsMembersListRequest nextRequest = ConversationsMembersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return membersList(conversationId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Conversation object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ConversationsRetrieveRequest.builder().build()); + } + + /** + * Returns a Conversation object with the given id. + */ + public CompletableFuture> retrieve( + String id, ConversationsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Conversation object with the given id. + */ + public CompletableFuture> retrieve( + String id, ConversationsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/conversations") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Conversation.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/chat/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..871884b03 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawDeleteAccountClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/chat/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..422a6f136 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawFieldMappingClient.java @@ -0,0 +1,524 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.CreateFieldMappingRequest; +import com.merge.api.chat.types.CreateTargetFieldRequest; +import com.merge.api.chat.types.ExternalTargetFieldApiResponse; +import com.merge.api.chat.types.FieldMappingApiInstanceResponse; +import com.merge.api.chat.types.FieldMappingInstanceResponse; +import com.merge.api.chat.types.FieldMappingsRetrieveRequest; +import com.merge.api.chat.types.PatchedEditFieldMappingRequest; +import com.merge.api.chat.types.RemoteFieldApiResponse; +import com.merge.api.chat.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingApiInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings") + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * 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. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, 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. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * 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. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ExternalTargetFieldApiResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture> targetFieldsCreate( + CreateTargetFieldRequest request) { + return targetFieldsCreate(request, null); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture> targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/target-fields") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ExternalTargetFieldApiResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/chat/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..4b9001d7b --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawForceResyncClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * 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. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/chat/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..79975887c --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawGenerateKeyClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.GenerateRemoteKeyRequest; +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawGroupsClient.java b/src/main/java/com/merge/api/chat/AsyncRawGroupsClient.java new file mode 100644 index 000000000..69006a7bb --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawGroupsClient.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Group; +import com.merge.api.chat.types.GroupsListRequest; +import com.merge.api.chat.types.GroupsRetrieveRequest; +import com.merge.api.chat.types.PaginatedGroupList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGroupsClient { + protected final ClientOptions clientOptions; + + public AsyncRawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/chat/AsyncRawIssuesClient.java new file mode 100644 index 000000000..8e1bb7d76 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawIssuesClient.java @@ -0,0 +1,241 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Issue; +import com.merge.api.chat.types.IssuesListRequest; +import com.merge.api.chat.types.PaginatedIssueList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/chat/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..a5a693830 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawLinkTokenClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.EndUserDetailsRequest; +import com.merge.api.chat.types.LinkToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/chat/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..3560c6b64 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetailsAndActions; +import com.merge.api.chat.types.LinkedAccountsListRequest; +import com.merge.api.chat.types.PaginatedAccountDetailsAndActionsList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawMessagesClient.java b/src/main/java/com/merge/api/chat/AsyncRawMessagesClient.java new file mode 100644 index 000000000..a13b84a79 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawMessagesClient.java @@ -0,0 +1,360 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Message; +import com.merge.api.chat.types.MessagesListRequest; +import com.merge.api.chat.types.MessagesRepliesListRequest; +import com.merge.api.chat.types.MessagesRetrieveRequest; +import com.merge.api.chat.types.PaginatedMessageList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawMessagesClient { + protected final ClientOptions clientOptions; + + public AsyncRawMessagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture>> list() { + return list(MessagesListRequest.builder().build()); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture>> list(MessagesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture>> list( + MessagesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/messages"); + if (request.getConversationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "conversation_id", request.getConversationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRootMessage().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "root_message", request.getRootMessage().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedMessageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedMessageList.class); + Optional startingAfter = parsedResponse.getNext(); + MessagesListRequest nextRequest = MessagesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Message object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, MessagesRetrieveRequest.builder().build()); + } + + /** + * Returns a Message object with the given id. + */ + public CompletableFuture> retrieve(String id, MessagesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Message object with the given id. + */ + public CompletableFuture> retrieve( + String id, MessagesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/messages") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Message.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture>> repliesList(String messageId) { + return repliesList(messageId, MessagesRepliesListRequest.builder().build()); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture>> repliesList( + String messageId, MessagesRepliesListRequest request) { + return repliesList(messageId, request, null); + } + + /** + * Returns a list of Message objects. + */ + public CompletableFuture>> repliesList( + String messageId, MessagesRepliesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/messages") + .addPathSegment(messageId) + .addPathSegments("replies"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedMessageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedMessageList.class); + Optional startingAfter = parsedResponse.getNext(); + MessagesRepliesListRequest nextRequest = MessagesRepliesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return repliesList(messageId, nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/chat/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..bc2868bdf --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawPassthroughClient.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.DataPassthroughRequest; +import com.merge.api.chat.types.RemoteResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/chat/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..11925f6ef --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.chat.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawScopesClient.java b/src/main/java/com/merge/api/chat/AsyncRawScopesClient.java new file mode 100644 index 000000000..f9afafa55 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawScopesClient.java @@ -0,0 +1,209 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.CommonModelScopeApi; +import com.merge.api.chat.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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 + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * 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 + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/chat/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..4b3a9511d --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawSyncStatusClient.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.PaginatedSyncStatusList; +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.chat.types.SyncStatusListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * 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. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * 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. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawUsersClient.java b/src/main/java/com/merge/api/chat/AsyncRawUsersClient.java new file mode 100644 index 000000000..67439bcff --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawUsersClient.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.PaginatedUserList; +import com.merge.api.chat.types.User; +import com.merge.api.chat.types.UsersListRequest; +import com.merge.api.chat.types.UsersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/chat/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..65c1f88c0 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.chat.types.WebhookReceiver; +import com.merge.api.chat.types.WebhookReceiverRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/chat/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..7cdc21fde --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.chat.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncScopesClient.java b/src/main/java/com/merge/api/chat/AsyncScopesClient.java new file mode 100644 index 000000000..42c88b343 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.CommonModelScopeApi; +import com.merge.api.chat.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * 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 + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * 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 + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/chat/AsyncSyncStatusClient.java new file mode 100644 index 000000000..2abd50a40 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.chat.types.SyncStatusListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncUsersClient.java b/src/main/java/com/merge/api/chat/AsyncUsersClient.java new file mode 100644 index 000000000..03d9c7297 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncUsersClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.User; +import com.merge.api.chat.types.UsersListRequest; +import com.merge.api.chat.types.UsersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/chat/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..2378a5e2f --- /dev/null +++ b/src/main/java/com/merge/api/chat/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.WebhookReceiver; +import com.merge.api.chat.types.WebhookReceiverRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/chat/AuditTrailClient.java b/src/main/java/com/merge/api/chat/AuditTrailClient.java new file mode 100644 index 000000000..398e58ba7 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AuditLogEvent; +import com.merge.api.chat.types.AuditTrailListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/AvailableActionsClient.java b/src/main/java/com/merge/api/chat/AvailableActionsClient.java new file mode 100644 index 000000000..aebb4a858 --- /dev/null +++ b/src/main/java/com/merge/api/chat/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AvailableActions; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/ChatClient.java b/src/main/java/com/merge/api/chat/ChatClient.java new file mode 100644 index 000000000..53f48cddf --- /dev/null +++ b/src/main/java/com/merge/api/chat/ChatClient.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class ChatClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier conversationsClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier groupsClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier messagesClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public ChatClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); + this.conversationsClient = Suppliers.memoize(() -> new ConversationsClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions)); + this.groupsClient = Suppliers.memoize(() -> new GroupsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); + this.messagesClient = Suppliers.memoize(() -> new MessagesClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new WebhookReceiversClient(clientOptions)); + } + + public AccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public ConversationsClient conversations() { + return this.conversationsClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public GenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public GroupsClient groups() { + return this.groupsClient.get(); + } + + public IssuesClient issues() { + return this.issuesClient.get(); + } + + public LinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public LinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public MessagesClient messages() { + return this.messagesClient.get(); + } + + public PassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/chat/ConversationsClient.java b/src/main/java/com/merge/api/chat/ConversationsClient.java new file mode 100644 index 000000000..736bef311 --- /dev/null +++ b/src/main/java/com/merge/api/chat/ConversationsClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Conversation; +import com.merge.api.chat.types.ConversationsListRequest; +import com.merge.api.chat.types.ConversationsMembersListRequest; +import com.merge.api.chat.types.ConversationsRetrieveRequest; +import com.merge.api.chat.types.Member; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class ConversationsClient { + protected final ClientOptions clientOptions; + + private final RawConversationsClient rawClient; + + public ConversationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawConversationsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawConversationsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Conversation objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Conversation objects. + */ + public SyncPagingIterable list(ConversationsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Conversation objects. + */ + public SyncPagingIterable list(ConversationsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a list of Member objects. + */ + public SyncPagingIterable membersList(String conversationId) { + return this.rawClient.membersList(conversationId).body(); + } + + /** + * Returns a list of Member objects. + */ + public SyncPagingIterable membersList(String conversationId, ConversationsMembersListRequest request) { + return this.rawClient.membersList(conversationId, request).body(); + } + + /** + * Returns a list of Member objects. + */ + public SyncPagingIterable membersList( + String conversationId, ConversationsMembersListRequest request, RequestOptions requestOptions) { + return this.rawClient + .membersList(conversationId, request, requestOptions) + .body(); + } + + /** + * Returns a Conversation object with the given id. + */ + public Conversation retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Conversation object with the given id. + */ + public Conversation retrieve(String id, ConversationsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Conversation object with the given id. + */ + public Conversation retrieve(String id, ConversationsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/DeleteAccountClient.java b/src/main/java/com/merge/api/chat/DeleteAccountClient.java new file mode 100644 index 000000000..aa1ccb23f --- /dev/null +++ b/src/main/java/com/merge/api/chat/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/FieldMappingClient.java b/src/main/java/com/merge/api/chat/FieldMappingClient.java new file mode 100644 index 000000000..43ecffcd2 --- /dev/null +++ b/src/main/java/com/merge/api/chat/FieldMappingClient.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.CreateFieldMappingRequest; +import com.merge.api.chat.types.CreateTargetFieldRequest; +import com.merge.api.chat.types.ExternalTargetFieldApiResponse; +import com.merge.api.chat.types.FieldMappingApiInstanceResponse; +import com.merge.api.chat.types.FieldMappingInstanceResponse; +import com.merge.api.chat.types.FieldMappingsRetrieveRequest; +import com.merge.api.chat.types.PatchedEditFieldMappingRequest; +import com.merge.api.chat.types.RemoteFieldApiResponse; +import com.merge.api.chat.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * 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. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * 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. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * 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. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * 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. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * 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. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsCreate(CreateTargetFieldRequest request) { + return this.rawClient.targetFieldsCreate(request).body(); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + return this.rawClient.targetFieldsCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/ForceResyncClient.java b/src/main/java/com/merge/api/chat/ForceResyncClient.java new file mode 100644 index 000000000..2c304556f --- /dev/null +++ b/src/main/java/com/merge/api/chat/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * 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. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/GenerateKeyClient.java b/src/main/java/com/merge/api/chat/GenerateKeyClient.java new file mode 100644 index 000000000..12de4395e --- /dev/null +++ b/src/main/java/com/merge/api/chat/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.GenerateRemoteKeyRequest; +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/GroupsClient.java b/src/main/java/com/merge/api/chat/GroupsClient.java new file mode 100644 index 000000000..814726d26 --- /dev/null +++ b/src/main/java/com/merge/api/chat/GroupsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Group; +import com.merge.api.chat.types.GroupsListRequest; +import com.merge.api.chat.types.GroupsRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class GroupsClient { + protected final ClientOptions clientOptions; + + private final RawGroupsClient rawClient; + + public GroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/IssuesClient.java b/src/main/java/com/merge/api/chat/IssuesClient.java new file mode 100644 index 000000000..ae23bd2b3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Issue; +import com.merge.api.chat.types.IssuesListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/LinkTokenClient.java b/src/main/java/com/merge/api/chat/LinkTokenClient.java new file mode 100644 index 000000000..1617c07ab --- /dev/null +++ b/src/main/java/com/merge/api/chat/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.EndUserDetailsRequest; +import com.merge.api.chat.types.LinkToken; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/LinkedAccountsClient.java b/src/main/java/com/merge/api/chat/LinkedAccountsClient.java new file mode 100644 index 000000000..2bad375b0 --- /dev/null +++ b/src/main/java/com/merge/api/chat/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetailsAndActions; +import com.merge.api.chat.types.LinkedAccountsListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/MessagesClient.java b/src/main/java/com/merge/api/chat/MessagesClient.java new file mode 100644 index 000000000..1d488e238 --- /dev/null +++ b/src/main/java/com/merge/api/chat/MessagesClient.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Message; +import com.merge.api.chat.types.MessagesListRequest; +import com.merge.api.chat.types.MessagesRepliesListRequest; +import com.merge.api.chat.types.MessagesRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class MessagesClient { + protected final ClientOptions clientOptions; + + private final RawMessagesClient rawClient; + + public MessagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawMessagesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawMessagesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Message objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Message objects. + */ + public SyncPagingIterable list(MessagesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Message objects. + */ + public SyncPagingIterable list(MessagesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Message object with the given id. + */ + public Message retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Message object with the given id. + */ + public Message retrieve(String id, MessagesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Message object with the given id. + */ + public Message retrieve(String id, MessagesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } + + /** + * Returns a list of Message objects. + */ + public SyncPagingIterable repliesList(String messageId) { + return this.rawClient.repliesList(messageId).body(); + } + + /** + * Returns a list of Message objects. + */ + public SyncPagingIterable repliesList(String messageId, MessagesRepliesListRequest request) { + return this.rawClient.repliesList(messageId, request).body(); + } + + /** + * Returns a list of Message objects. + */ + public SyncPagingIterable repliesList( + String messageId, MessagesRepliesListRequest request, RequestOptions requestOptions) { + return this.rawClient.repliesList(messageId, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/PassthroughClient.java b/src/main/java/com/merge/api/chat/PassthroughClient.java new file mode 100644 index 000000000..0f5bd563f --- /dev/null +++ b/src/main/java/com/merge/api/chat/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.DataPassthroughRequest; +import com.merge.api.chat.types.RemoteResponse; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/RawAccountDetailsClient.java b/src/main/java/com/merge/api/chat/RawAccountDetailsClient.java new file mode 100644 index 000000000..aa29d6cbe --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawAccountDetailsClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetails; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawAccountTokenClient.java b/src/main/java/com/merge/api/chat/RawAccountTokenClient.java new file mode 100644 index 000000000..a11c34536 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawAccountTokenClient.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountToken; +import com.merge.api.chat.types.RegenerateAccountToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/chat/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..4bae4584a --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawAsyncPassthroughClient.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.AsyncPassthroughReciept; +import com.merge.api.chat.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.chat.types.DataPassthroughRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawAuditTrailClient.java b/src/main/java/com/merge/api/chat/RawAuditTrailClient.java new file mode 100644 index 000000000..03e2a62d5 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawAuditTrailClient.java @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AuditLogEvent; +import com.merge.api.chat.types.AuditTrailListRequest; +import com.merge.api.chat.types.PaginatedAuditLogEventList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawAvailableActionsClient.java b/src/main/java/com/merge/api/chat/RawAvailableActionsClient.java new file mode 100644 index 000000000..a1bd77ccb --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawAvailableActionsClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AvailableActions; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawConversationsClient.java b/src/main/java/com/merge/api/chat/RawConversationsClient.java new file mode 100644 index 000000000..211157ee2 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawConversationsClient.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Conversation; +import com.merge.api.chat.types.ConversationsListRequest; +import com.merge.api.chat.types.ConversationsMembersListRequest; +import com.merge.api.chat.types.ConversationsRetrieveRequest; +import com.merge.api.chat.types.Member; +import com.merge.api.chat.types.PaginatedConversationList; +import com.merge.api.chat.types.PaginatedMemberList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawConversationsClient { + protected final ClientOptions clientOptions; + + public RawConversationsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Conversation objects. + */ + public MergeApiHttpResponse> list() { + return list(ConversationsListRequest.builder().build()); + } + + /** + * Returns a list of Conversation objects. + */ + public MergeApiHttpResponse> list(ConversationsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Conversation objects. + */ + public MergeApiHttpResponse> list( + ConversationsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/conversations"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedConversationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedConversationList.class); + Optional startingAfter = parsedResponse.getNext(); + ConversationsListRequest nextRequest = ConversationsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of Member objects. + */ + public MergeApiHttpResponse> membersList(String conversationId) { + return membersList( + conversationId, ConversationsMembersListRequest.builder().build()); + } + + /** + * Returns a list of Member objects. + */ + public MergeApiHttpResponse> membersList( + String conversationId, ConversationsMembersListRequest request) { + return membersList(conversationId, request, null); + } + + /** + * Returns a list of Member objects. + */ + public MergeApiHttpResponse> membersList( + String conversationId, ConversationsMembersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/conversations") + .addPathSegment(conversationId) + .addPathSegments("members"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedMemberList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedMemberList.class); + Optional startingAfter = parsedResponse.getNext(); + ConversationsMembersListRequest nextRequest = ConversationsMembersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> membersList( + conversationId, nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Conversation object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ConversationsRetrieveRequest.builder().build()); + } + + /** + * Returns a Conversation object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ConversationsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Conversation object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ConversationsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/conversations") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Conversation.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawDeleteAccountClient.java b/src/main/java/com/merge/api/chat/RawDeleteAccountClient.java new file mode 100644 index 000000000..973232f6a --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawDeleteAccountClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawFieldMappingClient.java b/src/main/java/com/merge/api/chat/RawFieldMappingClient.java new file mode 100644 index 000000000..d32232964 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawFieldMappingClient.java @@ -0,0 +1,410 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.CreateFieldMappingRequest; +import com.merge.api.chat.types.CreateTargetFieldRequest; +import com.merge.api.chat.types.ExternalTargetFieldApiResponse; +import com.merge.api.chat.types.FieldMappingApiInstanceResponse; +import com.merge.api.chat.types.FieldMappingInstanceResponse; +import com.merge.api.chat.types.FieldMappingsRetrieveRequest; +import com.merge.api.chat.types.PatchedEditFieldMappingRequest; +import com.merge.api.chat.types.RemoteFieldApiResponse; +import com.merge.api.chat.types.RemoteFieldsRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/field-mappings") + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * 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. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, 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. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * 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. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public MergeApiHttpResponse targetFieldsCreate(CreateTargetFieldRequest request) { + return targetFieldsCreate(request, null); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public MergeApiHttpResponse targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/target-fields") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawForceResyncClient.java b/src/main/java/com/merge/api/chat/RawForceResyncClient.java new file mode 100644 index 000000000..26003926f --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawForceResyncClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * 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. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawGenerateKeyClient.java b/src/main/java/com/merge/api/chat/RawGenerateKeyClient.java new file mode 100644 index 000000000..32f9f2a96 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawGenerateKeyClient.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.GenerateRemoteKeyRequest; +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawGroupsClient.java b/src/main/java/com/merge/api/chat/RawGroupsClient.java new file mode 100644 index 000000000..ec7018505 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawGroupsClient.java @@ -0,0 +1,204 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Group; +import com.merge.api.chat.types.GroupsListRequest; +import com.merge.api.chat.types.GroupsRetrieveRequest; +import com.merge.api.chat.types.PaginatedGroupList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGroupsClient { + protected final ClientOptions clientOptions; + + public RawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawIssuesClient.java b/src/main/java/com/merge/api/chat/RawIssuesClient.java new file mode 100644 index 000000000..53d0350e2 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawIssuesClient.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Issue; +import com.merge.api.chat.types.IssuesListRequest; +import com.merge.api.chat.types.PaginatedIssueList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawLinkTokenClient.java b/src/main/java/com/merge/api/chat/RawLinkTokenClient.java new file mode 100644 index 000000000..778337d08 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawLinkTokenClient.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.EndUserDetailsRequest; +import com.merge.api.chat.types.LinkToken; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/chat/RawLinkedAccountsClient.java new file mode 100644 index 000000000..c8cc6c8ff --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawLinkedAccountsClient.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.AccountDetailsAndActions; +import com.merge.api.chat.types.LinkedAccountsListRequest; +import com.merge.api.chat.types.PaginatedAccountDetailsAndActionsList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawMessagesClient.java b/src/main/java/com/merge/api/chat/RawMessagesClient.java new file mode 100644 index 000000000..8e2dc7085 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawMessagesClient.java @@ -0,0 +1,300 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.Message; +import com.merge.api.chat.types.MessagesListRequest; +import com.merge.api.chat.types.MessagesRepliesListRequest; +import com.merge.api.chat.types.MessagesRetrieveRequest; +import com.merge.api.chat.types.PaginatedMessageList; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawMessagesClient { + protected final ClientOptions clientOptions; + + public RawMessagesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Message objects. + */ + public MergeApiHttpResponse> list() { + return list(MessagesListRequest.builder().build()); + } + + /** + * Returns a list of Message objects. + */ + public MergeApiHttpResponse> list(MessagesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Message objects. + */ + public MergeApiHttpResponse> list( + MessagesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/messages"); + if (request.getConversationId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "conversation_id", request.getConversationId().get(), false); + } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRootMessage().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "root_message", request.getRootMessage().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedMessageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedMessageList.class); + Optional startingAfter = parsedResponse.getNext(); + MessagesListRequest nextRequest = MessagesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Message object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, MessagesRetrieveRequest.builder().build()); + } + + /** + * Returns a Message object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, MessagesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Message object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, MessagesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/messages") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Message.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of Message objects. + */ + public MergeApiHttpResponse> repliesList(String messageId) { + return repliesList(messageId, MessagesRepliesListRequest.builder().build()); + } + + /** + * Returns a list of Message objects. + */ + public MergeApiHttpResponse> repliesList( + String messageId, MessagesRepliesListRequest request) { + return repliesList(messageId, request, null); + } + + /** + * Returns a list of Message objects. + */ + public MergeApiHttpResponse> repliesList( + String messageId, MessagesRepliesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/messages") + .addPathSegment(messageId) + .addPathSegments("replies"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getOrderBy().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "order_by", request.getOrderBy().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedMessageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedMessageList.class); + Optional startingAfter = parsedResponse.getNext(); + MessagesRepliesListRequest nextRequest = MessagesRepliesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> repliesList( + messageId, nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawPassthroughClient.java b/src/main/java/com/merge/api/chat/RawPassthroughClient.java new file mode 100644 index 000000000..6d3c7b8cb --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawPassthroughClient.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.DataPassthroughRequest; +import com.merge.api.chat.types.RemoteResponse; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/chat/RawRegenerateKeyClient.java new file mode 100644 index 000000000..d465fce9a --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawRegenerateKeyClient.java @@ -0,0 +1,79 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.chat.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawScopesClient.java b/src/main/java/com/merge/api/chat/RawScopesClient.java new file mode 100644 index 000000000..9e855fdea --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawScopesClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.chat.types.CommonModelScopeApi; +import com.merge.api.chat.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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 + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * 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 + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawSyncStatusClient.java b/src/main/java/com/merge/api/chat/RawSyncStatusClient.java new file mode 100644 index 000000000..984692ce8 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawSyncStatusClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.PaginatedSyncStatusList; +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.chat.types.SyncStatusListRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * 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. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawUsersClient.java b/src/main/java/com/merge/api/chat/RawUsersClient.java new file mode 100644 index 000000000..2b2f7a3d3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawUsersClient.java @@ -0,0 +1,203 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.PaginatedUserList; +import com.merge.api.chat.types.User; +import com.merge.api.chat.types.UsersListRequest; +import com.merge.api.chat.types.UsersRetrieveRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/chat/RawWebhookReceiversClient.java new file mode 100644 index 000000000..0b0396f3e --- /dev/null +++ b/src/main/java/com/merge/api/chat/RawWebhookReceiversClient.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.chat.types.WebhookReceiver; +import com.merge.api.chat.types.WebhookReceiverRequest; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("chat/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/chat/RegenerateKeyClient.java b/src/main/java/com/merge/api/chat/RegenerateKeyClient.java new file mode 100644 index 000000000..f57fbb269 --- /dev/null +++ b/src/main/java/com/merge/api/chat/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.RemoteKey; +import com.merge.api.chat.types.RemoteKeyForRegenerationRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/ScopesClient.java b/src/main/java/com/merge/api/chat/ScopesClient.java new file mode 100644 index 000000000..569f5c3fa --- /dev/null +++ b/src/main/java/com/merge/api/chat/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.CommonModelScopeApi; +import com.merge.api.chat.types.LinkedAccountCommonModelScopeDeserializerRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * 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 + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * 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 + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/SyncStatusClient.java b/src/main/java/com/merge/api/chat/SyncStatusClient.java new file mode 100644 index 000000000..cafe2a904 --- /dev/null +++ b/src/main/java/com/merge/api/chat/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.SyncStatus; +import com.merge.api.chat.types.SyncStatusListRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * 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. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * 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. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/UsersClient.java b/src/main/java/com/merge/api/chat/UsersClient.java new file mode 100644 index 000000000..4615f8af9 --- /dev/null +++ b/src/main/java/com/merge/api/chat/UsersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.User; +import com.merge.api.chat.types.UsersListRequest; +import com.merge.api.chat.types.UsersRetrieveRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/WebhookReceiversClient.java b/src/main/java/com/merge/api/chat/WebhookReceiversClient.java new file mode 100644 index 000000000..335e6774a --- /dev/null +++ b/src/main/java/com/merge/api/chat/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat; + +import com.merge.api.chat.types.WebhookReceiver; +import com.merge.api.chat.types.WebhookReceiverRequest; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountDetails.java b/src/main/java/com/merge/api/chat/types/AccountDetails.java new file mode 100644 index 000000000..d6e76fad6 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountDetails.java @@ -0,0 +1,451 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Optional instanceId; + + private final Optional instanceDisplayValue; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return 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. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt, + this.instanceId, + this.instanceDisplayValue); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(AccountDetailsCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + *

    The time at which account completes the linking flow.

    + */ + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + instanceId, + instanceDisplayValue, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..eebcecfd1 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActions.java @@ -0,0 +1,525 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatus status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Optional> integrationSpecificFields; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatus status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Optional> integrationSpecificFields, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatus getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return 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. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt, + this.integrationSpecificFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatus status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(AccountDetailsAndActionsCategory category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + /** + *

    The tenant or domain the customer has provided access to.

    + */ + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + /** + *

    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.

    + */ + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatus status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional> integrationSpecificFields = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatus status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

    The tenant or domain the customer has provided access to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + /** + *

    The tenant or domain the customer has provided access to.

    + */ + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(AccountDetailsAndActionsCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + integrationSpecificFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsCategory.java b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsCategory.java new file mode 100644 index 000000000..7887318aa --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsCategory.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountDetailsAndActionsCategory.Deserializer.class) +public final class AccountDetailsAndActionsCategory { + private final Object value; + + private final int type; + + private AccountDetailsAndActionsCategory(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CategoryEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsCategory && equalTo((AccountDetailsAndActionsCategory) other); + } + + private boolean equalTo(AccountDetailsAndActionsCategory other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountDetailsAndActionsCategory of(CategoryEnum value) { + return new AccountDetailsAndActionsCategory(value, 0); + } + + public static AccountDetailsAndActionsCategory of(String value) { + return new AccountDetailsAndActionsCategory(value, 1); + } + + public interface Visitor { + T visit(CategoryEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountDetailsAndActionsCategory.class); + } + + @java.lang.Override + public AccountDetailsAndActionsCategory deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CategoryEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..67ac4ca0b --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsStatus.java b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsStatus.java new file mode 100644 index 000000000..363af1caf --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsStatus.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountDetailsAndActionsStatus.Deserializer.class) +public final class AccountDetailsAndActionsStatus { + private final Object value; + + private final int type; + + private AccountDetailsAndActionsStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AccountDetailsAndActionsStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsStatus && equalTo((AccountDetailsAndActionsStatus) other); + } + + private boolean equalTo(AccountDetailsAndActionsStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountDetailsAndActionsStatus of(AccountDetailsAndActionsStatusEnum value) { + return new AccountDetailsAndActionsStatus(value, 0); + } + + public static AccountDetailsAndActionsStatus of(String value) { + return new AccountDetailsAndActionsStatus(value, 1); + } + + public interface Visitor { + T visit(AccountDetailsAndActionsStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountDetailsAndActionsStatus.class); + } + + @java.lang.Override + public AccountDetailsAndActionsStatus deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountDetailsAndActionsStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..4cf19f65b --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AccountDetailsAndActionsStatusEnum { + public static final AccountDetailsAndActionsStatusEnum RELINK_NEEDED = + new AccountDetailsAndActionsStatusEnum(Value.RELINK_NEEDED, "RELINK_NEEDED"); + + public static final AccountDetailsAndActionsStatusEnum INCOMPLETE = + new AccountDetailsAndActionsStatusEnum(Value.INCOMPLETE, "INCOMPLETE"); + + public static final AccountDetailsAndActionsStatusEnum IDLE = + new AccountDetailsAndActionsStatusEnum(Value.IDLE, "IDLE"); + + public static final AccountDetailsAndActionsStatusEnum COMPLETE = + new AccountDetailsAndActionsStatusEnum(Value.COMPLETE, "COMPLETE"); + + private final Value value; + + private final String string; + + AccountDetailsAndActionsStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AccountDetailsAndActionsStatusEnum + && this.string.equals(((AccountDetailsAndActionsStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RELINK_NEEDED: + return visitor.visitRelinkNeeded(); + case INCOMPLETE: + return visitor.visitIncomplete(); + case IDLE: + return visitor.visitIdle(); + case COMPLETE: + return visitor.visitComplete(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AccountDetailsAndActionsStatusEnum valueOf(String value) { + switch (value) { + case "RELINK_NEEDED": + return RELINK_NEEDED; + case "INCOMPLETE": + return INCOMPLETE; + case "IDLE": + return IDLE; + case "COMPLETE": + return COMPLETE; + default: + return new AccountDetailsAndActionsStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPLETE, + + INCOMPLETE, + + RELINK_NEEDED, + + IDLE, + + UNKNOWN + } + + public interface Visitor { + T visitComplete(); + + T visitIncomplete(); + + T visitRelinkNeeded(); + + T visitIdle(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountDetailsCategory.java b/src/main/java/com/merge/api/chat/types/AccountDetailsCategory.java new file mode 100644 index 000000000..506dcc87e --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountDetailsCategory.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountDetailsCategory.Deserializer.class) +public final class AccountDetailsCategory { + private final Object value; + + private final int type; + + private AccountDetailsCategory(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CategoryEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsCategory && equalTo((AccountDetailsCategory) other); + } + + private boolean equalTo(AccountDetailsCategory other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountDetailsCategory of(CategoryEnum value) { + return new AccountDetailsCategory(value, 0); + } + + public static AccountDetailsCategory of(String value) { + return new AccountDetailsCategory(value, 1); + } + + public interface Visitor { + T visit(CategoryEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountDetailsCategory.class); + } + + @java.lang.Override + public AccountDetailsCategory deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CategoryEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountIntegration.java b/src/main/java/com/merge/api/chat/types/AccountIntegration.java new file mode 100644 index 000000000..a26abc2b6 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountIntegration.java @@ -0,0 +1,515 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return 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': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

    Company name.

    + */ + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + /** + *

    Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

    + */ + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + /** + *

    Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

    + */ + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + /** + *

    Company logo in rectangular shape.

    + */ + _FinalStage image(Optional image); + + _FinalStage image(String image); + + /** + *

    Company logo in square shape.

    + */ + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + /** + *

    The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

    + */ + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + /** + *

    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': []}

    + */ + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + /** + *

    Setup guide URL for third party webhook creation. Exposed in Merge Docs.

    + */ + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + /** + *

    Category or categories this integration is in beta status for.

    + */ + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

    Company name.

    + *

    Company name.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

    Category or categories this integration is in beta status for.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + /** + *

    Category or categories this integration is in beta status for.

    + */ + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

    Setup guide URL for third party webhook creation. Exposed in Merge Docs.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + /** + *

    Setup guide URL for third party webhook creation. Exposed in Merge Docs.

    + */ + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

    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': []}

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + /** + *

    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': []}

    + */ + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

    The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + /** + *

    The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

    + */ + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

    Company logo in square shape.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + /** + *

    Company logo in square shape.

    + */ + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

    Company logo in rectangular shape.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + /** + *

    Company logo in rectangular shape.

    + */ + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

    Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + /** + *

    Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

    + */ + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

    Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + /** + *

    Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

    + */ + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AccountToken.java b/src/main/java/com/merge/api/chat/types/AccountToken.java new file mode 100644 index 000000000..f24005ebb --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AdvancedMetadata.java b/src/main/java/com/merge/api/chat/types/AdvancedMetadata.java new file mode 100644 index 000000000..77241a0ab --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/chat/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..ad4a50cfb --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/chat/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..260afc17b --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AuditLogEvent.java b/src/main/java/com/merge/api/chat/types/AuditLogEvent.java new file mode 100644 index 000000000..79e9f2995 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AuditLogEvent.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final AuditLogEventRole role; + + private final String ipAddress; + + private final AuditLogEventEventType eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + AuditLogEventRole role, + String ipAddress, + AuditLogEventEventType eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + */ + @JsonProperty("role") + public AuditLogEventRole getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + */ + @JsonProperty("event_type") + public AuditLogEventEventType getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + /** + *

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    + */ + IpAddressStage role(@NotNull AuditLogEventRole role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + /** + *

    Designates the type of event that occurred.

    + */ + EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

    The User's full name at the time of this Event occurring.

    + */ + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + /** + *

    The User's email at the time of this Event occurring.

    + */ + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private AuditLogEventRole role; + + private String ipAddress; + + private AuditLogEventEventType eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    + *

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

    Designates the type of event that occurred.

    + *

    Designates the type of event that occurred.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

    The User's email at the time of this Event occurring.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + /** + *

    The User's email at the time of this Event occurring.

    + */ + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

    The User's full name at the time of this Event occurring.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + /** + *

    The User's full name at the time of this Event occurring.

    + */ + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/chat/types/AuditLogEventEventType.java new file mode 100644 index 000000000..0e0c03c39 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AuditLogEventEventType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) +public final class AuditLogEventEventType { + private final Object value; + + private final int type; + + private AuditLogEventEventType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); + } + + private boolean equalTo(AuditLogEventEventType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AuditLogEventEventType of(EventTypeEnum value) { + return new AuditLogEventEventType(value, 0); + } + + public static AuditLogEventEventType of(String value) { + return new AuditLogEventEventType(value, 1); + } + + public interface Visitor { + T visit(EventTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AuditLogEventEventType.class); + } + + @java.lang.Override + public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AuditLogEventRole.java b/src/main/java/com/merge/api/chat/types/AuditLogEventRole.java new file mode 100644 index 000000000..4c68697d7 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AuditLogEventRole.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) +public final class AuditLogEventRole { + private final Object value; + + private final int type; + + private AuditLogEventRole(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RoleEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); + } + + private boolean equalTo(AuditLogEventRole other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AuditLogEventRole of(RoleEnum value) { + return new AuditLogEventRole(value, 0); + } + + public static AuditLogEventRole of(String value) { + return new AuditLogEventRole(value, 1); + } + + public interface Visitor { + T visit(RoleEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AuditLogEventRole.class); + } + + @java.lang.Override + public AuditLogEventRole deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/chat/types/AuditTrailListRequest.java new file mode 100644 index 000000000..a1be1c4f7 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AuditTrailListRequest.java @@ -0,0 +1,254 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return 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 + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return 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. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    If included, will only include audit trail events that occurred before this time

    + */ + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + /** + *

    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

    + */ + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    If included, will only include audit trail events that occurred after this time

    + */ + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/AvailableActions.java b/src/main/java/com/merge/api/chat/types/AvailableActions.java new file mode 100644 index 000000000..3c15b7de6 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/CategoriesEnum.java b/src/main/java/com/merge/api/chat/types/CategoriesEnum.java new file mode 100644 index 000000000..a71048dea --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/CategoriesEnum.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CategoriesEnum { + public static final CategoriesEnum HRIS = new CategoriesEnum(Value.HRIS, "hris"); + + public static final CategoriesEnum TICKETING = new CategoriesEnum(Value.TICKETING, "ticketing"); + + public static final CategoriesEnum KNOWLEDGEBASE = new CategoriesEnum(Value.KNOWLEDGEBASE, "knowledgebase"); + + public static final CategoriesEnum CRM = new CategoriesEnum(Value.CRM, "crm"); + + public static final CategoriesEnum FILESTORAGE = new CategoriesEnum(Value.FILESTORAGE, "filestorage"); + + public static final CategoriesEnum ACCOUNTING = new CategoriesEnum(Value.ACCOUNTING, "accounting"); + + public static final CategoriesEnum MKTG = new CategoriesEnum(Value.MKTG, "mktg"); + + public static final CategoriesEnum ATS = new CategoriesEnum(Value.ATS, "ats"); + + private final Value value; + + private final String string; + + CategoriesEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CategoriesEnum && this.string.equals(((CategoriesEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HRIS: + return visitor.visitHris(); + case TICKETING: + return visitor.visitTicketing(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); + case CRM: + return visitor.visitCrm(); + case FILESTORAGE: + return visitor.visitFilestorage(); + case ACCOUNTING: + return visitor.visitAccounting(); + case MKTG: + return visitor.visitMktg(); + case ATS: + return visitor.visitAts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CategoriesEnum valueOf(String value) { + switch (value) { + case "hris": + return HRIS; + case "ticketing": + return TICKETING; + case "knowledgebase": + return KNOWLEDGEBASE; + case "crm": + return CRM; + case "filestorage": + return FILESTORAGE; + case "accounting": + return ACCOUNTING; + case "mktg": + return MKTG; + case "ats": + return ATS; + default: + return new CategoriesEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + HRIS, + + ATS, + + ACCOUNTING, + + TICKETING, + + CRM, + + MKTG, + + FILESTORAGE, + + KNOWLEDGEBASE, + + UNKNOWN + } + + public interface Visitor { + T visitHris(); + + T visitAts(); + + T visitAccounting(); + + T visitTicketing(); + + T visitCrm(); + + T visitMktg(); + + T visitFilestorage(); + + T visitKnowledgebase(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/CategoryEnum.java b/src/main/java/com/merge/api/chat/types/CategoryEnum.java new file mode 100644 index 000000000..7b986afc4 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/CategoryEnum.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CategoryEnum { + public static final CategoryEnum HRIS = new CategoryEnum(Value.HRIS, "hris"); + + public static final CategoryEnum TICKETING = new CategoryEnum(Value.TICKETING, "ticketing"); + + public static final CategoryEnum KNOWLEDGEBASE = new CategoryEnum(Value.KNOWLEDGEBASE, "knowledgebase"); + + public static final CategoryEnum CRM = new CategoryEnum(Value.CRM, "crm"); + + public static final CategoryEnum FILESTORAGE = new CategoryEnum(Value.FILESTORAGE, "filestorage"); + + public static final CategoryEnum ACCOUNTING = new CategoryEnum(Value.ACCOUNTING, "accounting"); + + public static final CategoryEnum MKTG = new CategoryEnum(Value.MKTG, "mktg"); + + public static final CategoryEnum ATS = new CategoryEnum(Value.ATS, "ats"); + + private final Value value; + + private final String string; + + CategoryEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof CategoryEnum && this.string.equals(((CategoryEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HRIS: + return visitor.visitHris(); + case TICKETING: + return visitor.visitTicketing(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); + case CRM: + return visitor.visitCrm(); + case FILESTORAGE: + return visitor.visitFilestorage(); + case ACCOUNTING: + return visitor.visitAccounting(); + case MKTG: + return visitor.visitMktg(); + case ATS: + return visitor.visitAts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CategoryEnum valueOf(String value) { + switch (value) { + case "hris": + return HRIS; + case "ticketing": + return TICKETING; + case "knowledgebase": + return KNOWLEDGEBASE; + case "crm": + return CRM; + case "filestorage": + return FILESTORAGE; + case "accounting": + return ACCOUNTING; + case "mktg": + return MKTG; + case "ats": + return ATS; + default: + return new CategoryEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + HRIS, + + ATS, + + ACCOUNTING, + + TICKETING, + + CRM, + + MKTG, + + FILESTORAGE, + + KNOWLEDGEBASE, + + UNKNOWN + } + + public interface Visitor { + T visitHris(); + + T visitAts(); + + T visitAccounting(); + + T visitTicketing(); + + T visitCrm(); + + T visitMktg(); + + T visitFilestorage(); + + T visitKnowledgebase(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/chat/types/CommonModelScopeApi.java new file mode 100644 index 000000000..b6182c729 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/CommonModelScopeApi.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + /** + *

    The common models you want to update the scopes for

    + */ + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/chat/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..cc87f796d --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + if (disabledFields != null) { + this.disabledFields.addAll(disabledFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + if (disabledFields != null) { + this.disabledFields.addAll(disabledFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + if (enabledActions != null) { + this.enabledActions.addAll(enabledActions); + } + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + if (enabledActions != null) { + this.enabledActions.addAll(enabledActions); + } + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/Conversation.java b/src/main/java/com/merge/api/chat/types/Conversation.java new file mode 100644 index 000000000..77b936521 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/Conversation.java @@ -0,0 +1,500 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Conversation.Builder.class) +public final class Conversation { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional description; + + private final Optional url; + + private final Optional type; + + private final Optional>> members; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Conversation( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional url, + Optional type, + Optional>> members, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.description = description; + this.url = url; + this.type = type; + this.members = members; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The name of the conversation + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The description of the conversation. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The url of the conversation. + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + /** + * @return The type of the conversation. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @JsonProperty("members") + public Optional>> getMembers() { + return members; + } + + /** + * @return When the third party's conversation was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's conversation was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Conversation && equalTo((Conversation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Conversation other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && description.equals(other.description) + && url.equals(other.url) + && type.equals(other.type) + && members.equals(other.members) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.url, + this.type, + this.members, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional url = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> members = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Conversation other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + url(other.getUrl()); + type(other.getType()); + members(other.getMembers()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    The name of the conversation

    + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

    The description of the conversation.

    + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The url of the conversation.

    + */ + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public Builder url(Optional url) { + this.url = url; + return this; + } + + public Builder url(String url) { + this.url = Optional.ofNullable(url); + return this; + } + + /** + *

    The type of the conversation.

    + */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(ConversationType type) { + this.type = Optional.ofNullable(type); + return this; + } + + @JsonSetter(value = "members", nulls = Nulls.SKIP) + public Builder members(Optional>> members) { + this.members = members; + return this; + } + + public Builder members(List> members) { + this.members = Optional.ofNullable(members); + return this; + } + + /** + *

    When the third party's conversation was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's conversation was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(ConversationFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Conversation build() { + return new Conversation( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + url, + type, + members, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ConversationFieldMappings.java b/src/main/java/com/merge/api/chat/types/ConversationFieldMappings.java new file mode 100644 index 000000000..103920a3a --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ConversationFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConversationFieldMappings.Builder.class) +public final class ConversationFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private ConversationFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConversationFieldMappings && equalTo((ConversationFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConversationFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConversationFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public ConversationFieldMappings build() { + return new ConversationFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ConversationMembersItem.java b/src/main/java/com/merge/api/chat/types/ConversationMembersItem.java new file mode 100644 index 000000000..af0ac76ae --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ConversationMembersItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ConversationMembersItem.Deserializer.class) +public final class ConversationMembersItem { + private final Object value; + + private final int type; + + private ConversationMembersItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Member) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConversationMembersItem && equalTo((ConversationMembersItem) other); + } + + private boolean equalTo(ConversationMembersItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ConversationMembersItem of(String value) { + return new ConversationMembersItem(value, 0); + } + + public static ConversationMembersItem of(Member value) { + return new ConversationMembersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Member value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConversationMembersItem.class); + } + + @java.lang.Override + public ConversationMembersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Member.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ConversationType.java b/src/main/java/com/merge/api/chat/types/ConversationType.java new file mode 100644 index 000000000..4341fccfd --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ConversationType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ConversationType.Deserializer.class) +public final class ConversationType { + private final Object value; + + private final int type; + + private ConversationType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((TypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConversationType && equalTo((ConversationType) other); + } + + private boolean equalTo(ConversationType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ConversationType of(TypeEnum value) { + return new ConversationType(value, 0); + } + + public static ConversationType of(String value) { + return new ConversationType(value, 1); + } + + public interface Visitor { + T visit(TypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ConversationType.class); + } + + @java.lang.Override + public ConversationType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, TypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ConversationsListRequest.java b/src/main/java/com/merge/api/chat/types/ConversationsListRequest.java new file mode 100644 index 000000000..5cf7f0295 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ConversationsListRequest.java @@ -0,0 +1,434 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConversationsListRequest.Builder.class) +public final class ConversationsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private ConversationsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConversationsListRequest && equalTo((ConversationsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConversationsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConversationsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public ConversationsListRequest build() { + return new ConversationsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ConversationsMembersListRequest.java b/src/main/java/com/merge/api/chat/types/ConversationsMembersListRequest.java new file mode 100644 index 000000000..8b1e477f8 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ConversationsMembersListRequest.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConversationsMembersListRequest.Builder.class) +public final class ConversationsMembersListRequest { + private final Optional> expand; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional pageSize; + + private final Map additionalProperties; + + private ConversationsMembersListRequest( + Optional> expand, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional pageSize, + Map additionalProperties) { + this.expand = expand; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConversationsMembersListRequest && equalTo((ConversationsMembersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConversationsMembersListRequest other) { + return expand.equals(other.expand) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConversationsMembersListRequest other) { + expand(other.getExpand()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ConversationsMembersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public ConversationsMembersListRequest build() { + return new ConversationsMembersListRequest( + expand, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ConversationsMembersListRequestExpandItem.java b/src/main/java/com/merge/api/chat/types/ConversationsMembersListRequestExpandItem.java new file mode 100644 index 000000000..9ca0ba050 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ConversationsMembersListRequestExpandItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ConversationsMembersListRequestExpandItem { + public static final ConversationsMembersListRequestExpandItem USER = + new ConversationsMembersListRequestExpandItem(Value.USER, "user"); + + public static final ConversationsMembersListRequestExpandItem GROUP = + new ConversationsMembersListRequestExpandItem(Value.GROUP, "group"); + + private final Value value; + + private final String string; + + ConversationsMembersListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ConversationsMembersListRequestExpandItem + && this.string.equals(((ConversationsMembersListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case USER: + return visitor.visitUser(); + case GROUP: + return visitor.visitGroup(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ConversationsMembersListRequestExpandItem valueOf(String value) { + switch (value) { + case "user": + return USER; + case "group": + return GROUP; + default: + return new ConversationsMembersListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + GROUP, + + USER, + + UNKNOWN + } + + public interface Visitor { + T visitGroup(); + + T visitUser(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/ConversationsRetrieveRequest.java b/src/main/java/com/merge/api/chat/types/ConversationsRetrieveRequest.java new file mode 100644 index 000000000..54f4e9cba --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ConversationsRetrieveRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ConversationsRetrieveRequest.Builder.class) +public final class ConversationsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ConversationsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ConversationsRetrieveRequest && equalTo((ConversationsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ConversationsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ConversationsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ConversationsRetrieveRequest build() { + return new ConversationsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/chat/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..00f1142b3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/CreateFieldMappingRequest.java @@ -0,0 +1,620 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Optional remoteDataIterationCount; + + private final Optional targetFieldName; + + private final Optional targetFieldDescription; + + private final Optional organizationWideTargetField; + + private final Optional isIntegrationWide; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + Optional remoteDataIterationCount, + Optional targetFieldName, + Optional targetFieldDescription, + Optional organizationWideTargetField, + Optional isIntegrationWide, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Optional jmesPath, + Optional advancedMappingExpression, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.remoteDataIterationCount = remoteDataIterationCount; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.organizationWideTargetField = organizationWideTargetField; + this.isIntegrationWide = isIntegrationWide; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; + this.additionalProperties = additionalProperties; + } + + /** + * @return 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. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + + /** + * @return The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided. + */ + @JsonProperty("target_field_name") + public Optional getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided. + */ + @JsonProperty("target_field_description") + public Optional getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional. + */ + @JsonProperty("organization_wide_target_field") + public Optional getOrganizationWideTargetField() { + return organizationWideTargetField; + } + + /** + * @return If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field. + */ + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + /** + * @return DEPRECATED: Use 'advanced_mapping_expression' instead. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + /** + * @return A JSONata expression used to transform the remote field data. + */ + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && remoteDataIterationCount.equals(other.remoteDataIterationCount) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && organizationWideTargetField.equals(other.organizationWideTargetField) + && isIntegrationWide.equals(other.isIntegrationWide) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.remoteDataIterationCount, + this.targetFieldName, + this.targetFieldDescription, + this.organizationWideTargetField, + this.isIntegrationWide, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName, + this.jmesPath, + this.advancedMappingExpression); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteMethodStage builder() { + return new Builder(); + } + + public interface RemoteMethodStage { + /** + *

    The method of the remote endpoint where the remote field is coming from.

    + */ + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + + Builder from(CreateFieldMappingRequest other); + } + + public interface RemoteUrlPathStage { + /** + *

    The path of the remote endpoint where the remote field is coming from.

    + */ + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + /** + *

    The name of the Common Model that the remote field corresponds to in a given category.

    + */ + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + /** + *

    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.

    + */ + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount); + + _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount); + + /** + *

    The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

    + */ + _FinalStage targetFieldName(Optional targetFieldName); + + _FinalStage targetFieldName(String targetFieldName); + + /** + *

    The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

    + */ + _FinalStage targetFieldDescription(Optional targetFieldDescription); + + _FinalStage targetFieldDescription(String targetFieldDescription); + + /** + *

    The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional.

    + */ + _FinalStage organizationWideTargetField(Optional organizationWideTargetField); + + _FinalStage organizationWideTargetField(String organizationWideTargetField); + + /** + *

    If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field.

    + */ + _FinalStage isIntegrationWide(Optional isIntegrationWide); + + _FinalStage isIntegrationWide(Boolean isIntegrationWide); + + /** + *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    + */ + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); + + /** + *

    A JSONata expression used to transform the remote field data.

    + */ + _FinalStage advancedMappingExpression(Optional advancedMappingExpression); + + _FinalStage advancedMappingExpression(String advancedMappingExpression); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RemoteMethodStage, RemoteUrlPathStage, CommonModelNameStage, _FinalStage { + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private Optional advancedMappingExpression = Optional.empty(); + + private Optional jmesPath = Optional.empty(); + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional organizationWideTargetField = Optional.empty(); + + private Optional targetFieldDescription = Optional.empty(); + + private Optional targetFieldName = Optional.empty(); + + private Optional remoteDataIterationCount = Optional.empty(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + remoteDataIterationCount(other.getRemoteDataIterationCount()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + organizationWideTargetField(other.getOrganizationWideTargetField()); + isIntegrationWide(other.getIsIntegrationWide()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); + return this; + } + + /** + *

    The method of the remote endpoint where the remote field is coming from.

    + *

    The method of the remote endpoint where the remote field is coming from.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

    The path of the remote endpoint where the remote field is coming from.

    + *

    The path of the remote endpoint where the remote field is coming from.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

    The name of the Common Model that the remote field corresponds to in a given category.

    + *

    The name of the Common Model that the remote field corresponds to in a given category.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

    A JSONata expression used to transform the remote field data.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + + /** + *

    A JSONata expression used to transform the remote field data.

    + */ + @java.lang.Override + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public _FinalStage advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + /** + *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + if (remoteFieldTraversalPath != null) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + } + return this; + } + + /** + *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + /** + *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    + */ + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + if (remoteFieldTraversalPath != null) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + } + return this; + } + + /** + *

    If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + /** + *

    If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field.

    + */ + @java.lang.Override + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public _FinalStage isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + /** + *

    The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationWideTargetField(String organizationWideTargetField) { + this.organizationWideTargetField = Optional.ofNullable(organizationWideTargetField); + return this; + } + + /** + *

    The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional.

    + */ + @java.lang.Override + @JsonSetter(value = "organization_wide_target_field", nulls = Nulls.SKIP) + public _FinalStage organizationWideTargetField(Optional organizationWideTargetField) { + this.organizationWideTargetField = organizationWideTargetField; + return this; + } + + /** + *

    The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage targetFieldDescription(String targetFieldDescription) { + this.targetFieldDescription = Optional.ofNullable(targetFieldDescription); + return this; + } + + /** + *

    The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

    + */ + @java.lang.Override + @JsonSetter(value = "target_field_description", nulls = Nulls.SKIP) + public _FinalStage targetFieldDescription(Optional targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

    The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage targetFieldName(String targetFieldName) { + this.targetFieldName = Optional.ofNullable(targetFieldName); + return this; + } + + /** + *

    The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

    + */ + @java.lang.Override + @JsonSetter(value = "target_field_name", nulls = Nulls.SKIP) + public _FinalStage targetFieldName(Optional targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @java.lang.Override + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + remoteDataIterationCount, + targetFieldName, + targetFieldDescription, + organizationWideTargetField, + isIntegrationWide, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + jmesPath, + advancedMappingExpression, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/CreateTargetFieldRequest.java b/src/main/java/com/merge/api/chat/types/CreateTargetFieldRequest.java new file mode 100644 index 000000000..4b2f074d3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/CreateTargetFieldRequest.java @@ -0,0 +1,192 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTargetFieldRequest.Builder.class) +public final class CreateTargetFieldRequest { + private final String name; + + private final Optional description; + + private final String commonModel; + + private final Map additionalProperties; + + private CreateTargetFieldRequest( + String name, Optional description, String commonModel, Map additionalProperties) { + this.name = name; + this.description = description; + this.commonModel = commonModel; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the target field. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The description of the target field. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The name of the Common Model to associate the target field with. + */ + @JsonProperty("common_model") + public String getCommonModel() { + return commonModel; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTargetFieldRequest && equalTo((CreateTargetFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTargetFieldRequest other) { + return name.equals(other.name) + && description.equals(other.description) + && commonModel.equals(other.commonModel); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.commonModel); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

    The name of the target field.

    + */ + CommonModelStage name(@NotNull String name); + + Builder from(CreateTargetFieldRequest other); + } + + public interface CommonModelStage { + /** + *

    The name of the Common Model to associate the target field with.

    + */ + _FinalStage commonModel(@NotNull String commonModel); + } + + public interface _FinalStage { + CreateTargetFieldRequest build(); + + /** + *

    The description of the target field.

    + */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CommonModelStage, _FinalStage { + private String name; + + private String commonModel; + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateTargetFieldRequest other) { + name(other.getName()); + description(other.getDescription()); + commonModel(other.getCommonModel()); + return this; + } + + /** + *

    The name of the target field.

    + *

    The name of the target field.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public CommonModelStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

    The name of the Common Model to associate the target field with.

    + *

    The name of the Common Model to associate the target field with.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model") + public _FinalStage commonModel(@NotNull String commonModel) { + this.commonModel = commonModel; + return this; + } + + /** + *

    The description of the target field.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

    The description of the target field.

    + */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public CreateTargetFieldRequest build() { + return new CreateTargetFieldRequest(name, description, commonModel, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/chat/types/DataPassthroughRequest.java new file mode 100644 index 000000000..1894ea547 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/DataPassthroughRequest.java @@ -0,0 +1,405 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final DataPassthroughRequestMethod method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + DataPassthroughRequestMethod method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public DataPassthroughRequestMethod getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return 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. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return 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. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull DataPassthroughRequestMethod method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + /** + *

    The path of the request in the third party's platform.

    + */ + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + /** + *

    An optional override of the third party's base url for the request.

    + */ + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + /** + *

    The data with the request. You must include a request_format parameter matching the data's format

    + */ + _FinalStage data(Optional data); + + _FinalStage data(String data); + + /** + *

    Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

    + */ + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + /** + *

    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.

    + */ + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(DataPassthroughRequestRequestFormat requestFormat); + + /** + *

    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.

    + */ + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private DataPassthroughRequestMethod method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull DataPassthroughRequestMethod method) { + this.method = method; + return this; + } + + /** + *

    The path of the request in the third party's platform.

    + *

    The path of the request in the third party's platform.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(DataPassthroughRequestRequestFormat requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

    Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + /** + *

    Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

    + */ + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

    The data with the request. You must include a request_format parameter matching the data's format

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + /** + *

    The data with the request. You must include a request_format parameter matching the data's format

    + */ + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

    An optional override of the third party's base url for the request.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + /** + *

    An optional override of the third party's base url for the request.

    + */ + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/DataPassthroughRequestMethod.java b/src/main/java/com/merge/api/chat/types/DataPassthroughRequestMethod.java new file mode 100644 index 000000000..d8f9353b4 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/DataPassthroughRequestMethod.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DataPassthroughRequestMethod.Deserializer.class) +public final class DataPassthroughRequestMethod { + private final Object value; + + private final int type; + + private DataPassthroughRequestMethod(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((MethodEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequestMethod && equalTo((DataPassthroughRequestMethod) other); + } + + private boolean equalTo(DataPassthroughRequestMethod other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DataPassthroughRequestMethod of(MethodEnum value) { + return new DataPassthroughRequestMethod(value, 0); + } + + public static DataPassthroughRequestMethod of(String value) { + return new DataPassthroughRequestMethod(value, 1); + } + + public interface Visitor { + T visit(MethodEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DataPassthroughRequestMethod.class); + } + + @java.lang.Override + public DataPassthroughRequestMethod deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, MethodEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/DataPassthroughRequestRequestFormat.java b/src/main/java/com/merge/api/chat/types/DataPassthroughRequestRequestFormat.java new file mode 100644 index 000000000..b550d9cad --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/DataPassthroughRequestRequestFormat.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DataPassthroughRequestRequestFormat.Deserializer.class) +public final class DataPassthroughRequestRequestFormat { + private final Object value; + + private final int type; + + private DataPassthroughRequestRequestFormat(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RequestFormatEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequestRequestFormat + && equalTo((DataPassthroughRequestRequestFormat) other); + } + + private boolean equalTo(DataPassthroughRequestRequestFormat other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DataPassthroughRequestRequestFormat of(RequestFormatEnum value) { + return new DataPassthroughRequestRequestFormat(value, 0); + } + + public static DataPassthroughRequestRequestFormat of(String value) { + return new DataPassthroughRequestRequestFormat(value, 1); + } + + public interface Visitor { + T visit(RequestFormatEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DataPassthroughRequestRequestFormat.class); + } + + @java.lang.Override + public DataPassthroughRequestRequestFormat deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RequestFormatEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/DebugModeLog.java b/src/main/java/com/merge/api/chat/types/DebugModeLog.java new file mode 100644 index 000000000..4aafe0a82 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/chat/types/DebugModelLogSummary.java new file mode 100644 index 000000000..27bc310a6 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/chat/types/EnabledActionsEnum.java new file mode 100644 index 000000000..70828985a --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/EnabledActionsEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EnabledActionsEnum { + public static final EnabledActionsEnum READ = new EnabledActionsEnum(Value.READ, "READ"); + + public static final EnabledActionsEnum WRITE = new EnabledActionsEnum(Value.WRITE, "WRITE"); + + private final Value value; + + private final String string; + + EnabledActionsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EnabledActionsEnum && this.string.equals(((EnabledActionsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case READ: + return visitor.visitRead(); + case WRITE: + return visitor.visitWrite(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EnabledActionsEnum valueOf(String value) { + switch (value) { + case "READ": + return READ; + case "WRITE": + return WRITE; + default: + return new EnabledActionsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + READ, + + WRITE, + + UNKNOWN + } + + public interface Visitor { + T visitRead(); + + T visitWrite(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/EncodingEnum.java b/src/main/java/com/merge/api/chat/types/EncodingEnum.java new file mode 100644 index 000000000..8ab912f96 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/EncodingEnum.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EncodingEnum { + public static final EncodingEnum RAW = new EncodingEnum(Value.RAW, "RAW"); + + public static final EncodingEnum GZIP_BASE_64 = new EncodingEnum(Value.GZIP_BASE_64, "GZIP_BASE64"); + + public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + + private final Value value; + + private final String string; + + EncodingEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof EncodingEnum && this.string.equals(((EncodingEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RAW: + return visitor.visitRaw(); + case GZIP_BASE_64: + return visitor.visitGzipBase64(); + case BASE_64: + return visitor.visitBase64(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EncodingEnum valueOf(String value) { + switch (value) { + case "RAW": + return RAW; + case "GZIP_BASE64": + return GZIP_BASE_64; + case "BASE64": + return BASE_64; + default: + return new EncodingEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RAW, + + BASE_64, + + GZIP_BASE_64, + + UNKNOWN + } + + public interface Visitor { + T visitRaw(); + + T visitBase64(); + + T visitGzipBase64(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/chat/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..67993fc86 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/EndUserDetailsRequest.java @@ -0,0 +1,815 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Optional completedAccountInitialScreen; + + private final Optional linkedDestinationId; + + private final Optional credentialId; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Optional completedAccountInitialScreen, + Optional linkedDestinationId, + Optional credentialId, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.completedAccountInitialScreen = completedAccountInitialScreen; + this.linkedDestinationId = linkedDestinationId; + this.credentialId = credentialId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return 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. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return 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/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return 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. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return 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. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return 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. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return 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. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return 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. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + /** + * @return When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account. + */ + @JsonProperty("completed_account_initial_screen") + public Optional getCompletedAccountInitialScreen() { + return completedAccountInitialScreen; + } + + /** + * @return The UUID of the linked destination that you want this Linked Account to be tied to. + */ + @JsonProperty("linked_destination_id") + public Optional getLinkedDestinationId() { + return linkedDestinationId; + } + + /** + * @return The id of the credential that you want this Linked Account to be tied to. + */ + @JsonProperty("credential_id") + public Optional getCredentialId() { + return credentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig) + && completedAccountInitialScreen.equals(other.completedAccountInitialScreen) + && linkedDestinationId.equals(other.linkedDestinationId) + && credentialId.equals(other.credentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig, + this.completedAccountInitialScreen, + this.linkedDestinationId, + this.credentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + /** + *

    Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

    + */ + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + /** + *

    Your end user's organization.

    + */ + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + /** + *

    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.

    + */ + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + /** + *

    The integration categories to show in Merge Link.

    + */ + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + /** + *

    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/.

    + */ + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + /** + *

    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.

    + */ + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + /** + *

    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.

    + */ + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + /** + *

    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.

    + */ + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + /** + *

    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.

    + */ + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + /** + *

    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.

    + */ + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + /** + *

    The following subset of IETF language tags can be used to configure localization.

    + */ + _FinalStage language(Optional language); + + _FinalStage language(EndUserDetailsRequestLanguage language); + + /** + *

    The boolean that indicates whether initial, periodic, and force syncs will be disabled.

    + */ + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + /** + *

    A JSON object containing integration-specific configuration options.

    + */ + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + /** + *

    When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

    + */ + _FinalStage completedAccountInitialScreen( + Optional completedAccountInitialScreen); + + _FinalStage completedAccountInitialScreen( + EndUserDetailsRequestCompletedAccountInitialScreen completedAccountInitialScreen); + + /** + *

    The UUID of the linked destination that you want this Linked Account to be tied to.

    + */ + _FinalStage linkedDestinationId(Optional linkedDestinationId); + + _FinalStage linkedDestinationId(String linkedDestinationId); + + /** + *

    The id of the credential that you want this Linked Account to be tied to.

    + */ + _FinalStage credentialId(Optional credentialId); + + _FinalStage credentialId(String credentialId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional credentialId = Optional.empty(); + + private Optional linkedDestinationId = Optional.empty(); + + private Optional completedAccountInitialScreen = + Optional.empty(); + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + completedAccountInitialScreen(other.getCompletedAccountInitialScreen()); + linkedDestinationId(other.getLinkedDestinationId()); + credentialId(other.getCredentialId()); + return this; + } + + /** + *

    Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

    + *

    Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

    Your end user's organization.

    + *

    Your end user's organization.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

    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.

    + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

    The id of the credential that you want this Linked Account to be tied to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentialId(String credentialId) { + this.credentialId = Optional.ofNullable(credentialId); + return this; + } + + /** + *

    The id of the credential that you want this Linked Account to be tied to.

    + */ + @java.lang.Override + @JsonSetter(value = "credential_id", nulls = Nulls.SKIP) + public _FinalStage credentialId(Optional credentialId) { + this.credentialId = credentialId; + return this; + } + + /** + *

    The UUID of the linked destination that you want this Linked Account to be tied to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkedDestinationId(String linkedDestinationId) { + this.linkedDestinationId = Optional.ofNullable(linkedDestinationId); + return this; + } + + /** + *

    The UUID of the linked destination that you want this Linked Account to be tied to.

    + */ + @java.lang.Override + @JsonSetter(value = "linked_destination_id", nulls = Nulls.SKIP) + public _FinalStage linkedDestinationId(Optional linkedDestinationId) { + this.linkedDestinationId = linkedDestinationId; + return this; + } + + /** + *

    When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage completedAccountInitialScreen( + EndUserDetailsRequestCompletedAccountInitialScreen completedAccountInitialScreen) { + this.completedAccountInitialScreen = Optional.ofNullable(completedAccountInitialScreen); + return this; + } + + /** + *

    When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

    + */ + @java.lang.Override + @JsonSetter(value = "completed_account_initial_screen", nulls = Nulls.SKIP) + public _FinalStage completedAccountInitialScreen( + Optional completedAccountInitialScreen) { + this.completedAccountInitialScreen = completedAccountInitialScreen; + return this; + } + + /** + *

    A JSON object containing integration-specific configuration options.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + /** + *

    A JSON object containing integration-specific configuration options.

    + */ + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

    The boolean that indicates whether initial, periodic, and force syncs will be disabled.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + /** + *

    The boolean that indicates whether initial, periodic, and force syncs will be disabled.

    + */ + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

    The following subset of IETF language tags can be used to configure localization.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(EndUserDetailsRequestLanguage language) { + this.language = Optional.ofNullable(language); + return this; + } + + /** + *

    The following subset of IETF language tags can be used to configure localization.

    + */ + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

    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.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + /** + *

    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.

    + */ + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

    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/.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + /** + *

    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/.

    + */ + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

    The integration categories to show in Merge Link.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + /** + *

    The integration categories to show in Merge Link.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + /** + *

    The integration categories to show in Merge Link.

    + */ + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + completedAccountInitialScreen, + linkedDestinationId, + credentialId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/EndUserDetailsRequestCompletedAccountInitialScreen.java b/src/main/java/com/merge/api/chat/types/EndUserDetailsRequestCompletedAccountInitialScreen.java new file mode 100644 index 000000000..344c24731 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/EndUserDetailsRequestCompletedAccountInitialScreen.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EndUserDetailsRequestCompletedAccountInitialScreen.Deserializer.class) +public final class EndUserDetailsRequestCompletedAccountInitialScreen { + private final Object value; + + private final int type; + + private EndUserDetailsRequestCompletedAccountInitialScreen(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit2((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequestCompletedAccountInitialScreen + && equalTo((EndUserDetailsRequestCompletedAccountInitialScreen) other); + } + + private boolean equalTo(EndUserDetailsRequestCompletedAccountInitialScreen other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EndUserDetailsRequestCompletedAccountInitialScreen of(String value) { + return new EndUserDetailsRequestCompletedAccountInitialScreen(value, 0); + } + + public static EndUserDetailsRequestCompletedAccountInitialScreen of2(String value) { + return new EndUserDetailsRequestCompletedAccountInitialScreen(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit2(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EndUserDetailsRequestCompletedAccountInitialScreen.class); + } + + @java.lang.Override + public EndUserDetailsRequestCompletedAccountInitialScreen deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference() {})); + } catch (RuntimeException e) { + } + try { + return of2(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/EndUserDetailsRequestLanguage.java b/src/main/java/com/merge/api/chat/types/EndUserDetailsRequestLanguage.java new file mode 100644 index 000000000..d4dcaefc4 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/EndUserDetailsRequestLanguage.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EndUserDetailsRequestLanguage.Deserializer.class) +public final class EndUserDetailsRequestLanguage { + private final Object value; + + private final int type; + + private EndUserDetailsRequestLanguage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LanguageEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequestLanguage && equalTo((EndUserDetailsRequestLanguage) other); + } + + private boolean equalTo(EndUserDetailsRequestLanguage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EndUserDetailsRequestLanguage of(LanguageEnum value) { + return new EndUserDetailsRequestLanguage(value, 0); + } + + public static EndUserDetailsRequestLanguage of(String value) { + return new EndUserDetailsRequestLanguage(value, 1); + } + + public interface Visitor { + T visit(LanguageEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EndUserDetailsRequestLanguage.class); + } + + @java.lang.Override + public EndUserDetailsRequestLanguage deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LanguageEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/chat/types/ErrorValidationProblem.java new file mode 100644 index 000000000..838aee122 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ErrorValidationProblem.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Optional blockMergeLink; + + private final Optional rawError; + + private final Optional errorCode; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Optional blockMergeLink, + Optional rawError, + Optional errorCode, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.blockMergeLink = blockMergeLink; + this.rawError = rawError; + this.errorCode = errorCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @JsonProperty("block_merge_link") + public Optional getBlockMergeLink() { + return blockMergeLink; + } + + @JsonProperty("raw_error") + public Optional getRawError() { + return rawError; + } + + @JsonProperty("error_code") + public Optional getErrorCode() { + return errorCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType) + && blockMergeLink.equals(other.blockMergeLink) + && rawError.equals(other.rawError) + && errorCode.equals(other.errorCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.source, + this.title, + this.detail, + this.problemType, + this.blockMergeLink, + this.rawError, + this.errorCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + + _FinalStage blockMergeLink(Optional blockMergeLink); + + _FinalStage blockMergeLink(Boolean blockMergeLink); + + _FinalStage rawError(Optional rawError); + + _FinalStage rawError(String rawError); + + _FinalStage errorCode(Optional errorCode); + + _FinalStage errorCode(Integer errorCode); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional errorCode = Optional.empty(); + + private Optional rawError = Optional.empty(); + + private Optional blockMergeLink = Optional.empty(); + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + blockMergeLink(other.getBlockMergeLink()); + rawError(other.getRawError()); + errorCode(other.getErrorCode()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage errorCode(Integer errorCode) { + this.errorCode = Optional.ofNullable(errorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_code", nulls = Nulls.SKIP) + public _FinalStage errorCode(Optional errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + public _FinalStage rawError(String rawError) { + this.rawError = Optional.ofNullable(rawError); + return this; + } + + @java.lang.Override + @JsonSetter(value = "raw_error", nulls = Nulls.SKIP) + public _FinalStage rawError(Optional rawError) { + this.rawError = rawError; + return this; + } + + @java.lang.Override + public _FinalStage blockMergeLink(Boolean blockMergeLink) { + this.blockMergeLink = Optional.ofNullable(blockMergeLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "block_merge_link", nulls = Nulls.SKIP) + public _FinalStage blockMergeLink(Optional blockMergeLink) { + this.blockMergeLink = blockMergeLink; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem( + source, title, detail, problemType, blockMergeLink, rawError, errorCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/EventTypeEnum.java b/src/main/java/com/merge/api/chat/types/EventTypeEnum.java new file mode 100644 index 000000000..fdd0e8501 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/EventTypeEnum.java @@ -0,0 +1,530 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EventTypeEnum { + public static final EventTypeEnum DISABLED_MERGE_WEBHOOK = + new EventTypeEnum(Value.DISABLED_MERGE_WEBHOOK, "DISABLED_MERGE_WEBHOOK"); + + public static final EventTypeEnum CHANGED_PERSONAL_INFORMATION = + new EventTypeEnum(Value.CHANGED_PERSONAL_INFORMATION, "CHANGED_PERSONAL_INFORMATION"); + + public static final EventTypeEnum CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = new EventTypeEnum( + Value.CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, "CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"); + + public static final EventTypeEnum DELETED_REMOTE_PRODUCTION_API_KEY = + new EventTypeEnum(Value.DELETED_REMOTE_PRODUCTION_API_KEY, "DELETED_REMOTE_PRODUCTION_API_KEY"); + + public static final EventTypeEnum DELETED_LINKED_ACCOUNT_FIELD_MAPPING = + new EventTypeEnum(Value.DELETED_LINKED_ACCOUNT_FIELD_MAPPING, "DELETED_LINKED_ACCOUNT_FIELD_MAPPING"); + + public static final EventTypeEnum ENABLED_MERGE_WEBHOOK = + new EventTypeEnum(Value.ENABLED_MERGE_WEBHOOK, "ENABLED_MERGE_WEBHOOK"); + + public static final EventTypeEnum DISABLED_INTEGRATION = + new EventTypeEnum(Value.DISABLED_INTEGRATION, "DISABLED_INTEGRATION"); + + public static final EventTypeEnum DELETED_DESTINATION = + new EventTypeEnum(Value.DELETED_DESTINATION, "DELETED_DESTINATION"); + + public static final EventTypeEnum CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = new EventTypeEnum( + Value.CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, "CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"); + + public static final EventTypeEnum DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = new EventTypeEnum( + Value.DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, "DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"); + + public static final EventTypeEnum CREATED_TEST_API_KEY = + new EventTypeEnum(Value.CREATED_TEST_API_KEY, "CREATED_TEST_API_KEY"); + + public static final EventTypeEnum REGENERATED_PRODUCTION_API_KEY = + new EventTypeEnum(Value.REGENERATED_PRODUCTION_API_KEY, "REGENERATED_PRODUCTION_API_KEY"); + + public static final EventTypeEnum END_USER_CREDENTIALS_ACCESSED = + new EventTypeEnum(Value.END_USER_CREDENTIALS_ACCESSED, "END_USER_CREDENTIALS_ACCESSED"); + + public static final EventTypeEnum DISABLED_CATEGORY = + new EventTypeEnum(Value.DISABLED_CATEGORY, "DISABLED_CATEGORY"); + + public static final EventTypeEnum DELETED_INTEGRATION_WIDE_FIELD_MAPPING = + new EventTypeEnum(Value.DELETED_INTEGRATION_WIDE_FIELD_MAPPING, "DELETED_INTEGRATION_WIDE_FIELD_MAPPING"); + + public static final EventTypeEnum TWO_FACTOR_AUTH_ENABLED = + new EventTypeEnum(Value.TWO_FACTOR_AUTH_ENABLED, "TWO_FACTOR_AUTH_ENABLED"); + + public static final EventTypeEnum CHANGED_DESTINATION = + new EventTypeEnum(Value.CHANGED_DESTINATION, "CHANGED_DESTINATION"); + + public static final EventTypeEnum DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION = new EventTypeEnum( + Value.DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, "DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"); + + public static final EventTypeEnum TWO_FACTOR_AUTH_DISABLED = + new EventTypeEnum(Value.TWO_FACTOR_AUTH_DISABLED, "TWO_FACTOR_AUTH_DISABLED"); + + public static final EventTypeEnum ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT = new EventTypeEnum( + Value.ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, "ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"); + + public static final EventTypeEnum FORCED_LINKED_ACCOUNT_RESYNC = + new EventTypeEnum(Value.FORCED_LINKED_ACCOUNT_RESYNC, "FORCED_LINKED_ACCOUNT_RESYNC"); + + public static final EventTypeEnum CHANGED_ORGANIZATION_SETTINGS = + new EventTypeEnum(Value.CHANGED_ORGANIZATION_SETTINGS, "CHANGED_ORGANIZATION_SETTINGS"); + + public static final EventTypeEnum ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION = new EventTypeEnum( + Value.ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, "ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"); + + public static final EventTypeEnum RESET_PASSWORD = new EventTypeEnum(Value.RESET_PASSWORD, "RESET_PASSWORD"); + + public static final EventTypeEnum INVITED_USER = new EventTypeEnum(Value.INVITED_USER, "INVITED_USER"); + + public static final EventTypeEnum MERGE_WEBHOOK_TARGET_CHANGED = + new EventTypeEnum(Value.MERGE_WEBHOOK_TARGET_CHANGED, "MERGE_WEBHOOK_TARGET_CHANGED"); + + public static final EventTypeEnum MUTED_ISSUE = new EventTypeEnum(Value.MUTED_ISSUE, "MUTED_ISSUE"); + + public static final EventTypeEnum GENERATED_MAGIC_LINK = + new EventTypeEnum(Value.GENERATED_MAGIC_LINK, "GENERATED_MAGIC_LINK"); + + public static final EventTypeEnum CREATED_REMOTE_PRODUCTION_API_KEY = + new EventTypeEnum(Value.CREATED_REMOTE_PRODUCTION_API_KEY, "CREATED_REMOTE_PRODUCTION_API_KEY"); + + public static final EventTypeEnum DELETED_LINKED_ACCOUNT = + new EventTypeEnum(Value.DELETED_LINKED_ACCOUNT, "DELETED_LINKED_ACCOUNT"); + + public static final EventTypeEnum CHANGED_SCOPES = new EventTypeEnum(Value.CHANGED_SCOPES, "CHANGED_SCOPES"); + + public static final EventTypeEnum CHANGED_INTEGRATION_WIDE_FIELD_MAPPING = + new EventTypeEnum(Value.CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, "CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"); + + public static final EventTypeEnum DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT = new EventTypeEnum( + Value.DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, "DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"); + + public static final EventTypeEnum REGENERATED_WEBHOOK_SIGNATURE = + new EventTypeEnum(Value.REGENERATED_WEBHOOK_SIGNATURE, "REGENERATED_WEBHOOK_SIGNATURE"); + + public static final EventTypeEnum CHANGED_PASSWORD = new EventTypeEnum(Value.CHANGED_PASSWORD, "CHANGED_PASSWORD"); + + public static final EventTypeEnum DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT = new EventTypeEnum( + Value.DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, "DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"); + + public static final EventTypeEnum CREATED_INTEGRATION_WIDE_FIELD_MAPPING = + new EventTypeEnum(Value.CREATED_INTEGRATION_WIDE_FIELD_MAPPING, "CREATED_INTEGRATION_WIDE_FIELD_MAPPING"); + + public static final EventTypeEnum CREATED_LINKED_ACCOUNT_FIELD_MAPPING = + new EventTypeEnum(Value.CREATED_LINKED_ACCOUNT_FIELD_MAPPING, "CREATED_LINKED_ACCOUNT_FIELD_MAPPING"); + + public static final EventTypeEnum ENABLED_INTEGRATION = + new EventTypeEnum(Value.ENABLED_INTEGRATION, "ENABLED_INTEGRATION"); + + public static final EventTypeEnum DELETED_TEST_API_KEY = + new EventTypeEnum(Value.DELETED_TEST_API_KEY, "DELETED_TEST_API_KEY"); + + public static final EventTypeEnum ENABLED_CATEGORY = new EventTypeEnum(Value.ENABLED_CATEGORY, "ENABLED_CATEGORY"); + + public static final EventTypeEnum CREATED_DESTINATION = + new EventTypeEnum(Value.CREATED_DESTINATION, "CREATED_DESTINATION"); + + public static final EventTypeEnum CHANGED_LINKED_ACCOUNT_FIELD_MAPPING = + new EventTypeEnum(Value.CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, "CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"); + + private final Value value; + + private final String string; + + EventTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EventTypeEnum && this.string.equals(((EventTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISABLED_MERGE_WEBHOOK: + return visitor.visitDisabledMergeWebhook(); + case CHANGED_PERSONAL_INFORMATION: + return visitor.visitChangedPersonalInformation(); + case CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return visitor.visitCreatedLinkedAccountCommonModelOverride(); + case DELETED_REMOTE_PRODUCTION_API_KEY: + return visitor.visitDeletedRemoteProductionApiKey(); + case DELETED_LINKED_ACCOUNT_FIELD_MAPPING: + return visitor.visitDeletedLinkedAccountFieldMapping(); + case ENABLED_MERGE_WEBHOOK: + return visitor.visitEnabledMergeWebhook(); + case DISABLED_INTEGRATION: + return visitor.visitDisabledIntegration(); + case DELETED_DESTINATION: + return visitor.visitDeletedDestination(); + case CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return visitor.visitChangedLinkedAccountCommonModelOverride(); + case DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return visitor.visitDeletedLinkedAccountCommonModelOverride(); + case CREATED_TEST_API_KEY: + return visitor.visitCreatedTestApiKey(); + case REGENERATED_PRODUCTION_API_KEY: + return visitor.visitRegeneratedProductionApiKey(); + case END_USER_CREDENTIALS_ACCESSED: + return visitor.visitEndUserCredentialsAccessed(); + case DISABLED_CATEGORY: + return visitor.visitDisabledCategory(); + case DELETED_INTEGRATION_WIDE_FIELD_MAPPING: + return visitor.visitDeletedIntegrationWideFieldMapping(); + case TWO_FACTOR_AUTH_ENABLED: + return visitor.visitTwoFactorAuthEnabled(); + case CHANGED_DESTINATION: + return visitor.visitChangedDestination(); + case DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION: + return visitor.visitDisabledRedactUnmappedDataForOrganization(); + case TWO_FACTOR_AUTH_DISABLED: + return visitor.visitTwoFactorAuthDisabled(); + case ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT: + return visitor.visitEnabledRedactUnmappedDataForLinkedAccount(); + case FORCED_LINKED_ACCOUNT_RESYNC: + return visitor.visitForcedLinkedAccountResync(); + case CHANGED_ORGANIZATION_SETTINGS: + return visitor.visitChangedOrganizationSettings(); + case ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION: + return visitor.visitEnabledRedactUnmappedDataForOrganization(); + case RESET_PASSWORD: + return visitor.visitResetPassword(); + case INVITED_USER: + return visitor.visitInvitedUser(); + case MERGE_WEBHOOK_TARGET_CHANGED: + return visitor.visitMergeWebhookTargetChanged(); + case MUTED_ISSUE: + return visitor.visitMutedIssue(); + case GENERATED_MAGIC_LINK: + return visitor.visitGeneratedMagicLink(); + case CREATED_REMOTE_PRODUCTION_API_KEY: + return visitor.visitCreatedRemoteProductionApiKey(); + case DELETED_LINKED_ACCOUNT: + return visitor.visitDeletedLinkedAccount(); + case CHANGED_SCOPES: + return visitor.visitChangedScopes(); + case CHANGED_INTEGRATION_WIDE_FIELD_MAPPING: + return visitor.visitChangedIntegrationWideFieldMapping(); + case DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT: + return visitor.visitDeletedAllCommonModelsForLinkedAccount(); + case REGENERATED_WEBHOOK_SIGNATURE: + return visitor.visitRegeneratedWebhookSignature(); + case CHANGED_PASSWORD: + return visitor.visitChangedPassword(); + case DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT: + return visitor.visitDisabledRedactUnmappedDataForLinkedAccount(); + case CREATED_INTEGRATION_WIDE_FIELD_MAPPING: + return visitor.visitCreatedIntegrationWideFieldMapping(); + case CREATED_LINKED_ACCOUNT_FIELD_MAPPING: + return visitor.visitCreatedLinkedAccountFieldMapping(); + case ENABLED_INTEGRATION: + return visitor.visitEnabledIntegration(); + case DELETED_TEST_API_KEY: + return visitor.visitDeletedTestApiKey(); + case ENABLED_CATEGORY: + return visitor.visitEnabledCategory(); + case CREATED_DESTINATION: + return visitor.visitCreatedDestination(); + case CHANGED_LINKED_ACCOUNT_FIELD_MAPPING: + return visitor.visitChangedLinkedAccountFieldMapping(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventTypeEnum valueOf(String value) { + switch (value) { + case "DISABLED_MERGE_WEBHOOK": + return DISABLED_MERGE_WEBHOOK; + case "CHANGED_PERSONAL_INFORMATION": + return CHANGED_PERSONAL_INFORMATION; + case "CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE": + return CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE; + case "DELETED_REMOTE_PRODUCTION_API_KEY": + return DELETED_REMOTE_PRODUCTION_API_KEY; + case "DELETED_LINKED_ACCOUNT_FIELD_MAPPING": + return DELETED_LINKED_ACCOUNT_FIELD_MAPPING; + case "ENABLED_MERGE_WEBHOOK": + return ENABLED_MERGE_WEBHOOK; + case "DISABLED_INTEGRATION": + return DISABLED_INTEGRATION; + case "DELETED_DESTINATION": + return DELETED_DESTINATION; + case "CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE": + return CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE; + case "DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE": + return DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE; + case "CREATED_TEST_API_KEY": + return CREATED_TEST_API_KEY; + case "REGENERATED_PRODUCTION_API_KEY": + return REGENERATED_PRODUCTION_API_KEY; + case "END_USER_CREDENTIALS_ACCESSED": + return END_USER_CREDENTIALS_ACCESSED; + case "DISABLED_CATEGORY": + return DISABLED_CATEGORY; + case "DELETED_INTEGRATION_WIDE_FIELD_MAPPING": + return DELETED_INTEGRATION_WIDE_FIELD_MAPPING; + case "TWO_FACTOR_AUTH_ENABLED": + return TWO_FACTOR_AUTH_ENABLED; + case "CHANGED_DESTINATION": + return CHANGED_DESTINATION; + case "DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION": + return DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION; + case "TWO_FACTOR_AUTH_DISABLED": + return TWO_FACTOR_AUTH_DISABLED; + case "ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT": + return ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT; + case "FORCED_LINKED_ACCOUNT_RESYNC": + return FORCED_LINKED_ACCOUNT_RESYNC; + case "CHANGED_ORGANIZATION_SETTINGS": + return CHANGED_ORGANIZATION_SETTINGS; + case "ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION": + return ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION; + case "RESET_PASSWORD": + return RESET_PASSWORD; + case "INVITED_USER": + return INVITED_USER; + case "MERGE_WEBHOOK_TARGET_CHANGED": + return MERGE_WEBHOOK_TARGET_CHANGED; + case "MUTED_ISSUE": + return MUTED_ISSUE; + case "GENERATED_MAGIC_LINK": + return GENERATED_MAGIC_LINK; + case "CREATED_REMOTE_PRODUCTION_API_KEY": + return CREATED_REMOTE_PRODUCTION_API_KEY; + case "DELETED_LINKED_ACCOUNT": + return DELETED_LINKED_ACCOUNT; + case "CHANGED_SCOPES": + return CHANGED_SCOPES; + case "CHANGED_INTEGRATION_WIDE_FIELD_MAPPING": + return CHANGED_INTEGRATION_WIDE_FIELD_MAPPING; + case "DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT": + return DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT; + case "REGENERATED_WEBHOOK_SIGNATURE": + return REGENERATED_WEBHOOK_SIGNATURE; + case "CHANGED_PASSWORD": + return CHANGED_PASSWORD; + case "DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT": + return DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT; + case "CREATED_INTEGRATION_WIDE_FIELD_MAPPING": + return CREATED_INTEGRATION_WIDE_FIELD_MAPPING; + case "CREATED_LINKED_ACCOUNT_FIELD_MAPPING": + return CREATED_LINKED_ACCOUNT_FIELD_MAPPING; + case "ENABLED_INTEGRATION": + return ENABLED_INTEGRATION; + case "DELETED_TEST_API_KEY": + return DELETED_TEST_API_KEY; + case "ENABLED_CATEGORY": + return ENABLED_CATEGORY; + case "CREATED_DESTINATION": + return CREATED_DESTINATION; + case "CHANGED_LINKED_ACCOUNT_FIELD_MAPPING": + return CHANGED_LINKED_ACCOUNT_FIELD_MAPPING; + default: + return new EventTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + 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, + + UNKNOWN + } + + public interface Visitor { + T visitCreatedRemoteProductionApiKey(); + + T visitDeletedRemoteProductionApiKey(); + + T visitCreatedTestApiKey(); + + T visitDeletedTestApiKey(); + + T visitRegeneratedProductionApiKey(); + + T visitRegeneratedWebhookSignature(); + + T visitInvitedUser(); + + T visitTwoFactorAuthEnabled(); + + T visitTwoFactorAuthDisabled(); + + T visitDeletedLinkedAccount(); + + T visitDeletedAllCommonModelsForLinkedAccount(); + + T visitCreatedDestination(); + + T visitDeletedDestination(); + + T visitChangedDestination(); + + T visitChangedScopes(); + + T visitChangedPersonalInformation(); + + T visitChangedOrganizationSettings(); + + T visitEnabledIntegration(); + + T visitDisabledIntegration(); + + T visitEnabledCategory(); + + T visitDisabledCategory(); + + T visitChangedPassword(); + + T visitResetPassword(); + + T visitEnabledRedactUnmappedDataForOrganization(); + + T visitEnabledRedactUnmappedDataForLinkedAccount(); + + T visitDisabledRedactUnmappedDataForOrganization(); + + T visitDisabledRedactUnmappedDataForLinkedAccount(); + + T visitCreatedIntegrationWideFieldMapping(); + + T visitCreatedLinkedAccountFieldMapping(); + + T visitChangedIntegrationWideFieldMapping(); + + T visitChangedLinkedAccountFieldMapping(); + + T visitDeletedIntegrationWideFieldMapping(); + + T visitDeletedLinkedAccountFieldMapping(); + + T visitCreatedLinkedAccountCommonModelOverride(); + + T visitChangedLinkedAccountCommonModelOverride(); + + T visitDeletedLinkedAccountCommonModelOverride(); + + T visitForcedLinkedAccountResync(); + + T visitMutedIssue(); + + T visitGeneratedMagicLink(); + + T visitEnabledMergeWebhook(); + + T visitDisabledMergeWebhook(); + + T visitMergeWebhookTargetChanged(); + + T visitEndUserCredentialsAccessed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/chat/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..1c841f92f --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/chat/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..e518e80ae --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> user; + + private final Optional> group; + + private final Optional> conversation; + + private final Optional> member; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> user, + Optional> group, + Optional> conversation, + Optional> member, + Map additionalProperties) { + this.user = user; + this.group = group; + this.conversation = conversation; + this.member = member; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("Conversation") + public Optional> getConversation() { + return conversation; + } + + @JsonProperty("Member") + public Optional> getMember() { + return member; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return user.equals(other.user) + && group.equals(other.group) + && conversation.equals(other.conversation) + && member.equals(other.member); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.user, this.group, this.conversation, this.member); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> user = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> conversation = Optional.empty(); + + private Optional> member = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + user(other.getUser()); + group(other.getGroup()); + conversation(other.getConversation()); + member(other.getMember()); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "Conversation", nulls = Nulls.SKIP) + public Builder conversation(Optional> conversation) { + this.conversation = conversation; + return this; + } + + public Builder conversation(List conversation) { + this.conversation = Optional.ofNullable(conversation); + return this; + } + + @JsonSetter(value = "Member", nulls = Nulls.SKIP) + public Builder member(Optional> member) { + this.member = member; + return this; + } + + public Builder member(List member) { + this.member = Optional.ofNullable(member); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse(user, group, conversation, member, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..1c4167537 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstance.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Optional jmesPath, + Optional advancedMappingExpression, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.isIntegrationWide, + this.targetField, + this.remoteField, + this.jmesPath, + this.advancedMappingExpression); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + private Optional jmesPath = Optional.empty(); + + private Optional advancedMappingExpression = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public Builder advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + public Builder advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance( + id, + isIntegrationWide, + targetField, + remoteField, + jmesPath, + advancedMappingExpression, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..90683b45c --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..c98d133b4 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..e01a80521 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> user; + + private final Optional> group; + + private final Optional> conversation; + + private final Optional> member; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> user, + Optional> group, + Optional> conversation, + Optional> member, + Map additionalProperties) { + this.user = user; + this.group = group; + this.conversation = conversation; + this.member = member; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("Conversation") + public Optional> getConversation() { + return conversation; + } + + @JsonProperty("Member") + public Optional> getMember() { + return member; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return user.equals(other.user) + && group.equals(other.group) + && conversation.equals(other.conversation) + && member.equals(other.member); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.user, this.group, this.conversation, this.member); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> user = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> conversation = Optional.empty(); + + private Optional> member = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + user(other.getUser()); + group(other.getGroup()); + conversation(other.getConversation()); + member(other.getMember()); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "Conversation", nulls = Nulls.SKIP) + public Builder conversation(Optional> conversation) { + this.conversation = conversation; + return this; + } + + public Builder conversation(List conversation) { + this.conversation = Optional.ofNullable(conversation); + return this; + } + + @JsonSetter(value = "Member", nulls = Nulls.SKIP) + public Builder member(Optional> member) { + this.member = member; + return this; + } + + public Builder member(List member) { + this.member = Optional.ofNullable(member); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse(user, group, conversation, member, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..22432848e --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/chat/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..f48032b85 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldMappingInstanceResponse.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/chat/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..9d39a0154 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return 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. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/chat/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..f8e634979 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/chat/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..463083cc0 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/chat/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..daa566ad8 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

    The name of the remote key

    + */ + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

    The name of the remote key

    + *

    The name of the remote key

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/Group.java b/src/main/java/com/merge/api/chat/types/Group.java new file mode 100644 index 000000000..6c814e03f --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/Group.java @@ -0,0 +1,404 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Group.Builder.class) +public final class Group { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional>> users; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Group( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional>> users, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.users = users; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The name of the Group + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("users") + public Optional>> getUsers() { + return users; + } + + /** + * @return When the third party's group was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's group was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Group && equalTo((Group) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Group other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && users.equals(other.users) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.users, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional>> users = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Group other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + users(other.getUsers()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    The name of the Group

    + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "users", nulls = Nulls.SKIP) + public Builder users(Optional>> users) { + this.users = users; + return this; + } + + public Builder users(List> users) { + this.users = Optional.ofNullable(users); + return this; + } + + /** + *

    When the third party's group was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's group was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(GroupFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Group build() { + return new Group( + id, + remoteId, + createdAt, + modifiedAt, + name, + users, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/GroupFieldMappings.java b/src/main/java/com/merge/api/chat/types/GroupFieldMappings.java new file mode 100644 index 000000000..9f08d5d84 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/GroupFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupFieldMappings.Builder.class) +public final class GroupFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private GroupFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupFieldMappings && equalTo((GroupFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public GroupFieldMappings build() { + return new GroupFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/GroupUsersItem.java b/src/main/java/com/merge/api/chat/types/GroupUsersItem.java new file mode 100644 index 000000000..cf78f4b97 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/GroupUsersItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GroupUsersItem.Deserializer.class) +public final class GroupUsersItem { + private final Object value; + + private final int type; + + private GroupUsersItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupUsersItem && equalTo((GroupUsersItem) other); + } + + private boolean equalTo(GroupUsersItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GroupUsersItem of(String value) { + return new GroupUsersItem(value, 0); + } + + public static GroupUsersItem of(User value) { + return new GroupUsersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GroupUsersItem.class); + } + + @java.lang.Override + public GroupUsersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, User.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/GroupsListRequest.java b/src/main/java/com/merge/api/chat/types/GroupsListRequest.java new file mode 100644 index 000000000..5a5430a0a --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/GroupsListRequest.java @@ -0,0 +1,434 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsListRequest.Builder.class) +public final class GroupsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private GroupsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsListRequest && equalTo((GroupsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public GroupsListRequest build() { + return new GroupsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/GroupsRetrieveRequest.java b/src/main/java/com/merge/api/chat/types/GroupsRetrieveRequest.java new file mode 100644 index 000000000..e9b317684 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/GroupsRetrieveRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsRetrieveRequest.Builder.class) +public final class GroupsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private GroupsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsRetrieveRequest && equalTo((GroupsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public GroupsRetrieveRequest build() { + return new GroupsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/chat/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..fb304ca61 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/chat/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..f2862fc42 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/Issue.java b/src/main/java/com/merge/api/chat/types/Issue.java new file mode 100644 index 000000000..3cacef1d7 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/Issue.java @@ -0,0 +1,349 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

    Status of the issue.

    + */ + _FinalStage status(Optional status); + + _FinalStage status(IssueStatus status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

    Status of the issue.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

    Status of the issue.

    + */ + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/IssueStatus.java b/src/main/java/com/merge/api/chat/types/IssueStatus.java new file mode 100644 index 000000000..ccd6574b0 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/IssueStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = IssueStatus.Deserializer.class) +public final class IssueStatus { + private final Object value; + + private final int type; + + private IssueStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((IssueStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssueStatus && equalTo((IssueStatus) other); + } + + private boolean equalTo(IssueStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static IssueStatus of(IssueStatusEnum value) { + return new IssueStatus(value, 0); + } + + public static IssueStatus of(String value) { + return new IssueStatus(value, 1); + } + + public interface Visitor { + T visit(IssueStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(IssueStatus.class); + } + + @java.lang.Override + public IssueStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/IssueStatusEnum.java b/src/main/java/com/merge/api/chat/types/IssueStatusEnum.java new file mode 100644 index 000000000..a6aedb9ea --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/IssueStatusEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class IssueStatusEnum { + public static final IssueStatusEnum ONGOING = new IssueStatusEnum(Value.ONGOING, "ONGOING"); + + public static final IssueStatusEnum RESOLVED = new IssueStatusEnum(Value.RESOLVED, "RESOLVED"); + + private final Value value; + + private final String string; + + IssueStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof IssueStatusEnum && this.string.equals(((IssueStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ONGOING: + return visitor.visitOngoing(); + case RESOLVED: + return visitor.visitResolved(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IssueStatusEnum valueOf(String value) { + switch (value) { + case "ONGOING": + return ONGOING; + case "RESOLVED": + return RESOLVED; + default: + return new IssueStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ONGOING, + + RESOLVED, + + UNKNOWN + } + + public interface Visitor { + T visitOngoing(); + + T visitResolved(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/IssuesListRequest.java b/src/main/java/com/merge/api/chat/types/IssuesListRequest.java new file mode 100644 index 000000000..85778d4a7 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/IssuesListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    If included, will only include issues whose most recent action occurred before this time

    + */ + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + /** + *

    If provided, will only return issues whose first incident time was after this datetime.

    + */ + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + /** + *

    If provided, will only return issues whose first incident time was before this datetime.

    + */ + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + /** + *

    If true, will include muted issues

    + */ + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + /** + *

    If provided, will only return issues whose last incident time was after this datetime.

    + */ + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + /** + *

    If provided, will only return issues whose last incident time was before this datetime.

    + */ + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + /** + *

    If provided, will only include issues pertaining to the linked account passed in.

    + */ + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    If included, will only include issues whose most recent action occurred after this time

    + */ + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + /** + *

    Status of the issue.

    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/chat/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..e2992df65 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/IssuesListRequestStatus.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class IssuesListRequestStatus { + public static final IssuesListRequestStatus ONGOING = new IssuesListRequestStatus(Value.ONGOING, "ONGOING"); + + public static final IssuesListRequestStatus RESOLVED = new IssuesListRequestStatus(Value.RESOLVED, "RESOLVED"); + + private final Value value; + + private final String string; + + IssuesListRequestStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof IssuesListRequestStatus + && this.string.equals(((IssuesListRequestStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ONGOING: + return visitor.visitOngoing(); + case RESOLVED: + return visitor.visitResolved(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IssuesListRequestStatus valueOf(String value) { + switch (value) { + case "ONGOING": + return ONGOING; + case "RESOLVED": + return RESOLVED; + default: + return new IssuesListRequestStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + ONGOING, + + RESOLVED, + + UNKNOWN + } + + public interface Visitor { + T visitOngoing(); + + T visitResolved(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/LanguageEnum.java b/src/main/java/com/merge/api/chat/types/LanguageEnum.java new file mode 100644 index 000000000..b823adb3d --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/LanguageEnum.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LanguageEnum { + public static final LanguageEnum DE = new LanguageEnum(Value.DE, "de"); + + public static final LanguageEnum EN = new LanguageEnum(Value.EN, "en"); + + private final Value value; + + private final String string; + + LanguageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof LanguageEnum && this.string.equals(((LanguageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DE: + return visitor.visitDe(); + case EN: + return visitor.visitEn(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LanguageEnum valueOf(String value) { + switch (value) { + case "de": + return DE; + case "en": + return EN; + default: + return new LanguageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + EN, + + DE, + + UNKNOWN + } + + public interface Visitor { + T visitEn(); + + T visitDe(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/LastSyncResultEnum.java b/src/main/java/com/merge/api/chat/types/LastSyncResultEnum.java new file mode 100644 index 000000000..7d20a9d2f --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/LastSyncResultEnum.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LastSyncResultEnum { + public static final LastSyncResultEnum DISABLED = new LastSyncResultEnum(Value.DISABLED, "DISABLED"); + + public static final LastSyncResultEnum SYNCING = new LastSyncResultEnum(Value.SYNCING, "SYNCING"); + + public static final LastSyncResultEnum PAUSED = new LastSyncResultEnum(Value.PAUSED, "PAUSED"); + + public static final LastSyncResultEnum DONE = new LastSyncResultEnum(Value.DONE, "DONE"); + + public static final LastSyncResultEnum FAILED = new LastSyncResultEnum(Value.FAILED, "FAILED"); + + public static final LastSyncResultEnum PARTIALLY_SYNCED = + new LastSyncResultEnum(Value.PARTIALLY_SYNCED, "PARTIALLY_SYNCED"); + + private final Value value; + + private final String string; + + LastSyncResultEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LastSyncResultEnum && this.string.equals(((LastSyncResultEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISABLED: + return visitor.visitDisabled(); + case SYNCING: + return visitor.visitSyncing(); + case PAUSED: + return visitor.visitPaused(); + case DONE: + return visitor.visitDone(); + case FAILED: + return visitor.visitFailed(); + case PARTIALLY_SYNCED: + return visitor.visitPartiallySynced(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LastSyncResultEnum valueOf(String value) { + switch (value) { + case "DISABLED": + return DISABLED; + case "SYNCING": + return SYNCING; + case "PAUSED": + return PAUSED; + case "DONE": + return DONE; + case "FAILED": + return FAILED; + case "PARTIALLY_SYNCED": + return PARTIALLY_SYNCED; + default: + return new LastSyncResultEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + SYNCING, + + DONE, + + FAILED, + + DISABLED, + + PAUSED, + + PARTIALLY_SYNCED, + + UNKNOWN + } + + public interface Visitor { + T visitSyncing(); + + T visitDone(); + + T visitFailed(); + + T visitDisabled(); + + T visitPaused(); + + T visitPartiallySynced(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/LinkToken.java b/src/main/java/com/merge/api/chat/types/LinkToken.java new file mode 100644 index 000000000..b39f9cd7e --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/LinkToken.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkToken.Builder.class) +public final class LinkToken { + private final String linkToken; + + private final Optional integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/chat/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..2b6a8f3d2 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + /** + *

    The common models you want to update the scopes for

    + */ + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/chat/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..f090f8035 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/LinkedAccountsListRequest.java @@ -0,0 +1,484 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: hris, ats, accounting, ticketing, crm, mktg, filestorage, knowledgebase, chat + */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return 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. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + /** + *

    Options: hris, ats, accounting, ticketing, crm, mktg, filestorage, knowledgebase, chat

    + */ + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    If provided, will only return linked accounts associated with the given email address.

    + */ + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + /** + *

    If provided, will only return linked accounts associated with the given organization name.

    + */ + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + /** + *

    If provided, will only return linked accounts associated with the given origin ID.

    + */ + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + /** + *

    Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once.

    + */ + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once.

    + */ + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + /** + *

    If provided, will only return linked accounts associated with the given integration name.

    + */ + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + /** + *

    If included, will only include test linked accounts. If not included, will only include non-test linked accounts.

    + */ + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED

    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/chat/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..5bd43e9e3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LinkedAccountsListRequestCategory { + public static final LinkedAccountsListRequestCategory HRIS = + new LinkedAccountsListRequestCategory(Value.HRIS, "hris"); + + public static final LinkedAccountsListRequestCategory KNOWLEDGEBASE = + new LinkedAccountsListRequestCategory(Value.KNOWLEDGEBASE, "knowledgebase"); + + public static final LinkedAccountsListRequestCategory TICKETING = + new LinkedAccountsListRequestCategory(Value.TICKETING, "ticketing"); + + public static final LinkedAccountsListRequestCategory CRM = new LinkedAccountsListRequestCategory(Value.CRM, "crm"); + + public static final LinkedAccountsListRequestCategory FILESTORAGE = + new LinkedAccountsListRequestCategory(Value.FILESTORAGE, "filestorage"); + + public static final LinkedAccountsListRequestCategory ACCOUNTING = + new LinkedAccountsListRequestCategory(Value.ACCOUNTING, "accounting"); + + public static final LinkedAccountsListRequestCategory MKTG = + new LinkedAccountsListRequestCategory(Value.MKTG, "mktg"); + + public static final LinkedAccountsListRequestCategory ATS = new LinkedAccountsListRequestCategory(Value.ATS, "ats"); + + public static final LinkedAccountsListRequestCategory CHAT = + new LinkedAccountsListRequestCategory(Value.CHAT, "chat"); + + private final Value value; + + private final String string; + + LinkedAccountsListRequestCategory(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LinkedAccountsListRequestCategory + && this.string.equals(((LinkedAccountsListRequestCategory) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HRIS: + return visitor.visitHris(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); + case TICKETING: + return visitor.visitTicketing(); + case CRM: + return visitor.visitCrm(); + case FILESTORAGE: + return visitor.visitFilestorage(); + case ACCOUNTING: + return visitor.visitAccounting(); + case MKTG: + return visitor.visitMktg(); + case ATS: + return visitor.visitAts(); + case CHAT: + return visitor.visitChat(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LinkedAccountsListRequestCategory valueOf(String value) { + switch (value) { + case "hris": + return HRIS; + case "knowledgebase": + return KNOWLEDGEBASE; + case "ticketing": + return TICKETING; + case "crm": + return CRM; + case "filestorage": + return FILESTORAGE; + case "accounting": + return ACCOUNTING; + case "mktg": + return MKTG; + case "ats": + return ATS; + case "chat": + return CHAT; + default: + return new LinkedAccountsListRequestCategory(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNTING, + + ATS, + + CHAT, + + CRM, + + FILESTORAGE, + + HRIS, + + KNOWLEDGEBASE, + + MKTG, + + TICKETING, + + UNKNOWN + } + + public interface Visitor { + T visitAccounting(); + + T visitAts(); + + T visitChat(); + + T visitCrm(); + + T visitFilestorage(); + + T visitHris(); + + T visitKnowledgebase(); + + T visitMktg(); + + T visitTicketing(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/Member.java b/src/main/java/com/merge/api/chat/types/Member.java new file mode 100644 index 000000000..2fb2ebd59 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/Member.java @@ -0,0 +1,442 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Member.Builder.class) +public final class Member { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional user; + + private final Optional group; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional visibleHistoryStartDatetime; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Member( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional user, + Optional group, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional visibleHistoryStartDatetime, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.user = user; + this.group = group; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.visibleHistoryStartDatetime = visibleHistoryStartDatetime; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The user that is a member of the conversation. Only populated if the member is a user. + */ + @JsonProperty("user") + public Optional getUser() { + return user; + } + + /** + * @return The group that is a member of the conversation. Only populated if the member is a group. + */ + @JsonProperty("group") + public Optional getGroup() { + return group; + } + + /** + * @return When the third party's conversation was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's conversation was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return The earliest datetime of messages the member can access in the conversation. If null, the member can see the full history. + */ + @JsonProperty("visible_history_start_datetime") + public Optional getVisibleHistoryStartDatetime() { + return visibleHistoryStartDatetime; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Member && equalTo((Member) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Member other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && user.equals(other.user) + && group.equals(other.group) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && visibleHistoryStartDatetime.equals(other.visibleHistoryStartDatetime) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.user, + this.group, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.visibleHistoryStartDatetime, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional user = Optional.empty(); + + private Optional group = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional visibleHistoryStartDatetime = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Member other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + user(other.getUser()); + group(other.getGroup()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + visibleHistoryStartDatetime(other.getVisibleHistoryStartDatetime()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    The user that is a member of the conversation. Only populated if the member is a user.

    + */ + @JsonSetter(value = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(MemberUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + /** + *

    The group that is a member of the conversation. Only populated if the member is a group.

    + */ + @JsonSetter(value = "group", nulls = Nulls.SKIP) + public Builder group(Optional group) { + this.group = group; + return this; + } + + public Builder group(MemberGroup group) { + this.group = Optional.ofNullable(group); + return this; + } + + /** + *

    When the third party's conversation was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's conversation was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    The earliest datetime of messages the member can access in the conversation. If null, the member can see the full history.

    + */ + @JsonSetter(value = "visible_history_start_datetime", nulls = Nulls.SKIP) + public Builder visibleHistoryStartDatetime(Optional visibleHistoryStartDatetime) { + this.visibleHistoryStartDatetime = visibleHistoryStartDatetime; + return this; + } + + public Builder visibleHistoryStartDatetime(OffsetDateTime visibleHistoryStartDatetime) { + this.visibleHistoryStartDatetime = Optional.ofNullable(visibleHistoryStartDatetime); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(MemberFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Member build() { + return new Member( + id, + remoteId, + createdAt, + modifiedAt, + user, + group, + remoteCreatedAt, + remoteUpdatedAt, + visibleHistoryStartDatetime, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MemberFieldMappings.java b/src/main/java/com/merge/api/chat/types/MemberFieldMappings.java new file mode 100644 index 000000000..56a1b3e67 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MemberFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MemberFieldMappings.Builder.class) +public final class MemberFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private MemberFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MemberFieldMappings && equalTo((MemberFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MemberFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(MemberFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public MemberFieldMappings build() { + return new MemberFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MemberGroup.java b/src/main/java/com/merge/api/chat/types/MemberGroup.java new file mode 100644 index 000000000..4af784494 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MemberGroup.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = MemberGroup.Deserializer.class) +public final class MemberGroup { + private final Object value; + + private final int type; + + private MemberGroup(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MemberGroup && equalTo((MemberGroup) other); + } + + private boolean equalTo(MemberGroup other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static MemberGroup of(String value) { + return new MemberGroup(value, 0); + } + + public static MemberGroup of(Group value) { + return new MemberGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(MemberGroup.class); + } + + @java.lang.Override + public MemberGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Group.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MemberUser.java b/src/main/java/com/merge/api/chat/types/MemberUser.java new file mode 100644 index 000000000..fd23cb9f3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MemberUser.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = MemberUser.Deserializer.class) +public final class MemberUser { + private final Object value; + + private final int type; + + private MemberUser(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MemberUser && equalTo((MemberUser) other); + } + + private boolean equalTo(MemberUser other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static MemberUser of(String value) { + return new MemberUser(value, 0); + } + + public static MemberUser of(User value) { + return new MemberUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(MemberUser.class); + } + + @java.lang.Override + public MemberUser deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, User.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/Message.java b/src/main/java/com/merge/api/chat/types/Message.java new file mode 100644 index 000000000..03b16b021 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/Message.java @@ -0,0 +1,485 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Message.Builder.class) +public final class Message { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional userId; + + private final Optional conversationId; + + private final Optional body; + + private final Optional subjectLine; + + private final Optional rootMessageId; + + private final Optional url; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Map additionalProperties; + + private Message( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional userId, + Optional conversationId, + Optional body, + Optional subjectLine, + Optional rootMessageId, + Optional url, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.userId = userId; + this.conversationId = conversationId; + this.body = body; + this.subjectLine = subjectLine; + this.rootMessageId = rootMessageId; + this.url = url; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The user that sent the message. + */ + @JsonProperty("user_id") + public Optional getUserId() { + return userId; + } + + /** + * @return The conversation this message belongs to. + */ + @JsonProperty("conversation_id") + public Optional getConversationId() { + return conversationId; + } + + /** + * @return The body of the message. + */ + @JsonProperty("body") + public Optional getBody() { + return body; + } + + /** + * @return The subject line of the message. + */ + @JsonProperty("subject_line") + public Optional getSubjectLine() { + return subjectLine; + } + + /** + * @return The root message this message belongs to. + */ + @JsonProperty("root_message_id") + public Optional getRootMessageId() { + return rootMessageId; + } + + /** + * @return The url of the message. + */ + @JsonProperty("url") + public Optional getUrl() { + return url; + } + + /** + * @return When the third party's conversation was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's conversation was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Message && equalTo((Message) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Message other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && userId.equals(other.userId) + && conversationId.equals(other.conversationId) + && body.equals(other.body) + && subjectLine.equals(other.subjectLine) + && rootMessageId.equals(other.rootMessageId) + && url.equals(other.url) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.userId, + this.conversationId, + this.body, + this.subjectLine, + this.rootMessageId, + this.url, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional userId = Optional.empty(); + + private Optional conversationId = Optional.empty(); + + private Optional body = Optional.empty(); + + private Optional subjectLine = Optional.empty(); + + private Optional rootMessageId = Optional.empty(); + + private Optional url = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Message other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + userId(other.getUserId()); + conversationId(other.getConversationId()); + body(other.getBody()); + subjectLine(other.getSubjectLine()); + rootMessageId(other.getRootMessageId()); + url(other.getUrl()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    The user that sent the message.

    + */ + @JsonSetter(value = "user_id", nulls = Nulls.SKIP) + public Builder userId(Optional userId) { + this.userId = userId; + return this; + } + + public Builder userId(String userId) { + this.userId = Optional.ofNullable(userId); + return this; + } + + /** + *

    The conversation this message belongs to.

    + */ + @JsonSetter(value = "conversation_id", nulls = Nulls.SKIP) + public Builder conversationId(Optional conversationId) { + this.conversationId = conversationId; + return this; + } + + public Builder conversationId(String conversationId) { + this.conversationId = Optional.ofNullable(conversationId); + return this; + } + + /** + *

    The body of the message.

    + */ + @JsonSetter(value = "body", nulls = Nulls.SKIP) + public Builder body(Optional body) { + this.body = body; + return this; + } + + public Builder body(String body) { + this.body = Optional.ofNullable(body); + return this; + } + + /** + *

    The subject line of the message.

    + */ + @JsonSetter(value = "subject_line", nulls = Nulls.SKIP) + public Builder subjectLine(Optional subjectLine) { + this.subjectLine = subjectLine; + return this; + } + + public Builder subjectLine(String subjectLine) { + this.subjectLine = Optional.ofNullable(subjectLine); + return this; + } + + /** + *

    The root message this message belongs to.

    + */ + @JsonSetter(value = "root_message_id", nulls = Nulls.SKIP) + public Builder rootMessageId(Optional rootMessageId) { + this.rootMessageId = rootMessageId; + return this; + } + + public Builder rootMessageId(String rootMessageId) { + this.rootMessageId = Optional.ofNullable(rootMessageId); + return this; + } + + /** + *

    The url of the message.

    + */ + @JsonSetter(value = "url", nulls = Nulls.SKIP) + public Builder url(Optional url) { + this.url = url; + return this; + } + + public Builder url(String url) { + this.url = Optional.ofNullable(url); + return this; + } + + /** + *

    When the third party's conversation was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's conversation was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + public Message build() { + return new Message( + id, + remoteId, + createdAt, + modifiedAt, + userId, + conversationId, + body, + subjectLine, + rootMessageId, + url, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MessagesListRequest.java b/src/main/java/com/merge/api/chat/types/MessagesListRequest.java new file mode 100644 index 000000000..feb46e61e --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MessagesListRequest.java @@ -0,0 +1,491 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MessagesListRequest.Builder.class) +public final class MessagesListRequest { + private final Optional conversationId; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional orderBy; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Optional rootMessage; + + private final Map additionalProperties; + + private MessagesListRequest( + Optional conversationId, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional orderBy, + Optional pageSize, + Optional remoteId, + Optional rootMessage, + Map additionalProperties) { + this.conversationId = conversationId; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.orderBy = orderBy; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.rootMessage = rootMessage; + this.additionalProperties = additionalProperties; + } + + /** + * @return Filter messages by conversation ID. + */ + @JsonProperty("conversation_id") + public Optional getConversationId() { + return conversationId; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at. + */ + @JsonProperty("order_by") + public Optional getOrderBy() { + return orderBy; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided as 'true', will only return root messages (messages without a parent message). + */ + @JsonProperty("root_message") + public Optional getRootMessage() { + return rootMessage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MessagesListRequest && equalTo((MessagesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MessagesListRequest other) { + return conversationId.equals(other.conversationId) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && orderBy.equals(other.orderBy) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId) + && rootMessage.equals(other.rootMessage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.conversationId, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.orderBy, + this.pageSize, + this.remoteId, + this.rootMessage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional conversationId = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional orderBy = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional rootMessage = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(MessagesListRequest other) { + conversationId(other.getConversationId()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + orderBy(other.getOrderBy()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + rootMessage(other.getRootMessage()); + return this; + } + + /** + *

    Filter messages by conversation ID.

    + */ + @JsonSetter(value = "conversation_id", nulls = Nulls.SKIP) + public Builder conversationId(Optional conversationId) { + this.conversationId = conversationId; + return this; + } + + public Builder conversationId(String conversationId) { + this.conversationId = Optional.ofNullable(conversationId); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at.

    + */ + @JsonSetter(value = "order_by", nulls = Nulls.SKIP) + public Builder orderBy(Optional orderBy) { + this.orderBy = orderBy; + return this; + } + + public Builder orderBy(MessagesListRequestOrderBy orderBy) { + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    If provided as 'true', will only return root messages (messages without a parent message).

    + */ + @JsonSetter(value = "root_message", nulls = Nulls.SKIP) + public Builder rootMessage(Optional rootMessage) { + this.rootMessage = rootMessage; + return this; + } + + public Builder rootMessage(String rootMessage) { + this.rootMessage = Optional.ofNullable(rootMessage); + return this; + } + + public MessagesListRequest build() { + return new MessagesListRequest( + conversationId, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + orderBy, + pageSize, + remoteId, + rootMessage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MessagesListRequestOrderBy.java b/src/main/java/com/merge/api/chat/types/MessagesListRequestOrderBy.java new file mode 100644 index 000000000..dc6c11007 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MessagesListRequestOrderBy.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class MessagesListRequestOrderBy { + public static final MessagesListRequestOrderBy REMOTE_CREATED_AT_DESCENDING = + new MessagesListRequestOrderBy(Value.REMOTE_CREATED_AT_DESCENDING, "-remote_created_at"); + + public static final MessagesListRequestOrderBy REMOTE_CREATED_AT_ASCENDING = + new MessagesListRequestOrderBy(Value.REMOTE_CREATED_AT_ASCENDING, "remote_created_at"); + + private final Value value; + + private final String string; + + MessagesListRequestOrderBy(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof MessagesListRequestOrderBy + && this.string.equals(((MessagesListRequestOrderBy) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REMOTE_CREATED_AT_DESCENDING: + return visitor.visitRemoteCreatedAtDescending(); + case REMOTE_CREATED_AT_ASCENDING: + return visitor.visitRemoteCreatedAtAscending(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static MessagesListRequestOrderBy valueOf(String value) { + switch (value) { + case "-remote_created_at": + return REMOTE_CREATED_AT_DESCENDING; + case "remote_created_at": + return REMOTE_CREATED_AT_ASCENDING; + default: + return new MessagesListRequestOrderBy(Value.UNKNOWN, value); + } + } + + public enum Value { + REMOTE_CREATED_AT_DESCENDING, + + REMOTE_CREATED_AT_ASCENDING, + + UNKNOWN + } + + public interface Visitor { + T visitRemoteCreatedAtDescending(); + + T visitRemoteCreatedAtAscending(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/MessagesRepliesListRequest.java b/src/main/java/com/merge/api/chat/types/MessagesRepliesListRequest.java new file mode 100644 index 000000000..d2e376a13 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MessagesRepliesListRequest.java @@ -0,0 +1,266 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MessagesRepliesListRequest.Builder.class) +public final class MessagesRepliesListRequest { + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional orderBy; + + private final Optional pageSize; + + private final Map additionalProperties; + + private MessagesRepliesListRequest( + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional orderBy, + Optional pageSize, + Map additionalProperties) { + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.orderBy = orderBy; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at. + */ + @JsonProperty("order_by") + public Optional getOrderBy() { + return orderBy; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MessagesRepliesListRequest && equalTo((MessagesRepliesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MessagesRepliesListRequest other) { + return cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && orderBy.equals(other.orderBy) + && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.orderBy, + this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional orderBy = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(MessagesRepliesListRequest other) { + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + orderBy(other.getOrderBy()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at.

    + */ + @JsonSetter(value = "order_by", nulls = Nulls.SKIP) + public Builder orderBy(Optional orderBy) { + this.orderBy = orderBy; + return this; + } + + public Builder orderBy(MessagesRepliesListRequestOrderBy orderBy) { + this.orderBy = Optional.ofNullable(orderBy); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public MessagesRepliesListRequest build() { + return new MessagesRepliesListRequest( + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + orderBy, + pageSize, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MessagesRepliesListRequestOrderBy.java b/src/main/java/com/merge/api/chat/types/MessagesRepliesListRequestOrderBy.java new file mode 100644 index 000000000..6a961d6ba --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MessagesRepliesListRequestOrderBy.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class MessagesRepliesListRequestOrderBy { + public static final MessagesRepliesListRequestOrderBy REMOTE_CREATED_AT_DESCENDING = + new MessagesRepliesListRequestOrderBy(Value.REMOTE_CREATED_AT_DESCENDING, "-remote_created_at"); + + public static final MessagesRepliesListRequestOrderBy REMOTE_CREATED_AT_ASCENDING = + new MessagesRepliesListRequestOrderBy(Value.REMOTE_CREATED_AT_ASCENDING, "remote_created_at"); + + private final Value value; + + private final String string; + + MessagesRepliesListRequestOrderBy(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof MessagesRepliesListRequestOrderBy + && this.string.equals(((MessagesRepliesListRequestOrderBy) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REMOTE_CREATED_AT_DESCENDING: + return visitor.visitRemoteCreatedAtDescending(); + case REMOTE_CREATED_AT_ASCENDING: + return visitor.visitRemoteCreatedAtAscending(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static MessagesRepliesListRequestOrderBy valueOf(String value) { + switch (value) { + case "-remote_created_at": + return REMOTE_CREATED_AT_DESCENDING; + case "remote_created_at": + return REMOTE_CREATED_AT_ASCENDING; + default: + return new MessagesRepliesListRequestOrderBy(Value.UNKNOWN, value); + } + } + + public enum Value { + REMOTE_CREATED_AT_DESCENDING, + + REMOTE_CREATED_AT_ASCENDING, + + UNKNOWN + } + + public interface Visitor { + T visitRemoteCreatedAtDescending(); + + T visitRemoteCreatedAtAscending(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/MessagesRetrieveRequest.java b/src/main/java/com/merge/api/chat/types/MessagesRetrieveRequest.java new file mode 100644 index 000000000..ab23fbfac --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MessagesRetrieveRequest.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MessagesRetrieveRequest.Builder.class) +public final class MessagesRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private MessagesRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MessagesRetrieveRequest && equalTo((MessagesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MessagesRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(MessagesRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public MessagesRetrieveRequest build() { + return new MessagesRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MethodEnum.java b/src/main/java/com/merge/api/chat/types/MethodEnum.java new file mode 100644 index 000000000..547c31232 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MethodEnum.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class MethodEnum { + public static final MethodEnum OPTIONS = new MethodEnum(Value.OPTIONS, "OPTIONS"); + + public static final MethodEnum PATCH = new MethodEnum(Value.PATCH, "PATCH"); + + public static final MethodEnum DELETE = new MethodEnum(Value.DELETE, "DELETE"); + + public static final MethodEnum GET = new MethodEnum(Value.GET, "GET"); + + public static final MethodEnum PUT = new MethodEnum(Value.PUT, "PUT"); + + public static final MethodEnum HEAD = new MethodEnum(Value.HEAD, "HEAD"); + + public static final MethodEnum POST = new MethodEnum(Value.POST, "POST"); + + private final Value value; + + private final String string; + + MethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof MethodEnum && this.string.equals(((MethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OPTIONS: + return visitor.visitOptions(); + case PATCH: + return visitor.visitPatch(); + case DELETE: + return visitor.visitDelete(); + case GET: + return visitor.visitGet(); + case PUT: + return visitor.visitPut(); + case HEAD: + return visitor.visitHead(); + case POST: + return visitor.visitPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static MethodEnum valueOf(String value) { + switch (value) { + case "OPTIONS": + return OPTIONS; + case "PATCH": + return PATCH; + case "DELETE": + return DELETE; + case "GET": + return GET; + case "PUT": + return PUT; + case "HEAD": + return HEAD; + case "POST": + return POST; + default: + return new MethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + GET, + + OPTIONS, + + HEAD, + + POST, + + PUT, + + PATCH, + + DELETE, + + UNKNOWN + } + + public interface Visitor { + T visitGet(); + + T visitOptions(); + + T visitHead(); + + T visitPost(); + + T visitPut(); + + T visitPatch(); + + T visitDelete(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/ModelOperation.java b/src/main/java/com/merge/api/chat/types/ModelOperation.java new file mode 100644 index 000000000..a59b2cd6f --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ModelOperation.java @@ -0,0 +1,238 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + if (supportedFields != null) { + this.supportedFields.addAll(supportedFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + if (supportedFields != null) { + this.supportedFields.addAll(supportedFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + if (requiredPostParameters != null) { + this.requiredPostParameters.addAll(requiredPostParameters); + } + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + if (requiredPostParameters != null) { + this.requiredPostParameters.addAll(requiredPostParameters); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + if (availableOperations != null) { + this.availableOperations.addAll(availableOperations); + } + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + if (availableOperations != null) { + this.availableOperations.addAll(availableOperations); + } + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/chat/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..850d26839 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/chat/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..688fa1781 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/chat/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..587a3eb0a --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MultipartFormFieldRequest.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

    The name of the form field

    + */ + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + /** + *

    The data for the form field.

    + */ + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + /** + *

    The encoding of the value of data. Defaults to RAW if not defined.

    + */ + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); + + /** + *

    The file name of the form field, if the field is for a file.

    + */ + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + /** + *

    The MIME type of the file, if the field is for a file.

    + */ + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

    The name of the form field

    + *

    The name of the form field

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

    The data for the form field.

    + *

    The data for the form field.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

    The MIME type of the file, if the field is for a file.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + /** + *

    The MIME type of the file, if the field is for a file.

    + */ + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

    The file name of the form field, if the field is for a file.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + /** + *

    The file name of the form field, if the field is for a file.

    + */ + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

    The encoding of the value of data. Defaults to RAW if not defined.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + /** + *

    The encoding of the value of data. Defaults to RAW if not defined.

    + */ + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/chat/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..2cb3b0878 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) +public final class MultipartFormFieldRequestEncoding { + private final Object value; + + private final int type; + + private MultipartFormFieldRequestEncoding(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EncodingEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); + } + + private boolean equalTo(MultipartFormFieldRequestEncoding other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { + return new MultipartFormFieldRequestEncoding(value, 0); + } + + public static MultipartFormFieldRequestEncoding of(String value) { + return new MultipartFormFieldRequestEncoding(value, 1); + } + + public interface Visitor { + T visit(EncodingEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(MultipartFormFieldRequestEncoding.class); + } + + @java.lang.Override + public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/chat/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..4d19a2a81 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/chat/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..b2c495d74 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedConversationList.java b/src/main/java/com/merge/api/chat/types/PaginatedConversationList.java new file mode 100644 index 000000000..1e859c422 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedConversationList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedConversationList.Builder.class) +public final class PaginatedConversationList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedConversationList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedConversationList && equalTo((PaginatedConversationList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedConversationList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedConversationList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedConversationList build() { + return new PaginatedConversationList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedGroupList.java b/src/main/java/com/merge/api/chat/types/PaginatedGroupList.java new file mode 100644 index 000000000..978a13241 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedGroupList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedGroupList.Builder.class) +public final class PaginatedGroupList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedGroupList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedGroupList && equalTo((PaginatedGroupList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedGroupList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedGroupList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedGroupList build() { + return new PaginatedGroupList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedIssueList.java b/src/main/java/com/merge/api/chat/types/PaginatedIssueList.java new file mode 100644 index 000000000..2547d5647 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedMemberList.java b/src/main/java/com/merge/api/chat/types/PaginatedMemberList.java new file mode 100644 index 000000000..5b7496105 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedMemberList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedMemberList.Builder.class) +public final class PaginatedMemberList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedMemberList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedMemberList && equalTo((PaginatedMemberList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedMemberList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedMemberList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedMemberList build() { + return new PaginatedMemberList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedMessageList.java b/src/main/java/com/merge/api/chat/types/PaginatedMessageList.java new file mode 100644 index 000000000..e75c7e0b3 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedMessageList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedMessageList.Builder.class) +public final class PaginatedMessageList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedMessageList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedMessageList && equalTo((PaginatedMessageList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedMessageList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedMessageList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedMessageList build() { + return new PaginatedMessageList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/chat/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..a2e098b4d --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PaginatedUserList.java b/src/main/java/com/merge/api/chat/types/PaginatedUserList.java new file mode 100644 index 000000000..77413b0ec --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PaginatedUserList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedUserList.Builder.class) +public final class PaginatedUserList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedUserList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedUserList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedUserList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedUserList build() { + return new PaginatedUserList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/chat/types/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..98367504c --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/PatchedEditFieldMappingRequest.java @@ -0,0 +1,268 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) +public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + + private final Optional> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Optional jmesPath, + Optional advancedMappingExpression, + Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return DEPRECATED: Use 'advanced_mapping_expression' instead. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + /** + * @return A JSONata expression used to transform the remote field data. + */ + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath, + this.advancedMappingExpression); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + private Optional jmesPath = Optional.empty(); + + private Optional advancedMappingExpression = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    + */ + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + /** + *

    The method of the remote endpoint where the remote field is coming from.

    + */ + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + /** + *

    The path of the remote endpoint where the remote field is coming from.

    + */ + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + /** + *

    DEPRECATED: Use 'advanced_mapping_expression' instead.

    + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    A JSONata expression used to transform the remote field data.

    + */ + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public Builder advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + public Builder advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + advancedMappingExpression, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/chat/types/RegenerateAccountToken.java new file mode 100644 index 000000000..13a528bfa --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteData.java b/src/main/java/com/merge/api/chat/types/RemoteData.java new file mode 100644 index 000000000..dee3f791b --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteData.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + /** + *

    The third-party API path that is being called.

    + */ + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

    The third-party API path that is being called.

    + *

    The third-party API path that is being called.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/chat/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..d7f4bbaad --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteEndpointInfo.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + if (fieldTraversalPath != null) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + } + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + if (fieldTraversalPath != null) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + } + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteFieldApi.java b/src/main/java/com/merge/api/chat/types/RemoteFieldApi.java new file mode 100644 index 000000000..de0ef45f6 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteFieldApi.java @@ -0,0 +1,279 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(RemoteFieldApiAdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(RemoteFieldApiAdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + if (schema != null) { + this.schema.putAll(schema); + } + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + if (schema != null) { + this.schema.putAll(schema); + } + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldRequestRemoteFieldClass.java b/src/main/java/com/merge/api/chat/types/RemoteFieldApiAdvancedMetadata.java similarity index 65% rename from src/main/java/com/merge/api/accounting/types/RemoteFieldRequestRemoteFieldClass.java rename to src/main/java/com/merge/api/chat/types/RemoteFieldApiAdvancedMetadata.java index bc6bb0c33..3e3e03642 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteFieldRequestRemoteFieldClass.java +++ b/src/main/java/com/merge/api/chat/types/RemoteFieldApiAdvancedMetadata.java @@ -1,7 +1,7 @@ /** * This file was auto-generated by Fern from our API Definition. */ -package com.merge.api.accounting.types; +package com.merge.api.chat.types; import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.core.JsonParseException; @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = RemoteFieldRequestRemoteFieldClass.Deserializer.class) -public final class RemoteFieldRequestRemoteFieldClass { +@JsonDeserialize(using = RemoteFieldApiAdvancedMetadata.Deserializer.class) +public final class RemoteFieldApiAdvancedMetadata { private final Object value; private final int type; - private RemoteFieldRequestRemoteFieldClass(Object value, int type) { + private RemoteFieldApiAdvancedMetadata(Object value, int type) { this.value = value; this.type = type; } @@ -32,9 +32,9 @@ public Object get() { @SuppressWarnings("unchecked") public T visit(Visitor visitor) { if (this.type == 0) { - return visitor.visit((String) this.value); + return visitor.visit((AdvancedMetadata) this.value); } else if (this.type == 1) { - return visitor.visit((RemoteFieldClass) this.value); + return visitor.visit((String) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -42,11 +42,10 @@ public T visit(Visitor visitor) { @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof RemoteFieldRequestRemoteFieldClass - && equalTo((RemoteFieldRequestRemoteFieldClass) other); + return other instanceof RemoteFieldApiAdvancedMetadata && equalTo((RemoteFieldApiAdvancedMetadata) other); } - private boolean equalTo(RemoteFieldRequestRemoteFieldClass other) { + private boolean equalTo(RemoteFieldApiAdvancedMetadata other) { return value.equals(other.value); } @@ -60,35 +59,35 @@ public String toString() { return this.value.toString(); } - public static RemoteFieldRequestRemoteFieldClass of(String value) { - return new RemoteFieldRequestRemoteFieldClass(value, 0); + public static RemoteFieldApiAdvancedMetadata of(AdvancedMetadata value) { + return new RemoteFieldApiAdvancedMetadata(value, 0); } - public static RemoteFieldRequestRemoteFieldClass of(RemoteFieldClass value) { - return new RemoteFieldRequestRemoteFieldClass(value, 1); + public static RemoteFieldApiAdvancedMetadata of(String value) { + return new RemoteFieldApiAdvancedMetadata(value, 1); } public interface Visitor { - T visit(String value); + T visit(AdvancedMetadata value); - T visit(RemoteFieldClass value); + T visit(String value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(RemoteFieldRequestRemoteFieldClass.class); + super(RemoteFieldApiAdvancedMetadata.class); } @java.lang.Override - public RemoteFieldRequestRemoteFieldClass deserialize(JsonParser p, DeserializationContext context) + public RemoteFieldApiAdvancedMetadata deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AdvancedMetadata.class)); } catch (RuntimeException e) { } try { - return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteFieldClass.class)); + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/chat/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/chat/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..eed413215 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/chat/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..bdf0ecb86 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteFieldApiResponse.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> user; + + private final Optional> group; + + private final Optional> conversation; + + private final Optional> member; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> user, + Optional> group, + Optional> conversation, + Optional> member, + Map additionalProperties) { + this.user = user; + this.group = group; + this.conversation = conversation; + this.member = member; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @JsonProperty("Conversation") + public Optional> getConversation() { + return conversation; + } + + @JsonProperty("Member") + public Optional> getMember() { + return member; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return user.equals(other.user) + && group.equals(other.group) + && conversation.equals(other.conversation) + && member.equals(other.member); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.user, this.group, this.conversation, this.member); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> user = Optional.empty(); + + private Optional> group = Optional.empty(); + + private Optional> conversation = Optional.empty(); + + private Optional> member = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + user(other.getUser()); + group(other.getGroup()); + conversation(other.getConversation()); + member(other.getMember()); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + @JsonSetter(value = "Conversation", nulls = Nulls.SKIP) + public Builder conversation(Optional> conversation) { + this.conversation = conversation; + return this; + } + + public Builder conversation(List conversation) { + this.conversation = Optional.ofNullable(conversation); + return this; + } + + @JsonSetter(value = "Member", nulls = Nulls.SKIP) + public Builder member(Optional> member) { + this.member = member; + return this; + } + + public Builder member(List member) { + this.member = Optional.ofNullable(member); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse(user, group, conversation, member, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/chat/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..8b98f9403 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return 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. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + /** + *

    A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.

    + */ + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteKey.java b/src/main/java/com/merge/api/chat/types/RemoteKey.java new file mode 100644 index 000000000..6f3bec458 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/chat/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..ac8a1871e --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

    The name of the remote key

    + */ + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

    The name of the remote key

    + *

    The name of the remote key

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteResponse.java b/src/main/java/com/merge/api/chat/types/RemoteResponse.java new file mode 100644 index 000000000..73fc4214e --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(RemoteResponseResponseType responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(RemoteResponseResponseType responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RemoteResponseResponseType.java b/src/main/java/com/merge/api/chat/types/RemoteResponseResponseType.java new file mode 100644 index 000000000..91cd94c53 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RemoteResponseResponseType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteResponseResponseType.Deserializer.class) +public final class RemoteResponseResponseType { + private final Object value; + + private final int type; + + private RemoteResponseResponseType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ResponseTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponseResponseType && equalTo((RemoteResponseResponseType) other); + } + + private boolean equalTo(RemoteResponseResponseType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteResponseResponseType of(ResponseTypeEnum value) { + return new RemoteResponseResponseType(value, 0); + } + + public static RemoteResponseResponseType of(String value) { + return new RemoteResponseResponseType(value, 1); + } + + public interface Visitor { + T visit(ResponseTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteResponseResponseType.class); + } + + @java.lang.Override + public RemoteResponseResponseType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ResponseTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/RequestFormatEnum.java b/src/main/java/com/merge/api/chat/types/RequestFormatEnum.java new file mode 100644 index 000000000..86689c065 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RequestFormatEnum.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RequestFormatEnum { + public static final RequestFormatEnum MULTIPART = new RequestFormatEnum(Value.MULTIPART, "MULTIPART"); + + public static final RequestFormatEnum XML = new RequestFormatEnum(Value.XML, "XML"); + + public static final RequestFormatEnum JSON = new RequestFormatEnum(Value.JSON, "JSON"); + + private final Value value; + + private final String string; + + RequestFormatEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof RequestFormatEnum && this.string.equals(((RequestFormatEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MULTIPART: + return visitor.visitMultipart(); + case XML: + return visitor.visitXml(); + case JSON: + return visitor.visitJson(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RequestFormatEnum valueOf(String value) { + switch (value) { + case "MULTIPART": + return MULTIPART; + case "XML": + return XML; + case "JSON": + return JSON; + default: + return new RequestFormatEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + JSON, + + XML, + + MULTIPART, + + UNKNOWN + } + + public interface Visitor { + T visitJson(); + + T visitXml(); + + T visitMultipart(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/chat/types/ResponseTypeEnum.java new file mode 100644 index 000000000..e77aed7fc --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ResponseTypeEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResponseTypeEnum { + public static final ResponseTypeEnum BASE_64_GZIP = new ResponseTypeEnum(Value.BASE_64_GZIP, "BASE64_GZIP"); + + public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); + + private final Value value; + + private final String string; + + ResponseTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResponseTypeEnum && this.string.equals(((ResponseTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BASE_64_GZIP: + return visitor.visitBase64Gzip(); + case JSON: + return visitor.visitJson(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResponseTypeEnum valueOf(String value) { + switch (value) { + case "BASE64_GZIP": + return BASE_64_GZIP; + case "JSON": + return JSON; + default: + return new ResponseTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + JSON, + + BASE_64_GZIP, + + UNKNOWN + } + + public interface Visitor { + T visitJson(); + + T visitBase64Gzip(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/RoleEnum.java b/src/main/java/com/merge/api/chat/types/RoleEnum.java new file mode 100644 index 000000000..88116042e --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/RoleEnum.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RoleEnum { + public static final RoleEnum API = new RoleEnum(Value.API, "API"); + + public static final RoleEnum DEVELOPER = new RoleEnum(Value.DEVELOPER, "DEVELOPER"); + + public static final RoleEnum MERGE_TEAM = new RoleEnum(Value.MERGE_TEAM, "MERGE_TEAM"); + + public static final RoleEnum MEMBER = new RoleEnum(Value.MEMBER, "MEMBER"); + + public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); + + private final Value value; + + private final String string; + + RoleEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof RoleEnum && this.string.equals(((RoleEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case API: + return visitor.visitApi(); + case DEVELOPER: + return visitor.visitDeveloper(); + case MERGE_TEAM: + return visitor.visitMergeTeam(); + case MEMBER: + return visitor.visitMember(); + case SYSTEM: + return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); + case ADMIN: + return visitor.visitAdmin(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RoleEnum valueOf(String value) { + switch (value) { + case "API": + return API; + case "DEVELOPER": + return DEVELOPER; + case "MERGE_TEAM": + return MERGE_TEAM; + case "MEMBER": + return MEMBER; + case "SYSTEM": + return SYSTEM; + case "SUPPORT": + return SUPPORT; + case "ADMIN": + return ADMIN; + default: + return new RoleEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ADMIN, + + DEVELOPER, + + MEMBER, + + API, + + SYSTEM, + + MERGE_TEAM, + + SUPPORT, + + UNKNOWN + } + + public interface Visitor { + T visitAdmin(); + + T visitDeveloper(); + + T visitMember(); + + T visitApi(); + + T visitSystem(); + + T visitMergeTeam(); + + T visitSupport(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/chat/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..2a40c1882 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SelectiveSyncConfigurationsUsageEnum { + public static final SelectiveSyncConfigurationsUsageEnum IN_NEXT_SYNC = + new SelectiveSyncConfigurationsUsageEnum(Value.IN_NEXT_SYNC, "IN_NEXT_SYNC"); + + public static final SelectiveSyncConfigurationsUsageEnum IN_LAST_SYNC = + new SelectiveSyncConfigurationsUsageEnum(Value.IN_LAST_SYNC, "IN_LAST_SYNC"); + + private final Value value; + + private final String string; + + SelectiveSyncConfigurationsUsageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SelectiveSyncConfigurationsUsageEnum + && this.string.equals(((SelectiveSyncConfigurationsUsageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case IN_NEXT_SYNC: + return visitor.visitInNextSync(); + case IN_LAST_SYNC: + return visitor.visitInLastSync(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SelectiveSyncConfigurationsUsageEnum valueOf(String value) { + switch (value) { + case "IN_NEXT_SYNC": + return IN_NEXT_SYNC; + case "IN_LAST_SYNC": + return IN_LAST_SYNC; + default: + return new SelectiveSyncConfigurationsUsageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + IN_NEXT_SYNC, + + IN_LAST_SYNC, + + UNKNOWN + } + + public interface Visitor { + T visitInNextSync(); + + T visitInLastSync(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/StatusFd5Enum.java b/src/main/java/com/merge/api/chat/types/StatusFd5Enum.java new file mode 100644 index 000000000..482a5a6f0 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/StatusFd5Enum.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class StatusFd5Enum { + public static final StatusFd5Enum DISABLED = new StatusFd5Enum(Value.DISABLED, "DISABLED"); + + public static final StatusFd5Enum SYNCING = new StatusFd5Enum(Value.SYNCING, "SYNCING"); + + public static final StatusFd5Enum PAUSED = new StatusFd5Enum(Value.PAUSED, "PAUSED"); + + public static final StatusFd5Enum DONE = new StatusFd5Enum(Value.DONE, "DONE"); + + public static final StatusFd5Enum FAILED = new StatusFd5Enum(Value.FAILED, "FAILED"); + + public static final StatusFd5Enum PARTIALLY_SYNCED = new StatusFd5Enum(Value.PARTIALLY_SYNCED, "PARTIALLY_SYNCED"); + + private final Value value; + + private final String string; + + StatusFd5Enum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof StatusFd5Enum && this.string.equals(((StatusFd5Enum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISABLED: + return visitor.visitDisabled(); + case SYNCING: + return visitor.visitSyncing(); + case PAUSED: + return visitor.visitPaused(); + case DONE: + return visitor.visitDone(); + case FAILED: + return visitor.visitFailed(); + case PARTIALLY_SYNCED: + return visitor.visitPartiallySynced(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static StatusFd5Enum valueOf(String value) { + switch (value) { + case "DISABLED": + return DISABLED; + case "SYNCING": + return SYNCING; + case "PAUSED": + return PAUSED; + case "DONE": + return DONE; + case "FAILED": + return FAILED; + case "PARTIALLY_SYNCED": + return PARTIALLY_SYNCED; + default: + return new StatusFd5Enum(Value.UNKNOWN, value); + } + } + + public enum Value { + SYNCING, + + DONE, + + FAILED, + + DISABLED, + + PAUSED, + + PARTIALLY_SYNCED, + + UNKNOWN + } + + public interface Visitor { + T visitSyncing(); + + T visitDone(); + + T visitFailed(); + + T visitDisabled(); + + T visitPaused(); + + T visitPartiallySynced(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/SyncStatus.java b/src/main/java/com/merge/api/chat/types/SyncStatus.java new file mode 100644 index 000000000..625dc573a --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final SyncStatusStatus status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + SyncStatusStatus status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public SyncStatusStatus getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull SyncStatusStatus status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(SyncStatusLastSyncResult lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private SyncStatusStatus status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatus status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(SyncStatusLastSyncResult lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/SyncStatusLastSyncResult.java b/src/main/java/com/merge/api/chat/types/SyncStatusLastSyncResult.java new file mode 100644 index 000000000..9c0ba8dea --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/SyncStatusLastSyncResult.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SyncStatusLastSyncResult.Deserializer.class) +public final class SyncStatusLastSyncResult { + private final Object value; + + private final int type; + + private SyncStatusLastSyncResult(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LastSyncResultEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusLastSyncResult && equalTo((SyncStatusLastSyncResult) other); + } + + private boolean equalTo(SyncStatusLastSyncResult other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SyncStatusLastSyncResult of(LastSyncResultEnum value) { + return new SyncStatusLastSyncResult(value, 0); + } + + public static SyncStatusLastSyncResult of(String value) { + return new SyncStatusLastSyncResult(value, 1); + } + + public interface Visitor { + T visit(LastSyncResultEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SyncStatusLastSyncResult.class); + } + + @java.lang.Override + public SyncStatusLastSyncResult deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LastSyncResultEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/chat/types/SyncStatusListRequest.java new file mode 100644 index 000000000..53cf43b25 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/SyncStatusListRequest.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/SyncStatusStatus.java b/src/main/java/com/merge/api/chat/types/SyncStatusStatus.java new file mode 100644 index 000000000..9a24422c1 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/SyncStatusStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SyncStatusStatus.Deserializer.class) +public final class SyncStatusStatus { + private final Object value; + + private final int type; + + private SyncStatusStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((StatusFd5Enum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusStatus && equalTo((SyncStatusStatus) other); + } + + private boolean equalTo(SyncStatusStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SyncStatusStatus of(StatusFd5Enum value) { + return new SyncStatusStatus(value, 0); + } + + public static SyncStatusStatus of(String value) { + return new SyncStatusStatus(value, 1); + } + + public interface Visitor { + T visit(StatusFd5Enum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SyncStatusStatus.class); + } + + @java.lang.Override + public SyncStatusStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, StatusFd5Enum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/TypeEnum.java b/src/main/java/com/merge/api/chat/types/TypeEnum.java new file mode 100644 index 000000000..1f89ef6b5 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/TypeEnum.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TypeEnum { + public static final TypeEnum MEETING_CHAT = new TypeEnum(Value.MEETING_CHAT, "MEETING_CHAT"); + + public static final TypeEnum PRIVATE_INTERNAL = new TypeEnum(Value.PRIVATE_INTERNAL, "PRIVATE_INTERNAL"); + + public static final TypeEnum ONE_ON_ONE_CHAT = new TypeEnum(Value.ONE_ON_ONE_CHAT, "ONE_ON_ONE_CHAT"); + + public static final TypeEnum PRIVATE_EXTERNAL = new TypeEnum(Value.PRIVATE_EXTERNAL, "PRIVATE_EXTERNAL"); + + public static final TypeEnum PUBLIC_INTERNAL = new TypeEnum(Value.PUBLIC_INTERNAL, "PUBLIC_INTERNAL"); + + public static final TypeEnum PUBLIC_EXTERNAL = new TypeEnum(Value.PUBLIC_EXTERNAL, "PUBLIC_EXTERNAL"); + + public static final TypeEnum GROUP_CHAT = new TypeEnum(Value.GROUP_CHAT, "GROUP_CHAT"); + + private final Value value; + + private final String string; + + TypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof TypeEnum && this.string.equals(((TypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MEETING_CHAT: + return visitor.visitMeetingChat(); + case PRIVATE_INTERNAL: + return visitor.visitPrivateInternal(); + case ONE_ON_ONE_CHAT: + return visitor.visitOneOnOneChat(); + case PRIVATE_EXTERNAL: + return visitor.visitPrivateExternal(); + case PUBLIC_INTERNAL: + return visitor.visitPublicInternal(); + case PUBLIC_EXTERNAL: + return visitor.visitPublicExternal(); + case GROUP_CHAT: + return visitor.visitGroupChat(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TypeEnum valueOf(String value) { + switch (value) { + case "MEETING_CHAT": + return MEETING_CHAT; + case "PRIVATE_INTERNAL": + return PRIVATE_INTERNAL; + case "ONE_ON_ONE_CHAT": + return ONE_ON_ONE_CHAT; + case "PRIVATE_EXTERNAL": + return PRIVATE_EXTERNAL; + case "PUBLIC_INTERNAL": + return PUBLIC_INTERNAL; + case "PUBLIC_EXTERNAL": + return PUBLIC_EXTERNAL; + case "GROUP_CHAT": + return GROUP_CHAT; + default: + return new TypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PRIVATE_INTERNAL, + + PRIVATE_EXTERNAL, + + PUBLIC_INTERNAL, + + PUBLIC_EXTERNAL, + + ONE_ON_ONE_CHAT, + + GROUP_CHAT, + + MEETING_CHAT, + + UNKNOWN + } + + public interface Visitor { + T visitPrivateInternal(); + + T visitPrivateExternal(); + + T visitPublicInternal(); + + T visitPublicExternal(); + + T visitOneOnOneChat(); + + T visitGroupChat(); + + T visitMeetingChat(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/chat/types/User.java b/src/main/java/com/merge/api/chat/types/User.java new file mode 100644 index 000000000..d28f41002 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/User.java @@ -0,0 +1,564 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = User.Builder.class) +public final class User { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional username; + + private final Optional displayName; + + private final Optional firstName; + + private final Optional lastName; + + private final Optional isBot; + + private final Optional>> groups; + + private final Optional avatar; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private User( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional username, + Optional displayName, + Optional firstName, + Optional lastName, + Optional isBot, + Optional>> groups, + Optional avatar, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.username = username; + this.displayName = displayName; + this.firstName = firstName; + this.lastName = lastName; + this.isBot = isBot; + this.groups = groups; + this.avatar = avatar; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return Username or handle + */ + @JsonProperty("username") + public Optional getUsername() { + return username; + } + + /** + * @return Full name or display name + */ + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + /** + * @return The user's first name + */ + @JsonProperty("first_name") + public Optional getFirstName() { + return firstName; + } + + /** + * @return The user's last name + */ + @JsonProperty("last_name") + public Optional getLastName() { + return lastName; + } + + /** + * @return

    true if the user is a bot

    + */ + @JsonProperty("is_bot") + public Optional getIsBot() { + return isBot; + } + + @JsonProperty("groups") + public Optional>> getGroups() { + return groups; + } + + /** + * @return The user's avatar image + */ + @JsonProperty("avatar") + public Optional getAvatar() { + return avatar; + } + + /** + * @return When the third party's user was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's user was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof User && equalTo((User) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(User other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && username.equals(other.username) + && displayName.equals(other.displayName) + && firstName.equals(other.firstName) + && lastName.equals(other.lastName) + && isBot.equals(other.isBot) + && groups.equals(other.groups) + && avatar.equals(other.avatar) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.username, + this.displayName, + this.firstName, + this.lastName, + this.isBot, + this.groups, + this.avatar, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional username = Optional.empty(); + + private Optional displayName = Optional.empty(); + + private Optional firstName = Optional.empty(); + + private Optional lastName = Optional.empty(); + + private Optional isBot = Optional.empty(); + + private Optional>> groups = Optional.empty(); + + private Optional avatar = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(User other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + username(other.getUsername()); + displayName(other.getDisplayName()); + firstName(other.getFirstName()); + lastName(other.getLastName()); + isBot(other.getIsBot()); + groups(other.getGroups()); + avatar(other.getAvatar()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

    The third-party API ID of the matching object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

    The datetime that this object was created by Merge.

    + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

    + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

    Username or handle

    + */ + @JsonSetter(value = "username", nulls = Nulls.SKIP) + public Builder username(Optional username) { + this.username = username; + return this; + } + + public Builder username(String username) { + this.username = Optional.ofNullable(username); + return this; + } + + /** + *

    Full name or display name

    + */ + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public Builder displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + public Builder displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + /** + *

    The user's first name

    + */ + @JsonSetter(value = "first_name", nulls = Nulls.SKIP) + public Builder firstName(Optional firstName) { + this.firstName = firstName; + return this; + } + + public Builder firstName(String firstName) { + this.firstName = Optional.ofNullable(firstName); + return this; + } + + /** + *

    The user's last name

    + */ + @JsonSetter(value = "last_name", nulls = Nulls.SKIP) + public Builder lastName(Optional lastName) { + this.lastName = lastName; + return this; + } + + public Builder lastName(String lastName) { + this.lastName = Optional.ofNullable(lastName); + return this; + } + + /** + *

    Returns true if the user is a bot

    + */ + @JsonSetter(value = "is_bot", nulls = Nulls.SKIP) + public Builder isBot(Optional isBot) { + this.isBot = isBot; + return this; + } + + public Builder isBot(Boolean isBot) { + this.isBot = Optional.ofNullable(isBot); + return this; + } + + @JsonSetter(value = "groups", nulls = Nulls.SKIP) + public Builder groups(Optional>> groups) { + this.groups = groups; + return this; + } + + public Builder groups(List> groups) { + this.groups = Optional.ofNullable(groups); + return this; + } + + /** + *

    The user's avatar image

    + */ + @JsonSetter(value = "avatar", nulls = Nulls.SKIP) + public Builder avatar(Optional avatar) { + this.avatar = avatar; + return this; + } + + public Builder avatar(String avatar) { + this.avatar = Optional.ofNullable(avatar); + return this; + } + + /** + *

    When the third party's user was created.

    + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

    When the third party's user was updated.

    + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(UserFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public User build() { + return new User( + id, + remoteId, + createdAt, + modifiedAt, + username, + displayName, + firstName, + lastName, + isBot, + groups, + avatar, + remoteCreatedAt, + remoteUpdatedAt, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/UserFieldMappings.java b/src/main/java/com/merge/api/chat/types/UserFieldMappings.java new file mode 100644 index 000000000..d9a8481ee --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/UserFieldMappings.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserFieldMappings.Builder.class) +public final class UserFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private UserFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserFieldMappings && equalTo((UserFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public UserFieldMappings build() { + return new UserFieldMappings(organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/UserGroupsItem.java b/src/main/java/com/merge/api/chat/types/UserGroupsItem.java new file mode 100644 index 000000000..69f3afeb4 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/UserGroupsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = UserGroupsItem.Deserializer.class) +public final class UserGroupsItem { + private final Object value; + + private final int type; + + private UserGroupsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserGroupsItem && equalTo((UserGroupsItem) other); + } + + private boolean equalTo(UserGroupsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static UserGroupsItem of(String value) { + return new UserGroupsItem(value, 0); + } + + public static UserGroupsItem of(Group value) { + return new UserGroupsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(UserGroupsItem.class); + } + + @java.lang.Override + public UserGroupsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Group.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/UsersListRequest.java b/src/main/java/com/merge/api/chat/types/UsersListRequest.java new file mode 100644 index 000000000..d710c59f1 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/UsersListRequest.java @@ -0,0 +1,434 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersListRequest.Builder.class) +public final class UsersListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private UsersListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListRequest && equalTo((UsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    If provided, will only return objects created after this datetime.

    + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

    If provided, will only return objects created before this datetime.

    + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

    The pagination cursor value.

    + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

    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.

    + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

    If provided, only objects synced by Merge after this date time will be returned.

    + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

    If provided, only objects synced by Merge before this date time will be returned.

    + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

    Number of results to return per page. The maximum limit is 100.

    + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

    The API provider's ID for the given object.

    + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public UsersListRequest build() { + return new UsersListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/UsersRetrieveRequest.java b/src/main/java/com/merge/api/chat/types/UsersRetrieveRequest.java new file mode 100644 index 000000000..b32cb0b2d --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/UsersRetrieveRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) +public final class UsersRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private UsersRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

    Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

    + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(String expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

    Whether to include the original data Merge fetched from the third-party to produce these models.

    + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

    Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

    + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public UsersRetrieveRequest build() { + return new UsersRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/ValidationProblemSource.java b/src/main/java/com/merge/api/chat/types/ValidationProblemSource.java new file mode 100644 index 000000000..79df6ecf6 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/ValidationProblemSource.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ValidationProblemSource.Builder.class) +public final class ValidationProblemSource { + private final String pointer; + + private final Map additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/WarningValidationProblem.java b/src/main/java/com/merge/api/chat/types/WarningValidationProblem.java new file mode 100644 index 000000000..fb53f6089 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/WarningValidationProblem.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Optional blockMergeLink; + + private final Optional rawError; + + private final Optional errorCode; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Optional blockMergeLink, + Optional rawError, + Optional errorCode, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.blockMergeLink = blockMergeLink; + this.rawError = rawError; + this.errorCode = errorCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @JsonProperty("block_merge_link") + public Optional getBlockMergeLink() { + return blockMergeLink; + } + + @JsonProperty("raw_error") + public Optional getRawError() { + return rawError; + } + + @JsonProperty("error_code") + public Optional getErrorCode() { + return errorCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType) + && blockMergeLink.equals(other.blockMergeLink) + && rawError.equals(other.rawError) + && errorCode.equals(other.errorCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.source, + this.title, + this.detail, + this.problemType, + this.blockMergeLink, + this.rawError, + this.errorCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + + _FinalStage blockMergeLink(Optional blockMergeLink); + + _FinalStage blockMergeLink(Boolean blockMergeLink); + + _FinalStage rawError(Optional rawError); + + _FinalStage rawError(String rawError); + + _FinalStage errorCode(Optional errorCode); + + _FinalStage errorCode(Integer errorCode); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional errorCode = Optional.empty(); + + private Optional rawError = Optional.empty(); + + private Optional blockMergeLink = Optional.empty(); + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + blockMergeLink(other.getBlockMergeLink()); + rawError(other.getRawError()); + errorCode(other.getErrorCode()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage errorCode(Integer errorCode) { + this.errorCode = Optional.ofNullable(errorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_code", nulls = Nulls.SKIP) + public _FinalStage errorCode(Optional errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + public _FinalStage rawError(String rawError) { + this.rawError = Optional.ofNullable(rawError); + return this; + } + + @java.lang.Override + @JsonSetter(value = "raw_error", nulls = Nulls.SKIP) + public _FinalStage rawError(Optional rawError) { + this.rawError = rawError; + return this; + } + + @java.lang.Override + public _FinalStage blockMergeLink(Boolean blockMergeLink) { + this.blockMergeLink = Optional.ofNullable(blockMergeLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "block_merge_link", nulls = Nulls.SKIP) + public _FinalStage blockMergeLink(Optional blockMergeLink) { + this.blockMergeLink = blockMergeLink; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem( + source, title, detail, problemType, blockMergeLink, rawError, errorCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/WebhookReceiver.java b/src/main/java/com/merge/api/chat/types/WebhookReceiver.java new file mode 100644 index 000000000..254d91364 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/chat/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/chat/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..3a42bb083 --- /dev/null +++ b/src/main/java/com/merge/api/chat/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.chat.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/core/ApiError.java b/src/main/java/com/merge/api/core/ApiError.java index 355ccf22a..84b080b0b 100644 --- a/src/main/java/com/merge/api/core/ApiError.java +++ b/src/main/java/com/merge/api/core/ApiError.java @@ -65,8 +65,9 @@ public Map> headers() { return this.headers; } - @java.lang.Override + @Override public String toString() { - return "ApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + body + "}"; + return "ApiError{" + "message: " + getMessage() + ", statusCode: " + statusCode + ", body: " + + ObjectMappers.stringify(body) + "}"; } } diff --git a/src/main/java/com/merge/api/core/AsyncCustomPager.java b/src/main/java/com/merge/api/core/AsyncCustomPager.java new file mode 100644 index 000000000..270606055 --- /dev/null +++ b/src/main/java/com/merge/api/core/AsyncCustomPager.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.io.IOException; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; + +/** + * Skeleton implementation for custom asynchronous bidirectional pagination. + * + * THIS CLASS MUST BE IMPLEMENTED BY THE USER. + * + * This file is added to .fernignore and will not be regenerated. + * Replace this skeleton implementation with your custom async pagination logic + * that handles your API's specific pagination structure (e.g., HATEOAS links). + * + * Example implementation for HATEOAS-style async pagination: + *
    {@code
    + * public class AsyncCustomPager implements BiDirectionalPage {
    + *     private final List items;
    + *     private final String nextUrl;
    + *     private final String previousUrl;
    + *     private final AsyncHttpClient client;
    + *
    + *     public AsyncCustomPager(Response response, AsyncHttpClient client, ...) {
    + *         this.items = response.getData();
    + *         this.nextUrl = response.getLinks().getNext();
    + *         this.previousUrl = response.getLinks().getPrevious();
    + *         // ... store other needed context
    + *     }
    + *
    + *     @Override
    + *     public boolean hasNext() {
    + *         return nextUrl != null;
    + *     }
    + *
    + *     @Override
    + *     public CompletableFuture> nextPageAsync() {
    + *         if (!hasNext()) {
    + *             CompletableFuture> future = new CompletableFuture<>();
    + *             future.completeExceptionally(new NoSuchElementException("No next page available"));
    + *             return future;
    + *         }
    + *         // Make async HTTP request to nextUrl
    + *         return client.getAsync(nextUrl)
    + *             .thenApply(response -> new AsyncCustomPager<>(response, client, ...));
    + *     }
    + *
    + *     // ... implement other methods
    + * }
    + * }
    + * + * @param The type of items in the page + */ +public class AsyncCustomPager implements BiDirectionalPage { + + /** + * Create an AsyncCustomPager from an initial response. + * + * @param initialResponse The first page response from the API + * @param client The async HTTP client to use for subsequent requests + * @param requestOptions Request options for authentication, headers, etc. + * @return A CompletableFuture containing the new AsyncCustomPager instance + */ + public static CompletableFuture> createAsync( + Object initialResponse, okhttp3.OkHttpClient client, Object requestOptions) { + throw new UnsupportedOperationException("AsyncCustomPager must be implemented. " + + "Please implement this class in core/AsyncCustomPager.java to define your async pagination logic. " + + "This file has been added to .fernignore and will not be overwritten. " + + "See the class documentation for implementation examples."); + } + + @Override + public boolean hasNext() { + throw new UnsupportedOperationException("AsyncCustomPager.hasNext() must be implemented. " + + "This method should return true if a next page is available."); + } + + @Override + public boolean hasPrevious() { + throw new UnsupportedOperationException("AsyncCustomPager.hasPrevious() must be implemented. " + + "This method should return true if a previous page is available."); + } + + /** + * Asynchronously fetch the next page. + * + * @return A CompletableFuture that completes with the next page + * @throws java.util.NoSuchElementException if no next page exists (wrapped in CompletableFuture) + */ + public CompletableFuture> nextPageAsync() { + CompletableFuture> future = new CompletableFuture<>(); + future.completeExceptionally( + new UnsupportedOperationException("AsyncCustomPager.nextPageAsync() must be implemented. " + + "This method should asynchronously fetch and return the next page of results.")); + return future; + } + + /** + * Asynchronously fetch the previous page. + * + * @return A CompletableFuture that completes with the previous page + * @throws java.util.NoSuchElementException if no previous page exists (wrapped in CompletableFuture) + */ + public CompletableFuture> previousPageAsync() { + CompletableFuture> future = new CompletableFuture<>(); + future.completeExceptionally( + new UnsupportedOperationException("AsyncCustomPager.previousPageAsync() must be implemented. " + + "This method should asynchronously fetch and return the previous page of results.")); + return future; + } + + @Override + public BiDirectionalPage nextPage() throws IOException { + throw new UnsupportedOperationException("AsyncCustomPager.nextPage() must be implemented. " + + "Consider using nextPageAsync() for async operations, or implement synchronous blocking version."); + } + + @Override + public BiDirectionalPage previousPage() throws IOException { + throw new UnsupportedOperationException( + "AsyncCustomPager.previousPage() must be implemented. " + + "Consider using previousPageAsync() for async operations, or implement synchronous blocking version."); + } + + @Override + public List getItems() { + throw new UnsupportedOperationException("AsyncCustomPager.getItems() must be implemented. " + + "This method should return the items in the current page."); + } + + @Override + public Optional getResponse() { + throw new UnsupportedOperationException("AsyncCustomPager.getResponse() must be implemented. " + + "This method should return the full response object for accessing pagination metadata."); + } + + /** + * Asynchronously iterate through all pages starting from current. + * Returns a CompletableFuture that completes with all items from all pages. + * + * @return CompletableFuture containing all items across all pages + */ + public CompletableFuture> getAllItemsAsync() { + throw new UnsupportedOperationException("AsyncCustomPager.getAllItemsAsync() must be implemented. " + + "This method should asynchronously fetch all pages and return all items."); + } + + /** + * Process each page asynchronously as it arrives. + * + * @param pageProcessor Function to process each page + * @return CompletableFuture that completes when all pages are processed + */ + public CompletableFuture forEachPageAsync( + java.util.function.Function, CompletionStage> pageProcessor) { + throw new UnsupportedOperationException("AsyncCustomPager.forEachPageAsync() must be implemented. " + + "This method should asynchronously process each page with the given function."); + } +} diff --git a/src/main/java/com/merge/api/core/BiDirectionalPage.java b/src/main/java/com/merge/api/core/BiDirectionalPage.java new file mode 100644 index 000000000..21482939b --- /dev/null +++ b/src/main/java/com/merge/api/core/BiDirectionalPage.java @@ -0,0 +1,60 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.util.List; + +/** + * Interface for pages that support bidirectional pagination (both forward and backward navigation). + * This is used for custom pagination scenarios where the API provides both next and previous page links. + * + * @param The type of items in the page + */ +public interface BiDirectionalPage { + /** + * Returns whether there is a next page available. + * + * @return true if next page exists and can be fetched + */ + boolean hasNext(); + + /** + * Returns whether there is a previous page available. + * + * @return true if previous page exists and can be fetched + */ + boolean hasPrevious(); + + /** + * Fetches and returns the next page. + * + * @return the next page + * @throws java.util.NoSuchElementException if no next page exists + * @throws java.io.IOException if the HTTP request fails + */ + BiDirectionalPage nextPage() throws java.io.IOException; + + /** + * Fetches and returns the previous page. + * + * @return the previous page + * @throws java.util.NoSuchElementException if no previous page exists + * @throws java.io.IOException if the HTTP request fails + */ + BiDirectionalPage previousPage() throws java.io.IOException; + + /** + * Returns the items in the current page. + * + * @return list of items in this page + */ + List getItems(); + + /** + * Returns the full response object for accessing pagination metadata. + * + * @return Optional containing the response, or empty if unavailable + */ + java.util.Optional getResponse(); +} diff --git a/src/main/java/com/merge/api/core/ClientOptions.java b/src/main/java/com/merge/api/core/ClientOptions.java index 430519cf1..aaa34d2e9 100644 --- a/src/main/java/com/merge/api/core/ClientOptions.java +++ b/src/main/java/com/merge/api/core/ClientOptions.java @@ -21,26 +21,30 @@ public final class ClientOptions { private final int timeout; + private final int maxRetries; + private ClientOptions( Environment environment, Map headers, Map> headerSuppliers, OkHttpClient httpClient, - int timeout) { + int timeout, + int maxRetries) { this.environment = environment; this.headers = new HashMap<>(); this.headers.putAll(headers); this.headers.putAll(new HashMap() { { - put("User-Agent", "dev.merge:merge-java-client/5.0.1"); + put("User-Agent", "dev.merge:merge-java-client/5.1.0"); put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.merge.fern:api-sdk"); - put("X-Fern-SDK-Version", "5.0.1"); + put("X-Fern-SDK-Version", "5.1.0"); } }); this.headerSuppliers = headerSuppliers; this.httpClient = httpClient; this.timeout = timeout; + this.maxRetries = maxRetries; } public Environment environment() { @@ -82,6 +86,10 @@ public OkHttpClient httpClientWithTimeout(RequestOptions requestOptions) { .build(); } + public int maxRetries() { + return this.maxRetries; + } + public static Builder builder() { return new Builder(); } @@ -165,7 +173,8 @@ public ClientOptions build() { this.httpClient = httpClientBuilder.build(); this.timeout = Optional.of(httpClient.callTimeoutMillis() / 1000); - return new ClientOptions(environment, headers, headerSuppliers, httpClient, this.timeout.get()); + return new ClientOptions( + environment, headers, headerSuppliers, httpClient, this.timeout.get(), this.maxRetries); } /** diff --git a/src/main/java/com/merge/api/core/CustomPager.java b/src/main/java/com/merge/api/core/CustomPager.java new file mode 100644 index 000000000..1a2309dce --- /dev/null +++ b/src/main/java/com/merge/api/core/CustomPager.java @@ -0,0 +1,117 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.core; + +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Optional; + +/** + * Skeleton implementation for custom bidirectional pagination. + * + * THIS CLASS MUST BE IMPLEMENTED BY THE USER. + * + * This file is added to .fernignore and will not be regenerated. + * Replace this skeleton implementation with your custom pagination logic + * that handles your API's specific pagination structure (e.g., HATEOAS links). + * + * Example implementation for HATEOAS-style pagination: + *
    {@code
    + * public class CustomPager implements BiDirectionalPage, Iterable {
    + *     private final List items;
    + *     private final String nextUrl;
    + *     private final String previousUrl;
    + *     private final OkHttpClient client;
    + *     private final TypeReference> responseType;
    + *
    + *     public CustomPager(Response response, OkHttpClient client, ...) {
    + *         this.items = response.getData();
    + *         this.nextUrl = response.getLinks().getNext();
    + *         this.previousUrl = response.getLinks().getPrevious();
    + *         // ... store other needed context
    + *     }
    + *
    + *     @Override
    + *     public boolean hasNext() {
    + *         return nextUrl != null;
    + *     }
    + *
    + *     @Override
    + *     public CustomPager nextPage() throws IOException {
    + *         if (!hasNext()) {
    + *             throw new NoSuchElementException("No next page available");
    + *         }
    + *         // Make HTTP request to nextUrl
    + *         // Parse response
    + *         // Return new CustomPager instance
    + *     }
    + *
    + *     // ... implement other methods
    + * }
    + * }
    + * + * @param The type of items in the page + */ +public class CustomPager implements BiDirectionalPage, Iterable { + + /** + * Create a CustomPager from an initial response. + * + * @param initialResponse The first page response from the API + * @param client The HTTP client to use for subsequent requests + * @param requestOptions Request options for authentication, headers, etc. + * @return A new CustomPager instance + * @throws IOException if the request fails + */ + public static CustomPager create(Object initialResponse, okhttp3.OkHttpClient client, Object requestOptions) + throws IOException { + throw new UnsupportedOperationException("CustomPager must be implemented. " + + "Please implement this class in core/CustomPager.java to define your pagination logic. " + + "This file has been added to .fernignore and will not be overwritten. " + + "See the class documentation for implementation examples."); + } + + @Override + public boolean hasNext() { + throw new UnsupportedOperationException("CustomPager.hasNext() must be implemented. " + + "This method should return true if a next page is available."); + } + + @Override + public boolean hasPrevious() { + throw new UnsupportedOperationException("CustomPager.hasPrevious() must be implemented. " + + "This method should return true if a previous page is available."); + } + + @Override + public BiDirectionalPage nextPage() throws IOException { + throw new UnsupportedOperationException("CustomPager.nextPage() must be implemented. " + + "This method should fetch and return the next page of results."); + } + + @Override + public BiDirectionalPage previousPage() throws IOException { + throw new UnsupportedOperationException("CustomPager.previousPage() must be implemented. " + + "This method should fetch and return the previous page of results."); + } + + @Override + public List getItems() { + throw new UnsupportedOperationException("CustomPager.getItems() must be implemented. " + + "This method should return the items in the current page."); + } + + @Override + public Optional getResponse() { + throw new UnsupportedOperationException("CustomPager.getResponse() must be implemented. " + + "This method should return the full response object for accessing pagination metadata."); + } + + @Override + public Iterator iterator() { + throw new UnsupportedOperationException("CustomPager.iterator() must be implemented. " + + "This method should return an iterator that traverses all items across all pages."); + } +} diff --git a/src/main/java/com/merge/api/core/NullableNonemptyFilter.java b/src/main/java/com/merge/api/core/NullableNonemptyFilter.java index 493a1abee..3267ec2cc 100644 --- a/src/main/java/com/merge/api/core/NullableNonemptyFilter.java +++ b/src/main/java/com/merge/api/core/NullableNonemptyFilter.java @@ -14,6 +14,9 @@ public boolean equals(Object o) { } private boolean isOptionalEmpty(Object o) { - return o instanceof Optional && !((Optional) o).isPresent(); + if (o instanceof Optional) { + return !((Optional) o).isPresent(); + } + return false; } } diff --git a/src/main/java/com/merge/api/core/ObjectMappers.java b/src/main/java/com/merge/api/core/ObjectMappers.java index 8b2d5fc68..1287ccb7d 100644 --- a/src/main/java/com/merge/api/core/ObjectMappers.java +++ b/src/main/java/com/merge/api/core/ObjectMappers.java @@ -4,6 +4,7 @@ package com.merge.api.core; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; @@ -33,4 +34,12 @@ public static String stringify(Object o) { return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode()); } } + + public static Object parseErrorBody(String responseBodyString) { + try { + return JSON_MAPPER.readValue(responseBodyString, Object.class); + } catch (JsonProcessingException ignored) { + return responseBodyString; + } + } } diff --git a/src/main/java/com/merge/api/core/RetryInterceptor.java b/src/main/java/com/merge/api/core/RetryInterceptor.java index fa040d5a2..ef50843a4 100644 --- a/src/main/java/com/merge/api/core/RetryInterceptor.java +++ b/src/main/java/com/merge/api/core/RetryInterceptor.java @@ -5,6 +5,9 @@ import java.io.IOException; import java.time.Duration; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; import java.util.Optional; import java.util.Random; import okhttp3.Interceptor; @@ -12,7 +15,10 @@ public class RetryInterceptor implements Interceptor { - private static final Duration ONE_SECOND = Duration.ofSeconds(1); + private static final Duration INITIAL_RETRY_DELAY = Duration.ofMillis(1000); + private static final Duration MAX_RETRY_DELAY = Duration.ofMillis(60000); + private static final double JITTER_FACTOR = 0.2; + private final ExponentialBackoff backoff; private final Random random = new Random(); @@ -32,7 +38,7 @@ public Response intercept(Chain chain) throws IOException { } private Response retryChain(Response response, Chain chain) throws IOException { - Optional nextBackoff = this.backoff.nextBackoff(); + Optional nextBackoff = this.backoff.nextBackoff(response); while (nextBackoff.isPresent()) { try { Thread.sleep(nextBackoff.get().toMillis()); @@ -42,7 +48,7 @@ private Response retryChain(Response response, Chain chain) throws IOException { response.close(); response = chain.proceed(chain.request()); if (shouldRetry(response.code())) { - nextBackoff = this.backoff.nextBackoff(); + nextBackoff = this.backoff.nextBackoff(response); } else { return response; } @@ -51,6 +57,102 @@ private Response retryChain(Response response, Chain chain) throws IOException { return response; } + /** + * Calculates the retry delay from response headers, with fallback to exponential backoff. + * Priority: Retry-After > X-RateLimit-Reset > Exponential Backoff + */ + private Duration getRetryDelayFromHeaders(Response response, int retryAttempt) { + // Check for Retry-After header first (RFC 7231), with no jitter + String retryAfter = response.header("Retry-After"); + if (retryAfter != null) { + // Parse as number of seconds... + Optional secondsDelay = tryParseLong(retryAfter) + .map(seconds -> seconds * 1000) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(Duration::ofMillis); + if (secondsDelay.isPresent()) { + return secondsDelay.get(); + } + + // ...or as an HTTP date; both are valid + Optional dateDelay = tryParseHttpDate(retryAfter) + .map(resetTime -> resetTime.toInstant().toEpochMilli() - System.currentTimeMillis()) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(Duration::ofMillis); + if (dateDelay.isPresent()) { + return dateDelay.get(); + } + } + + // Then check for industry-standard X-RateLimit-Reset header, with positive jitter + String rateLimitReset = response.header("X-RateLimit-Reset"); + if (rateLimitReset != null) { + // Assume Unix timestamp in epoch seconds + Optional rateLimitDelay = tryParseLong(rateLimitReset) + .map(resetTimeSeconds -> (resetTimeSeconds * 1000) - System.currentTimeMillis()) + .filter(delayMs -> delayMs > 0) + .map(delayMs -> Math.min(delayMs, MAX_RETRY_DELAY.toMillis())) + .map(this::addPositiveJitter) + .map(Duration::ofMillis); + if (rateLimitDelay.isPresent()) { + return rateLimitDelay.get(); + } + } + + // Fall back to exponential backoff, with symmetric jitter + long baseDelay = INITIAL_RETRY_DELAY.toMillis() * (1L << retryAttempt); // 2^retryAttempt + long cappedDelay = Math.min(baseDelay, MAX_RETRY_DELAY.toMillis()); + return Duration.ofMillis(addSymmetricJitter(cappedDelay)); + } + + /** + * Attempts to parse a string as a long, returning empty Optional on failure. + */ + private Optional tryParseLong(String value) { + if (value == null) { + return Optional.empty(); + } + try { + return Optional.of(Long.parseLong(value)); + } catch (NumberFormatException e) { + return Optional.empty(); + } + } + + /** + * Attempts to parse a string as an HTTP date (RFC 1123), returning empty Optional on failure. + */ + private Optional tryParseHttpDate(String value) { + if (value == null) { + return Optional.empty(); + } + try { + return Optional.of(ZonedDateTime.parse(value, DateTimeFormatter.RFC_1123_DATE_TIME)); + } catch (DateTimeParseException e) { + return Optional.empty(); + } + } + + /** + * Adds positive jitter (100-120% of original value) to prevent thundering herd. + * Used for X-RateLimit-Reset header delays. + */ + private long addPositiveJitter(long delayMs) { + double jitterMultiplier = 1.0 + (random.nextDouble() * JITTER_FACTOR); + return (long) (delayMs * jitterMultiplier); + } + + /** + * Adds symmetric jitter (90-110% of original value) to prevent thundering herd. + * Used for exponential backoff delays. + */ + private long addSymmetricJitter(long delayMs) { + double jitterMultiplier = 1.0 + ((random.nextDouble() - 0.5) * JITTER_FACTOR); + return (long) (delayMs * jitterMultiplier); + } + private static boolean shouldRetry(int statusCode) { return statusCode == 408 || statusCode == 429 || statusCode >= 500; } @@ -65,14 +167,14 @@ private final class ExponentialBackoff { this.maxNumRetries = maxNumRetries; } - public Optional nextBackoff() { - retryNumber += 1; - if (retryNumber > maxNumRetries) { + public Optional nextBackoff(Response response) { + if (retryNumber >= maxNumRetries) { return Optional.empty(); } - int upperBound = (int) Math.pow(2, retryNumber); - return Optional.of(ONE_SECOND.multipliedBy(random.nextInt(upperBound))); + Duration delay = getRetryDelayFromHeaders(response, retryNumber); + retryNumber += 1; + return Optional.of(delay); } } } diff --git a/src/main/java/com/merge/api/core/Stream.java b/src/main/java/com/merge/api/core/Stream.java index 219702457..cbdaf65de 100644 --- a/src/main/java/com/merge/api/core/Stream.java +++ b/src/main/java/com/merge/api/core/Stream.java @@ -174,8 +174,8 @@ private final class SSEIterator implements Iterator { private T nextItem; private boolean hasNextItem = false; private boolean endOfStream = false; - private StringBuilder buffer = new StringBuilder(); - private boolean prefixSeen = false; + private StringBuilder eventDataBuffer = new StringBuilder(); + private String currentEventType = null; private SSEIterator() { if (sseReader != null && !isStreamClosed()) { @@ -223,39 +223,69 @@ private boolean readNextMessage() { try { while (sseScanner.hasNextLine()) { - String chunk = sseScanner.nextLine(); - buffer.append(chunk).append(NEWLINE); - - int terminatorIndex; - while ((terminatorIndex = buffer.indexOf(messageTerminator)) >= 0) { - String line = buffer.substring(0, terminatorIndex + messageTerminator.length()); - buffer.delete(0, terminatorIndex + messageTerminator.length()); - - line = line.trim(); - if (line.isEmpty()) { - continue; + String line = sseScanner.nextLine(); + + if (line.trim().isEmpty()) { + if (eventDataBuffer.length() > 0) { + try { + nextItem = ObjectMappers.JSON_MAPPER.readValue(eventDataBuffer.toString(), valueType); + hasNextItem = true; + eventDataBuffer.setLength(0); + currentEventType = null; + return true; + } catch (Exception parseEx) { + System.err.println("Failed to parse SSE event: " + parseEx.getMessage()); + eventDataBuffer.setLength(0); + currentEventType = null; + continue; + } } + continue; + } - if (!prefixSeen && line.startsWith(DATA_PREFIX)) { - prefixSeen = true; - line = line.substring(DATA_PREFIX.length()).trim(); - } else if (!prefixSeen) { - continue; + if (line.startsWith(DATA_PREFIX)) { + String dataContent = line.substring(DATA_PREFIX.length()); + if (dataContent.startsWith(" ")) { + dataContent = dataContent.substring(1); } - if (streamTerminator != null && line.contains(streamTerminator)) { + if (eventDataBuffer.length() == 0 + && streamTerminator != null + && dataContent.trim().equals(streamTerminator)) { endOfStream = true; return false; } - try { - nextItem = ObjectMappers.JSON_MAPPER.readValue(line, valueType); - hasNextItem = true; - prefixSeen = false; - return true; - } catch (Exception parseEx) { - continue; + if (eventDataBuffer.length() > 0) { + eventDataBuffer.append('\n'); + } + eventDataBuffer.append(dataContent); + } else if (line.startsWith("event:")) { + String eventValue = line.length() > 6 ? line.substring(6) : ""; + if (eventValue.startsWith(" ")) { + eventValue = eventValue.substring(1); } + currentEventType = eventValue; + } else if (line.startsWith("id:")) { + // Event ID field (ignored) + } else if (line.startsWith("retry:")) { + // Retry field (ignored) + } else if (line.startsWith(":")) { + // Comment line (ignored) + } + } + + if (eventDataBuffer.length() > 0) { + try { + nextItem = ObjectMappers.JSON_MAPPER.readValue(eventDataBuffer.toString(), valueType); + hasNextItem = true; + eventDataBuffer.setLength(0); + currentEventType = null; + return true; + } catch (Exception parseEx) { + System.err.println("Failed to parse final SSE event: " + parseEx.getMessage()); + eventDataBuffer.setLength(0); + currentEventType = null; } } diff --git a/src/main/java/com/merge/api/crm/AccountTokenClient.java b/src/main/java/com/merge/api/crm/AccountTokenClient.java index 5cea85424..8dc9e066d 100644 --- a/src/main/java/com/merge/api/crm/AccountTokenClient.java +++ b/src/main/java/com/merge/api/crm/AccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.crm.types.AccountToken; +import com.merge.api.crm.types.RegenerateAccountToken; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -37,4 +38,18 @@ public AccountToken retrieve(String publicToken) { public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).body(); } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } } diff --git a/src/main/java/com/merge/api/crm/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/crm/AsyncAccountTokenClient.java index e257c7cfb..92ee74fd7 100644 --- a/src/main/java/com/merge/api/crm/AsyncAccountTokenClient.java +++ b/src/main/java/com/merge/api/crm/AsyncAccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.crm.types.AccountToken; +import com.merge.api.crm.types.RegenerateAccountToken; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -38,4 +39,18 @@ public CompletableFuture retrieve(String publicToken) { public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/merge/api/crm/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/crm/AsyncLinkTokenClient.java index e9ca67c7a..4ad1b3bf2 100644 --- a/src/main/java/com/merge/api/crm/AsyncLinkTokenClient.java +++ b/src/main/java/com/merge/api/crm/AsyncLinkTokenClient.java @@ -27,14 +27,14 @@ public AsyncRawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request) { return this.rawClient.create(request).thenApply(response -> response.body()); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAccountDetailsClient.java index 6d36ff9c6..d83722d60 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAccountDetailsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(RequestO @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/crm/AsyncRawAccountTokenClient.java index 851535bc3..675dbbc60 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAccountTokenClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAccountTokenClient.java @@ -10,6 +10,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.crm.types.AccountToken; +import com.merge.api.crm.types.RegenerateAccountToken; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -18,6 +19,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; @@ -61,18 +63,70 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("crm/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java index c51dff5e6..fd6dd47da 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -151,9 +149,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); Optional startingAfter = parsedResponse.getNext(); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) @@ -174,12 +173,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -217,12 +213,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -242,18 +236,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmAccountResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -328,17 +320,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -378,12 +368,10 @@ public CompletableFuture> partialUpdate QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -403,18 +391,16 @@ public CompletableFuture> partialUpdate @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmAccountResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -461,18 +447,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -517,18 +500,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -627,9 +607,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); AccountsRemoteFieldClassesListRequest nextRequest = AccountsRemoteFieldClassesListRequest.builder() @@ -652,12 +633,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java b/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java index beab1a28b..8472fa72e 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java @@ -21,9 +21,7 @@ import com.merge.api.crm.types.PaginatedAssociationTypeList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -142,9 +140,10 @@ public AsyncRawAssociationTypesClient(ClientOptions clientOptions) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAssociationTypeList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAssociationTypeList.class); + responseBodyString, PaginatedAssociationTypeList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesAssociationTypesListRequest nextRequest = CustomObjectClassesAssociationTypesListRequest.builder() @@ -168,12 +167,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,12 +214,10 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -243,19 +237,17 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), CrmAssociationTypeResponse.class), + responseBodyString, CrmAssociationTypeResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -333,18 +325,16 @@ public CompletableFuture> customObjectClas @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AssociationType.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AssociationType.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -376,7 +366,8 @@ public CompletableFuture> customObjectClasses .newBuilder() .addPathSegments("crm/v1/custom-object-classes") .addPathSegment(customObjectClassId) - .addPathSegments("association-types/meta/post") + .addPathSegments("association-types/meta") + .addPathSegments("post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -393,18 +384,15 @@ public CompletableFuture> customObjectClasses @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java index 08b90b43d..6586aa593 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java @@ -150,9 +150,10 @@ public AsyncRawAssociationsClient(ClientOptions clientOptions) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedAssociationList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAssociationList.class); + PaginatedAssociationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAssociationList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesCustomObjectsAssociationsListRequest nextRequest = CustomObjectClassesCustomObjectsAssociationsListRequest.builder() @@ -178,12 +179,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -275,18 +273,15 @@ public CompletableFuture> customObjectClassesC @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Association.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Association.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java index d0fc0b252..0b3167f54 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java @@ -73,19 +73,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -133,19 +130,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + responseBodyString, AsyncPassthroughRetrieveResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java index 53b38fa9f..260c0a47f 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java @@ -99,9 +99,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAuditLogEventList.class); + responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -122,12 +123,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/crm/AsyncRawAvailableActionsClient.java index 69c563c6e..64634db11 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAvailableActionsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java b/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java index d935f6c05..433cfa2d3 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java @@ -27,9 +27,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -157,9 +155,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedContactList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); Optional startingAfter = parsedResponse.getNext(); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) @@ -180,12 +179,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -223,12 +219,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -248,18 +242,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmContactResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -334,17 +326,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Contact.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -384,12 +374,10 @@ public CompletableFuture> partialUpdate QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -409,18 +397,16 @@ public CompletableFuture> partialUpdate @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmContactResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -480,11 +466,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -531,18 +515,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -587,18 +568,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -697,9 +675,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() @@ -722,12 +701,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java index 68b136500..d5e12a6bd 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java @@ -127,9 +127,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); CustomObjectClassesListRequest nextRequest = CustomObjectClassesListRequest.builder() .from(request) @@ -151,12 +152,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -225,18 +223,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObjectClass.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CustomObjectClass.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java index 2264b659a..402d11ab6 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java @@ -24,9 +24,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -148,9 +146,10 @@ public AsyncRawCustomObjectsClient(ClientOptions clientOptions) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCustomObjectList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedCustomObjectList.class); + responseBodyString, PaginatedCustomObjectList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesCustomObjectsListRequest nextRequest = CustomObjectClassesCustomObjectsListRequest.builder() @@ -173,12 +172,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -219,12 +215,10 @@ public CompletableFuture> customOb QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -244,19 +238,16 @@ public CompletableFuture> customOb @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), CrmCustomObjectResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmCustomObjectResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -337,18 +328,15 @@ public CompletableFuture> customObjectClasses @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObject.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CustomObject.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,7 +368,8 @@ public CompletableFuture> customObjectClasses .newBuilder() .addPathSegments("crm/v1/custom-object-classes") .addPathSegment(customObjectClassId) - .addPathSegments("custom-objects/meta/post") + .addPathSegments("custom-objects/meta") + .addPathSegments("post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -397,18 +386,15 @@ public CompletableFuture> customObjectClasses @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -512,9 +498,10 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedRemoteFieldClassList.class); + responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest nextRequest = CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() @@ -538,12 +525,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/crm/AsyncRawDeleteAccountClient.java index 5bb70c635..a57a3c702 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawDeleteAccountClient.java @@ -63,11 +63,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java b/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java index dff80dc76..bffef283c 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java @@ -132,9 +132,10 @@ public CompletableFuture @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEngagementTypeList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedEngagementTypeList.class); + responseBodyString, PaginatedEngagementTypeList.class); Optional startingAfter = parsedResponse.getNext(); EngagementTypesListRequest nextRequest = EngagementTypesListRequest.builder() .from(request) @@ -156,12 +157,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -233,18 +231,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementType.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EngagementType.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -343,9 +339,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); EngagementTypesRemoteFieldClassesListRequest nextRequest = EngagementTypesRemoteFieldClassesListRequest.builder() @@ -368,12 +365,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java b/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java index da565cdae..9e54f64b7 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -152,9 +150,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedEngagementList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedEngagementList.class); + PaginatedEngagementList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEngagementList.class); Optional startingAfter = parsedResponse.getNext(); EngagementsListRequest nextRequest = EngagementsListRequest.builder() .from(request) @@ -175,12 +174,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,12 +214,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -243,18 +237,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EngagementResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -329,18 +321,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Engagement.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Engagement.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,12 +369,10 @@ public CompletableFuture> partialUpdate QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -405,18 +392,16 @@ public CompletableFuture> partialUpdate @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EngagementResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -463,18 +448,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -519,18 +501,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -629,9 +608,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); EngagementsRemoteFieldClassesListRequest nextRequest = EngagementsRemoteFieldClassesListRequest.builder() @@ -654,12 +634,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java index 616e00529..d4eca5544 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.crm; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.crm.types.RemoteFieldApiResponse; import com.merge.api.crm.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -87,19 +84,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + responseBodyString, FieldMappingApiInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -137,17 +132,17 @@ public CompletableFuture> fie request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -167,19 +162,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,19 +220,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -276,25 +267,31 @@ public CompletableFuture> fie */ public CompletableFuture> fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -304,19 +301,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,19 +375,16 @@ public CompletableFuture> remoteFie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -438,19 +430,17 @@ public CompletableFuture> t @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + responseBodyString, ExternalTargetFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/crm/AsyncRawForceResyncClient.java index 9067c8aa7..0078a6f52 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawForceResyncClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawForceResyncClient.java @@ -63,19 +63,17 @@ public CompletableFuture>> syncStatusResyn @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/crm/AsyncRawGenerateKeyClient.java index 5bde260a2..68700b245 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawGenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java index 6664ce786..c0e6ecb4f 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java @@ -145,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -167,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,17 +216,15 @@ public CompletableFuture> retrieve(String id, Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java b/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java index 2a17e84bd..9e1b7a59a 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java @@ -24,9 +24,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -168,9 +166,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedLeadList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLeadList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLeadList.class); Optional startingAfter = parsedResponse.getNext(); LeadsListRequest nextRequest = LeadsListRequest.builder() .from(request) @@ -190,12 +189,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -233,12 +229,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -258,18 +252,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LeadResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LeadResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -344,17 +335,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Lead.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Lead.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -399,18 +388,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -509,9 +495,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); LeadsRemoteFieldClassesListRequest nextRequest = LeadsRemoteFieldClassesListRequest.builder() .from(request) @@ -533,12 +520,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java index 800a82365..4abcd56ed 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java @@ -34,14 +34,14 @@ public AsyncRawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create( EndUserDetailsRequest request, RequestOptions requestOptions) { @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java index 8ad5103f9..ea02041a8 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java @@ -138,9 +138,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -162,12 +163,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java b/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java index d17fdcf02..52eceba0c 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java @@ -24,9 +24,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -158,9 +156,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedNoteList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedNoteList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedNoteList.class); Optional startingAfter = parsedResponse.getNext(); NotesListRequest nextRequest = NotesListRequest.builder() .from(request) @@ -180,12 +179,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -223,12 +219,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -248,18 +242,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoteResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, NoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -334,17 +325,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Note.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Note.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -389,18 +378,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -499,9 +485,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); NotesRemoteFieldClassesListRequest nextRequest = NotesRemoteFieldClassesListRequest.builder() .from(request) @@ -523,12 +510,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java b/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java index 5b02267ac..d95ea7d25 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -175,9 +173,10 @@ public CompletableFuture>> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedOpportunityList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedOpportunityList.class); + PaginatedOpportunityList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOpportunityList.class); Optional startingAfter = parsedResponse.getNext(); OpportunitiesListRequest nextRequest = OpportunitiesListRequest.builder() .from(request) @@ -198,12 +197,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -241,12 +237,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -266,18 +260,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, OpportunityResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -361,18 +353,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Opportunity.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Opportunity.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -412,12 +401,10 @@ public CompletableFuture> partialUpdat QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -437,18 +424,16 @@ public CompletableFuture> partialUpdat @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, OpportunityResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -495,18 +480,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -551,18 +533,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -661,9 +640,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); OpportunitiesRemoteFieldClassesListRequest nextRequest = OpportunitiesRemoteFieldClassesListRequest.builder() @@ -686,12 +666,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/crm/AsyncRawPassthroughClient.java index ffcfc0144..ad67cbe20 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawPassthroughClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawPassthroughClient.java @@ -72,18 +72,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/crm/AsyncRawRegenerateKeyClient.java index f35780ff8..15c6d977e 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawRegenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawScopesClient.java b/src/main/java/com/merge/api/crm/AsyncRawScopesClient.java index e87abf042..98e442b03 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawScopesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawScopesClient.java @@ -64,18 +64,16 @@ public CompletableFuture> defaultScope @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -121,18 +119,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -187,18 +183,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java b/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java index f1e513823..fc842aa89 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java @@ -131,9 +131,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedStageList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedStageList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedStageList.class); Optional startingAfter = parsedResponse.getNext(); StagesListRequest nextRequest = StagesListRequest.builder() .from(request) @@ -153,12 +154,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -229,17 +227,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Stage.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Stage.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -338,9 +334,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); StagesRemoteFieldClassesListRequest nextRequest = StagesRemoteFieldClassesListRequest.builder() .from(request) @@ -362,12 +359,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java index 4340dcce5..86f6f61e3 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java @@ -10,10 +10,16 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.PaginatedSyncStatusList; +import com.merge.api.crm.types.SyncStatus; import com.merge.api.crm.types.SyncStatusListRequest; import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; import okhttp3.Call; import okhttp3.Callback; import okhttp3.Headers; @@ -34,21 +40,21 @@ public AsyncRawSyncStatusClient(ClientOptions clientOptions) { /** * 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. */ - public CompletableFuture> list() { + public CompletableFuture>> list() { return list(SyncStatusListRequest.builder().build()); } /** * 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. */ - public CompletableFuture> list(SyncStatusListRequest request) { + public CompletableFuture>> list(SyncStatusListRequest request) { return list(request, null); } /** * 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. */ - public CompletableFuture> list( + public CompletableFuture>> list( SyncStatusListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -71,24 +77,38 @@ public CompletableFuture> list( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture>> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedSyncStatusList.class), + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java b/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java index 10eb4a530..c9d1b249d 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.TasksRetrieveRequest; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -143,9 +141,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTaskList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaskList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaskList.class); Optional startingAfter = parsedResponse.getNext(); TasksListRequest nextRequest = TasksListRequest.builder() .from(request) @@ -165,12 +164,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -208,12 +204,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -233,18 +227,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TaskResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -319,17 +310,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Task.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Task.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -369,12 +358,10 @@ public CompletableFuture> partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -394,18 +381,15 @@ public CompletableFuture> partialUpdate( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TaskResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -452,18 +436,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -508,18 +489,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -618,9 +596,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); TasksRemoteFieldClassesListRequest nextRequest = TasksRemoteFieldClassesListRequest.builder() .from(request) @@ -642,12 +621,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java b/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java index 4f5137d1a..c4852aab6 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java @@ -139,9 +139,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -161,12 +162,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -237,17 +235,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -307,11 +303,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -410,9 +404,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); UsersRemoteFieldClassesListRequest nextRequest = UsersRemoteFieldClassesListRequest.builder() .from(request) @@ -434,12 +429,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/crm/AsyncRawWebhookReceiversClient.java index 3b9b2a473..975b57f28 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawWebhookReceiversClient.java @@ -65,19 +65,17 @@ public CompletableFuture>> list(Reque @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -131,18 +129,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/crm/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/crm/AsyncSyncStatusClient.java index 869856a5f..4be16d043 100644 --- a/src/main/java/com/merge/api/crm/AsyncSyncStatusClient.java +++ b/src/main/java/com/merge/api/crm/AsyncSyncStatusClient.java @@ -5,7 +5,8 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; -import com.merge.api.crm.types.PaginatedSyncStatusList; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.SyncStatus; import com.merge.api.crm.types.SyncStatusListRequest; import java.util.concurrent.CompletableFuture; @@ -29,21 +30,21 @@ public AsyncRawSyncStatusClient withRawResponse() { /** * 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. */ - public CompletableFuture list() { + public CompletableFuture> list() { return this.rawClient.list().thenApply(response -> response.body()); } /** * 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. */ - public CompletableFuture list(SyncStatusListRequest request) { + public CompletableFuture> list(SyncStatusListRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } /** * 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. */ - public CompletableFuture list( + public CompletableFuture> list( SyncStatusListRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/crm/LinkTokenClient.java b/src/main/java/com/merge/api/crm/LinkTokenClient.java index d8eb036aa..601042846 100644 --- a/src/main/java/com/merge/api/crm/LinkTokenClient.java +++ b/src/main/java/com/merge/api/crm/LinkTokenClient.java @@ -26,14 +26,14 @@ public RawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request) { return this.rawClient.create(request).body(); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); diff --git a/src/main/java/com/merge/api/crm/RawAccountDetailsClient.java b/src/main/java/com/merge/api/crm/RawAccountDetailsClient.java index 81d908b70..16203335a 100644 --- a/src/main/java/com/merge/api/crm/RawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/crm/RawAccountDetailsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOptio } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawAccountTokenClient.java b/src/main/java/com/merge/api/crm/RawAccountTokenClient.java index efd6d7f8f..bd1ce1353 100644 --- a/src/main/java/com/merge/api/crm/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/crm/RawAccountTokenClient.java @@ -10,11 +10,13 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.crm.types.AccountToken; +import com.merge.api.crm.types.RegenerateAccountToken; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; @@ -53,16 +55,53 @@ public MergeApiHttpResponse retrieve(String publicToken, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("crm/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawAccountsClient.java b/src/main/java/com/merge/api/crm/RawAccountsClient.java index 8518571ac..f87128835 100644 --- a/src/main/java/com/merge/api/crm/RawAccountsClient.java +++ b/src/main/java/com/merge/api/crm/RawAccountsClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -143,9 +141,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); Optional startingAfter = parsedResponse.getNext(); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) @@ -158,12 +157,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -192,12 +187,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -214,16 +207,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmAccountResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -286,16 +276,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -325,12 +312,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -347,16 +332,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAccountResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmAccountResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -390,16 +372,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -432,16 +411,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -527,9 +503,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); AccountsRemoteFieldClassesListRequest nextRequest = AccountsRemoteFieldClassesListRequest.builder() .from(request) @@ -543,12 +520,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java b/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java index 4ad0b8875..6ff7637ba 100644 --- a/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java +++ b/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java @@ -21,9 +21,7 @@ import com.merge.api.crm.types.PaginatedAssociationTypeList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -132,9 +130,10 @@ public MergeApiHttpResponse> customObjectCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAssociationTypeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAssociationTypeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAssociationTypeList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesAssociationTypesListRequest nextRequest = CustomObjectClassesAssociationTypesListRequest.builder() @@ -152,12 +151,8 @@ public MergeApiHttpResponse> customObjectCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -189,12 +184,10 @@ public MergeApiHttpResponse customObjectClassesAssoc QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -211,17 +204,14 @@ public MergeApiHttpResponse customObjectClassesAssoc } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmAssociationTypeResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmAssociationTypeResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -287,16 +277,13 @@ public MergeApiHttpResponse customObjectClassesAssociationTypes } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AssociationType.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AssociationType.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -319,7 +306,8 @@ public MergeApiHttpResponse customObjectClassesAssociationTypesMet .newBuilder() .addPathSegments("crm/v1/custom-object-classes") .addPathSegment(customObjectClassId) - .addPathSegments("association-types/meta/post") + .addPathSegments("association-types/meta") + .addPathSegments("post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -333,16 +321,13 @@ public MergeApiHttpResponse customObjectClassesAssociationTypesMet } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawAssociationsClient.java b/src/main/java/com/merge/api/crm/RawAssociationsClient.java index 5a481d89c..8f01962f6 100644 --- a/src/main/java/com/merge/api/crm/RawAssociationsClient.java +++ b/src/main/java/com/merge/api/crm/RawAssociationsClient.java @@ -140,9 +140,10 @@ public MergeApiHttpResponse> customObjectClasses } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAssociationList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAssociationList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAssociationList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesCustomObjectsAssociationsListRequest nextRequest = CustomObjectClassesCustomObjectsAssociationsListRequest.builder() @@ -160,12 +161,8 @@ public MergeApiHttpResponse> customObjectClasses .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -245,16 +242,13 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsAssocia } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Association.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Association.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java index d3b7a0b72..e1800d78b 100644 --- a/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java @@ -66,17 +66,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -111,18 +108,14 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawAuditTrailClient.java b/src/main/java/com/merge/api/crm/RawAuditTrailClient.java index 326d3aebb..10a5067a3 100644 --- a/src/main/java/com/merge/api/crm/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/crm/RawAuditTrailClient.java @@ -90,9 +90,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -106,12 +107,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawAvailableActionsClient.java b/src/main/java/com/merge/api/crm/RawAvailableActionsClient.java index ca7d3cee0..a7a39ec8c 100644 --- a/src/main/java/com/merge/api/crm/RawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/crm/RawAvailableActionsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawContactsClient.java b/src/main/java/com/merge/api/crm/RawContactsClient.java index f8583b71f..4fb73dad1 100644 --- a/src/main/java/com/merge/api/crm/RawContactsClient.java +++ b/src/main/java/com/merge/api/crm/RawContactsClient.java @@ -27,9 +27,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -149,9 +147,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedContactList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); Optional startingAfter = parsedResponse.getNext(); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) @@ -164,12 +163,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,12 +193,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -220,16 +213,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmContactResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -292,16 +282,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Contact.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -331,12 +318,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -353,16 +338,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmContactResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmContactResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -408,11 +390,8 @@ public MergeApiHttpResponse ignoreCreate( return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -446,16 +425,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -488,16 +464,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -583,9 +556,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() .from(request) @@ -599,12 +573,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java b/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java index db7d844f2..3fbc56a99 100644 --- a/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java +++ b/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java @@ -117,9 +117,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedCustomObjectClassList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedCustomObjectClassList.class); + PaginatedCustomObjectClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCustomObjectClassList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesListRequest nextRequest = CustomObjectClassesListRequest.builder() .from(request) @@ -133,12 +134,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -194,16 +191,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObjectClass.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CustomObjectClass.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java b/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java index b43534cb2..6e3e3d466 100644 --- a/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java +++ b/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java @@ -24,9 +24,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -138,9 +136,10 @@ public MergeApiHttpResponse> customObjectClasse } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCustomObjectList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCustomObjectList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCustomObjectList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesCustomObjectsListRequest nextRequest = CustomObjectClassesCustomObjectsListRequest.builder() @@ -158,12 +157,8 @@ public MergeApiHttpResponse> customObjectClasse .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -195,12 +190,10 @@ public MergeApiHttpResponse customObjectClassesCustomOb QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -217,17 +210,14 @@ public MergeApiHttpResponse customObjectClassesCustomOb } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CrmCustomObjectResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CrmCustomObjectResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -296,16 +286,13 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsRetrie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CustomObject.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CustomObject.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -328,7 +315,8 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPo .newBuilder() .addPathSegments("crm/v1/custom-object-classes") .addPathSegment(customObjectClassId) - .addPathSegments("custom-objects/meta/post") + .addPathSegments("custom-objects/meta") + .addPathSegments("post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -342,16 +330,13 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPo } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -442,9 +427,10 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPo } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest nextRequest = CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() @@ -462,12 +448,8 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPo .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawDeleteAccountClient.java b/src/main/java/com/merge/api/crm/RawDeleteAccountClient.java index 9ae521a37..d07da4294 100644 --- a/src/main/java/com/merge/api/crm/RawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/crm/RawDeleteAccountClient.java @@ -55,11 +55,8 @@ public MergeApiHttpResponse delete(RequestOptions requestOptions) { return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java b/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java index e127644cc..5283b266b 100644 --- a/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java +++ b/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java @@ -123,9 +123,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEngagementTypeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEngagementTypeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEngagementTypeList.class); Optional startingAfter = parsedResponse.getNext(); EngagementTypesListRequest nextRequest = EngagementTypesListRequest.builder() .from(request) @@ -139,12 +140,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -203,16 +200,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementType.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EngagementType.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -298,9 +292,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); EngagementTypesRemoteFieldClassesListRequest nextRequest = EngagementTypesRemoteFieldClassesListRequest.builder() @@ -315,12 +310,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawEngagementsClient.java b/src/main/java/com/merge/api/crm/RawEngagementsClient.java index 40b6e4a90..4d3b34528 100644 --- a/src/main/java/com/merge/api/crm/RawEngagementsClient.java +++ b/src/main/java/com/merge/api/crm/RawEngagementsClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -143,9 +141,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEngagementList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEngagementList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEngagementList.class); Optional startingAfter = parsedResponse.getNext(); EngagementsListRequest nextRequest = EngagementsListRequest.builder() .from(request) @@ -159,12 +158,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -193,12 +188,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -215,16 +208,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EngagementResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -287,16 +277,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Engagement.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Engagement.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -326,12 +313,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -348,16 +333,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EngagementResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EngagementResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -391,16 +373,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -433,16 +412,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -528,9 +504,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); EngagementsRemoteFieldClassesListRequest nextRequest = EngagementsRemoteFieldClassesListRequest.builder() @@ -545,12 +522,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawFieldMappingClient.java b/src/main/java/com/merge/api/crm/RawFieldMappingClient.java index ee9a91ba4..2329d1782 100644 --- a/src/main/java/com/merge/api/crm/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/crm/RawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.crm; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.crm.types.RemoteFieldApiResponse; import com.merge.api.crm.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -80,18 +77,14 @@ public MergeApiHttpResponse fieldMappingsRetrie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -119,17 +112,17 @@ public MergeApiHttpResponse fieldMappingsCreate( request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -146,17 +139,14 @@ public MergeApiHttpResponse fieldMappingsCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,17 +181,14 @@ public MergeApiHttpResponse fieldMappingsDestroy( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -228,42 +215,45 @@ public MergeApiHttpResponse fieldMappingsPartialUp */ public MergeApiHttpResponse fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -314,17 +304,14 @@ public MergeApiHttpResponse remoteFieldsRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -357,18 +344,14 @@ public MergeApiHttpResponse targetFieldsRetrieve } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawForceResyncClient.java b/src/main/java/com/merge/api/crm/RawForceResyncClient.java index 3d17a10af..2d5af8487 100644 --- a/src/main/java/com/merge/api/crm/RawForceResyncClient.java +++ b/src/main/java/com/merge/api/crm/RawForceResyncClient.java @@ -55,18 +55,15 @@ public MergeApiHttpResponse> syncStatusResyncCreate(RequestOpti } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawGenerateKeyClient.java b/src/main/java/com/merge/api/crm/RawGenerateKeyClient.java index 1855807ce..970631321 100644 --- a/src/main/java/com/merge/api/crm/RawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/crm/RawGenerateKeyClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawIssuesClient.java b/src/main/java/com/merge/api/crm/RawIssuesClient.java index 822473fd5..6638da7b3 100644 --- a/src/main/java/com/merge/api/crm/RawIssuesClient.java +++ b/src/main/java/com/merge/api/crm/RawIssuesClient.java @@ -137,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -152,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,16 +188,13 @@ public MergeApiHttpResponse retrieve(String id, RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawLeadsClient.java b/src/main/java/com/merge/api/crm/RawLeadsClient.java index 37a53a460..2a1d05dc5 100644 --- a/src/main/java/com/merge/api/crm/RawLeadsClient.java +++ b/src/main/java/com/merge/api/crm/RawLeadsClient.java @@ -24,9 +24,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -160,9 +158,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedLeadList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLeadList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLeadList.class); Optional startingAfter = parsedResponse.getNext(); LeadsListRequest nextRequest = LeadsListRequest.builder() .from(request) @@ -175,12 +174,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -208,12 +203,10 @@ public MergeApiHttpResponse create(LeadEndpointRequest request, Re QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -230,16 +223,13 @@ public MergeApiHttpResponse create(LeadEndpointRequest request, Re } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LeadResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LeadResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -301,16 +291,13 @@ public MergeApiHttpResponse retrieve(String id, LeadsRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Lead.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Lead.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -343,16 +330,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -438,9 +422,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); LeadsRemoteFieldClassesListRequest nextRequest = LeadsRemoteFieldClassesListRequest.builder() .from(request) @@ -454,12 +439,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawLinkTokenClient.java b/src/main/java/com/merge/api/crm/RawLinkTokenClient.java index 4bf0eeedd..bd1f36c0b 100644 --- a/src/main/java/com/merge/api/crm/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/crm/RawLinkTokenClient.java @@ -30,14 +30,14 @@ public RawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(EndUserDetailsRequest request, Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java index 8896a07d7..6dded56bc 100644 --- a/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java @@ -128,9 +128,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); Optional startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -145,12 +146,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawNotesClient.java b/src/main/java/com/merge/api/crm/RawNotesClient.java index bc3f772e8..d3521e3a7 100644 --- a/src/main/java/com/merge/api/crm/RawNotesClient.java +++ b/src/main/java/com/merge/api/crm/RawNotesClient.java @@ -24,9 +24,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -150,9 +148,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedNoteList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedNoteList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedNoteList.class); Optional startingAfter = parsedResponse.getNext(); NotesListRequest nextRequest = NotesListRequest.builder() .from(request) @@ -165,12 +164,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,12 +193,10 @@ public MergeApiHttpResponse create(NoteEndpointRequest request, Re QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -220,16 +213,13 @@ public MergeApiHttpResponse create(NoteEndpointRequest request, Re } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), NoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, NoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -291,16 +281,13 @@ public MergeApiHttpResponse retrieve(String id, NotesRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Note.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Note.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -333,16 +320,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -428,9 +412,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); NotesRemoteFieldClassesListRequest nextRequest = NotesRemoteFieldClassesListRequest.builder() .from(request) @@ -444,12 +429,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java b/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java index fabefdb7b..66e877eab 100644 --- a/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java +++ b/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.RemoteFieldClass; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -166,9 +164,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedOpportunityList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedOpportunityList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOpportunityList.class); Optional startingAfter = parsedResponse.getNext(); OpportunitiesListRequest nextRequest = OpportunitiesListRequest.builder() .from(request) @@ -182,12 +181,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -216,12 +211,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -238,17 +231,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, OpportunityResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -319,16 +308,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Opportunity.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Opportunity.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -359,12 +345,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -381,17 +365,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), OpportunityResponse.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, OpportunityResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -425,16 +405,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -467,16 +444,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -562,9 +536,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); OpportunitiesRemoteFieldClassesListRequest nextRequest = OpportunitiesRemoteFieldClassesListRequest.builder() @@ -579,12 +554,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawPassthroughClient.java b/src/main/java/com/merge/api/crm/RawPassthroughClient.java index 7400a4b84..8f7517836 100644 --- a/src/main/java/com/merge/api/crm/RawPassthroughClient.java +++ b/src/main/java/com/merge/api/crm/RawPassthroughClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(DataPassthroughRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/crm/RawRegenerateKeyClient.java index 415e291c4..170acc928 100644 --- a/src/main/java/com/merge/api/crm/RawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/crm/RawRegenerateKeyClient.java @@ -65,16 +65,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawScopesClient.java b/src/main/java/com/merge/api/crm/RawScopesClient.java index 6fb028620..a927e0fa0 100644 --- a/src/main/java/com/merge/api/crm/RawScopesClient.java +++ b/src/main/java/com/merge/api/crm/RawScopesClient.java @@ -56,17 +56,13 @@ public MergeApiHttpResponse defaultScopesRetrieve(RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -99,17 +95,13 @@ public MergeApiHttpResponse linkedAccountScopesRetrieve(Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -152,17 +144,13 @@ public MergeApiHttpResponse linkedAccountScopesCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawStagesClient.java b/src/main/java/com/merge/api/crm/RawStagesClient.java index 559619059..484788800 100644 --- a/src/main/java/com/merge/api/crm/RawStagesClient.java +++ b/src/main/java/com/merge/api/crm/RawStagesClient.java @@ -123,9 +123,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedStageList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedStageList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedStageList.class); Optional startingAfter = parsedResponse.getNext(); StagesListRequest nextRequest = StagesListRequest.builder() .from(request) @@ -138,12 +139,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -202,16 +199,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Stage.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Stage.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -297,9 +291,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); StagesRemoteFieldClassesListRequest nextRequest = StagesRemoteFieldClassesListRequest.builder() .from(request) @@ -313,12 +308,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawSyncStatusClient.java b/src/main/java/com/merge/api/crm/RawSyncStatusClient.java index 47e8ab767..7addc7a91 100644 --- a/src/main/java/com/merge/api/crm/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/crm/RawSyncStatusClient.java @@ -10,9 +10,14 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.PaginatedSyncStatusList; +import com.merge.api.crm.types.SyncStatus; import com.merge.api.crm.types.SyncStatusListRequest; import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -30,21 +35,21 @@ public RawSyncStatusClient(ClientOptions clientOptions) { /** * 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. */ - public MergeApiHttpResponse list() { + public MergeApiHttpResponse> list() { return list(SyncStatusListRequest.builder().build()); } /** * 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. */ - public MergeApiHttpResponse list(SyncStatusListRequest request) { + public MergeApiHttpResponse> list(SyncStatusListRequest request) { return list(request, null); } /** * 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. */ - public MergeApiHttpResponse list( + public MergeApiHttpResponse> list( SyncStatusListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -69,17 +74,25 @@ public MergeApiHttpResponse list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class), + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawTasksClient.java b/src/main/java/com/merge/api/crm/RawTasksClient.java index 26e683c50..ce64ba2d3 100644 --- a/src/main/java/com/merge/api/crm/RawTasksClient.java +++ b/src/main/java/com/merge/api/crm/RawTasksClient.java @@ -25,9 +25,7 @@ import com.merge.api.crm.types.TasksRetrieveRequest; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -135,9 +133,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTaskList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTaskList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaskList.class); Optional startingAfter = parsedResponse.getNext(); TasksListRequest nextRequest = TasksListRequest.builder() .from(request) @@ -150,12 +149,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -183,12 +178,10 @@ public MergeApiHttpResponse create(TaskEndpointRequest request, Re QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -205,16 +198,13 @@ public MergeApiHttpResponse create(TaskEndpointRequest request, Re } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TaskResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -276,16 +266,13 @@ public MergeApiHttpResponse retrieve(String id, TasksRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Task.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Task.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -315,12 +302,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -337,16 +322,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TaskResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TaskResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -380,16 +362,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -422,16 +401,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -517,9 +493,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); TasksRemoteFieldClassesListRequest nextRequest = TasksRemoteFieldClassesListRequest.builder() .from(request) @@ -533,12 +510,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawUsersClient.java b/src/main/java/com/merge/api/crm/RawUsersClient.java index 0c0162460..24764f714 100644 --- a/src/main/java/com/merge/api/crm/RawUsersClient.java +++ b/src/main/java/com/merge/api/crm/RawUsersClient.java @@ -131,9 +131,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -146,12 +147,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -209,16 +206,13 @@ public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -264,11 +258,8 @@ public MergeApiHttpResponse ignoreCreate( return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -354,9 +345,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); UsersRemoteFieldClassesListRequest nextRequest = UsersRemoteFieldClassesListRequest.builder() .from(request) @@ -370,12 +362,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/crm/RawWebhookReceiversClient.java index a61971575..2862c1127 100644 --- a/src/main/java/com/merge/api/crm/RawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/crm/RawWebhookReceiversClient.java @@ -58,18 +58,15 @@ public MergeApiHttpResponse> list(RequestOptions requestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -110,16 +107,13 @@ public MergeApiHttpResponse create(WebhookReceiverRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/crm/SyncStatusClient.java b/src/main/java/com/merge/api/crm/SyncStatusClient.java index 583ea581a..13b12e5d3 100644 --- a/src/main/java/com/merge/api/crm/SyncStatusClient.java +++ b/src/main/java/com/merge/api/crm/SyncStatusClient.java @@ -5,7 +5,8 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; -import com.merge.api.crm.types.PaginatedSyncStatusList; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.crm.types.SyncStatus; import com.merge.api.crm.types.SyncStatusListRequest; public class SyncStatusClient { @@ -28,21 +29,21 @@ public RawSyncStatusClient withRawResponse() { /** * 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. */ - public PaginatedSyncStatusList list() { + public SyncPagingIterable list() { return this.rawClient.list().body(); } /** * 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. */ - public PaginatedSyncStatusList list(SyncStatusListRequest request) { + public SyncPagingIterable list(SyncStatusListRequest request) { return this.rawClient.list(request).body(); } /** * 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. */ - public PaginatedSyncStatusList list(SyncStatusListRequest request, RequestOptions requestOptions) { + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); } } diff --git a/src/main/java/com/merge/api/crm/types/AccountDetails.java b/src/main/java/com/merge/api/crm/types/AccountDetails.java index 8c880b323..9e3f7bbb8 100644 --- a/src/main/java/com/merge/api/crm/types/AccountDetails.java +++ b/src/main/java/com/merge/api/crm/types/AccountDetails.java @@ -45,6 +45,10 @@ public final class AccountDetails { private final Optional completedAt; + private final Optional instanceId; + + private final Optional instanceDisplayValue; + private final Map additionalProperties; private AccountDetails( @@ -60,6 +64,8 @@ private AccountDetails( Optional isDuplicate, Optional accountType, Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, Map additionalProperties) { this.id = id; this.integration = integration; @@ -73,6 +79,8 @@ private AccountDetails( this.isDuplicate = isDuplicate; this.accountType = accountType; this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; this.additionalProperties = additionalProperties; } @@ -142,6 +150,16 @@ public Optional getCompletedAt() { return completedAt; } + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -165,7 +183,9 @@ private boolean equalTo(AccountDetails other) { && webhookListenerUrl.equals(other.webhookListenerUrl) && isDuplicate.equals(other.isDuplicate) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); } @java.lang.Override @@ -182,7 +202,9 @@ public int hashCode() { this.webhookListenerUrl, this.isDuplicate, this.accountType, - this.completedAt); + this.completedAt, + this.instanceId, + this.instanceDisplayValue); } @java.lang.Override @@ -220,6 +242,10 @@ public static final class Builder { private Optional completedAt = Optional.empty(); + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -238,6 +264,8 @@ public Builder from(AccountDetails other) { isDuplicate(other.getIsDuplicate()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); return this; } @@ -379,6 +407,28 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + public AccountDetails build() { return new AccountDetails( id, @@ -393,6 +443,8 @@ public AccountDetails build() { isDuplicate, accountType, completedAt, + instanceId, + instanceDisplayValue, additionalProperties); } } diff --git a/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java index 96a91310d..6d9519c74 100644 --- a/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -48,6 +49,8 @@ public final class AccountDetailsAndActions { private final OffsetDateTime completedAt; + private final Optional> integrationSpecificFields; + private final Map additionalProperties; private AccountDetailsAndActions( @@ -64,6 +67,7 @@ private AccountDetailsAndActions( Optional integration, String accountType, OffsetDateTime completedAt, + Optional> integrationSpecificFields, Map additionalProperties) { this.id = id; this.category = category; @@ -78,6 +82,7 @@ private AccountDetailsAndActions( this.integration = integration; this.accountType = accountType; this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; this.additionalProperties = additionalProperties; } @@ -152,6 +157,11 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -176,7 +186,8 @@ private boolean equalTo(AccountDetailsAndActions other) { && isDuplicate.equals(other.isDuplicate) && integration.equals(other.integration) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); } @java.lang.Override @@ -194,7 +205,8 @@ public int hashCode() { this.isDuplicate, this.integration, this.accountType, - this.completedAt); + this.completedAt, + this.integrationSpecificFields); } @java.lang.Override @@ -268,6 +280,10 @@ public interface _FinalStage { _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -294,6 +310,8 @@ public static final class Builder private OffsetDateTime completedAt; + private Optional> integrationSpecificFields = Optional.empty(); + private Optional integration = Optional.empty(); private Optional isDuplicate = Optional.empty(); @@ -326,6 +344,7 @@ public Builder from(AccountDetailsAndActions other) { integration(other.getIntegration()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); return this; } @@ -378,6 +397,19 @@ public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { return this; } + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + @java.lang.Override public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { this.integration = Optional.ofNullable(integration); @@ -486,6 +518,7 @@ public AccountDetailsAndActions build() { integration, accountType, completedAt, + integrationSpecificFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/crm/types/AccountsListRequest.java b/src/main/java/com/merge/api/crm/types/AccountsListRequest.java index b302164a4..bbe061bce 100644 --- a/src/main/java/com/merge/api/crm/types/AccountsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/AccountsListRequest.java @@ -183,7 +183,7 @@ public Optional getOwnerId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -481,7 +481,7 @@ public Builder ownerId(String ownerId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java index daade4518..e65d3a750 100644 --- a/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/AuditLogEvent.java b/src/main/java/com/merge/api/crm/types/AuditLogEvent.java index 7792d735f..17670d2f2 100644 --- a/src/main/java/com/merge/api/crm/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/crm/types/AuditLogEvent.java @@ -91,6 +91,7 @@ public Optional getUserEmail() { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ @JsonProperty("role") @@ -220,6 +221,7 @@ public interface RoleStage { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ IpAddressStage role(@NotNull AuditLogEventRole role); @@ -359,6 +361,7 @@ public Builder from(AuditLogEvent other) { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * *

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    *
      @@ -368,6 +371,7 @@ public Builder from(AuditLogEvent other) { *
    • API - API
    • *
    • SYSTEM - SYSTEM
    • *
    • MERGE_TEAM - MERGE_TEAM
    • + *
    • SUPPORT - SUPPORT
    • *
    * @return Reference to {@code this} so that method calls can be chained together. */ diff --git a/src/main/java/com/merge/api/crm/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/crm/types/AuditTrailListRequest.java index b7f5b1700..e81486a11 100644 --- a/src/main/java/com/merge/api/crm/types/AuditTrailListRequest.java +++ b/src/main/java/com/merge/api/crm/types/AuditTrailListRequest.java @@ -76,7 +76,7 @@ public Optional getEventType() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -205,7 +205,7 @@ public Builder eventType(String eventType) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/ContactsListRequest.java b/src/main/java/com/merge/api/crm/types/ContactsListRequest.java index 9e4d37005..c05730d56 100644 --- a/src/main/java/com/merge/api/crm/types/ContactsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/ContactsListRequest.java @@ -187,7 +187,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -498,7 +498,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java index e454db10c..c3885f048 100644 --- a/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/crm/types/CreateFieldMappingRequest.java index 09b623a11..636c35e8b 100644 --- a/src/main/java/com/merge/api/crm/types/CreateFieldMappingRequest.java +++ b/src/main/java/com/merge/api/crm/types/CreateFieldMappingRequest.java @@ -26,6 +26,8 @@ public final class CreateFieldMappingRequest { private final Optional excludeRemoteFieldMetadata; + private final Optional remoteDataIterationCount; + private final String targetFieldName; private final String targetFieldDescription; @@ -38,24 +40,30 @@ public final class CreateFieldMappingRequest { private final String commonModelName; + private final Optional jmesPath; + private final Map additionalProperties; private CreateFieldMappingRequest( Optional excludeRemoteFieldMetadata, + Optional remoteDataIterationCount, String targetFieldName, String targetFieldDescription, List remoteFieldTraversalPath, String remoteMethod, String remoteUrlPath, String commonModelName, + Optional jmesPath, Map additionalProperties) { this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.remoteDataIterationCount = remoteDataIterationCount; this.targetFieldName = targetFieldName; this.targetFieldDescription = targetFieldDescription; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; this.commonModelName = commonModelName; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -67,6 +75,14 @@ public Optional getExcludeRemoteFieldMetadata() { return excludeRemoteFieldMetadata; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The name of the target field you want this remote field to map to. */ @@ -115,6 +131,14 @@ public String getCommonModelName() { return commonModelName; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -128,24 +152,28 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateFieldMappingRequest other) { return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && remoteDataIterationCount.equals(other.remoteDataIterationCount) && targetFieldName.equals(other.targetFieldName) && targetFieldDescription.equals(other.targetFieldDescription) && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { return Objects.hash( this.excludeRemoteFieldMetadata, + this.remoteDataIterationCount, this.targetFieldName, this.targetFieldDescription, this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath, - this.commonModelName); + this.commonModelName, + this.jmesPath); } @java.lang.Override @@ -204,6 +232,13 @@ public interface _FinalStage { _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount); + + _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount); + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    */ @@ -212,6 +247,13 @@ public interface _FinalStage { _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -232,8 +274,12 @@ public static final class Builder private String commonModelName; + private Optional jmesPath = Optional.empty(); + private List remoteFieldTraversalPath = new ArrayList<>(); + private Optional remoteDataIterationCount = Optional.empty(); + private Optional excludeRemoteFieldMetadata = Optional.empty(); @JsonAnySetter @@ -244,12 +290,14 @@ private Builder() {} @java.lang.Override public Builder from(CreateFieldMappingRequest other) { excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + remoteDataIterationCount(other.getRemoteDataIterationCount()); targetFieldName(other.getTargetFieldName()); targetFieldDescription(other.getTargetFieldDescription()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); return this; } @@ -313,6 +361,26 @@ public _FinalStage commonModelName(@NotNull String commonModelName) { return this; } + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -348,6 +416,26 @@ public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalP return this; } + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @java.lang.Override + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + /** *

    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.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -372,12 +460,14 @@ public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFie public CreateFieldMappingRequest build() { return new CreateFieldMappingRequest( excludeRemoteFieldMetadata, + remoteDataIterationCount, targetFieldName, targetFieldDescription, remoteFieldTraversalPath, remoteMethod, remoteUrlPath, commonModelName, + jmesPath, additionalProperties); } } diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java index 64c0c06d5..b1728293f 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java @@ -147,7 +147,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -389,7 +389,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java index 612155551..ffeb00499 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -420,7 +420,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java index e2d594db4..2fac17a1c 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java @@ -145,7 +145,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -382,7 +382,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java index 4833a5eea..eead814ba 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java index 9b965796e..962e053a5 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java @@ -147,7 +147,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -388,7 +388,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java index d5b09e2ce..647f0d772 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java @@ -145,7 +145,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -381,7 +381,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java index a0c26d8b2..f49a3b331 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java index 8bc870e87..d288f485c 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java @@ -167,7 +167,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -453,7 +453,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java index fe891f2bd..dc4b55882 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java index 516152862..c23dafbef 100644 --- a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java @@ -28,6 +28,8 @@ public final class FieldMappingApiInstance { private final Optional remoteField; + private final Optional jmesPath; + private final Map additionalProperties; private FieldMappingApiInstance( @@ -35,11 +37,13 @@ private FieldMappingApiInstance( Optional isIntegrationWide, Optional targetField, Optional remoteField, + Optional jmesPath, Map additionalProperties) { this.id = id; this.isIntegrationWide = isIntegrationWide; this.targetField = targetField; this.remoteField = remoteField; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -63,6 +67,11 @@ public Optional getRemoteField() { return remoteField; } + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +87,13 @@ private boolean equalTo(FieldMappingApiInstance other) { return id.equals(other.id) && isIntegrationWide.equals(other.isIntegrationWide) && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField, this.jmesPath); } @java.lang.Override @@ -105,6 +115,8 @@ public static final class Builder { private Optional remoteField = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -115,6 +127,7 @@ public Builder from(FieldMappingApiInstance other) { isIntegrationWide(other.getIsIntegrationWide()); targetField(other.getTargetField()); remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); return this; } @@ -162,8 +175,20 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + return new FieldMappingApiInstance( + id, isIntegrationWide, targetField, remoteField, jmesPath, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/crm/types/IssuesListRequest.java b/src/main/java/com/merge/api/crm/types/IssuesListRequest.java index 02b8c3ed6..07b8a1d39 100644 --- a/src/main/java/com/merge/api/crm/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/IssuesListRequest.java @@ -164,7 +164,7 @@ public Optional getLinkedAccountId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -446,7 +446,7 @@ public Builder linkedAccountId(String linkedAccountId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/Lead.java b/src/main/java/com/merge/api/crm/types/Lead.java index 9baa7d7a2..c2cf04aa6 100644 --- a/src/main/java/com/merge/api/crm/types/Lead.java +++ b/src/main/java/com/merge/api/crm/types/Lead.java @@ -59,6 +59,8 @@ public final class Lead { private final Optional convertedAccount; + private final Optional status; + private final Optional remoteWasDeleted; private final Optional> fieldMappings; @@ -88,6 +90,7 @@ private Lead( Optional convertedDate, Optional convertedContact, Optional convertedAccount, + Optional status, Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, @@ -111,6 +114,7 @@ private Lead( this.convertedDate = convertedDate; this.convertedContact = convertedContact; this.convertedAccount = convertedAccount; + this.status = status; this.remoteWasDeleted = remoteWasDeleted; this.fieldMappings = fieldMappings; this.remoteData = remoteData; @@ -250,6 +254,20 @@ public Optional getConvertedAccount() { return convertedAccount; } + /** + * @return The lead's status. + *
      + *
    • OPEN - OPEN
    • + *
    • CLOSED - CLOSED
    • + *
    • UNQUALIFIED - UNQUALIFIED
    • + *
    • QUALIFIED - QUALIFIED
    • + *
    + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + /** * @return 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. */ @@ -303,6 +321,7 @@ private boolean equalTo(Lead other) { && convertedDate.equals(other.convertedDate) && convertedContact.equals(other.convertedContact) && convertedAccount.equals(other.convertedAccount) + && status.equals(other.status) && remoteWasDeleted.equals(other.remoteWasDeleted) && fieldMappings.equals(other.fieldMappings) && remoteData.equals(other.remoteData) @@ -330,6 +349,7 @@ public int hashCode() { this.convertedDate, this.convertedContact, this.convertedAccount, + this.status, this.remoteWasDeleted, this.fieldMappings, this.remoteData, @@ -383,6 +403,8 @@ public static final class Builder { private Optional convertedAccount = Optional.empty(); + private Optional status = Optional.empty(); + private Optional remoteWasDeleted = Optional.empty(); private Optional> fieldMappings = Optional.empty(); @@ -415,6 +437,7 @@ public Builder from(Lead other) { convertedDate(other.getConvertedDate()); convertedContact(other.getConvertedContact()); convertedAccount(other.getConvertedAccount()); + status(other.getStatus()); remoteWasDeleted(other.getRemoteWasDeleted()); fieldMappings(other.getFieldMappings()); remoteData(other.getRemoteData()); @@ -662,6 +685,26 @@ public Builder convertedAccount(LeadConvertedAccount convertedAccount) { return this; } + /** + *

    The lead's status.

    + *
      + *
    • OPEN - OPEN
    • + *
    • CLOSED - CLOSED
    • + *
    • UNQUALIFIED - UNQUALIFIED
    • + *
    • QUALIFIED - QUALIFIED
    • + *
    + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(LeadStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + /** *

    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.

    */ @@ -729,6 +772,7 @@ public Lead build() { convertedDate, convertedContact, convertedAccount, + status, remoteWasDeleted, fieldMappings, remoteData, diff --git a/src/main/java/com/merge/api/crm/types/LeadStatus.java b/src/main/java/com/merge/api/crm/types/LeadStatus.java new file mode 100644 index 000000000..b261f6287 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LeadStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = LeadStatus.Deserializer.class) +public final class LeadStatus { + private final Object value; + + private final int type; + + private LeadStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LeadStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LeadStatus && equalTo((LeadStatus) other); + } + + private boolean equalTo(LeadStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static LeadStatus of(LeadStatusEnum value) { + return new LeadStatus(value, 0); + } + + public static LeadStatus of(String value) { + return new LeadStatus(value, 1); + } + + public interface Visitor { + T visit(LeadStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(LeadStatus.class); + } + + @java.lang.Override + public LeadStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LeadStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/LeadStatusEnum.java b/src/main/java/com/merge/api/crm/types/LeadStatusEnum.java new file mode 100644 index 000000000..61d9b7bde --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/LeadStatusEnum.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LeadStatusEnum { + public static final LeadStatusEnum CLOSED = new LeadStatusEnum(Value.CLOSED, "CLOSED"); + + public static final LeadStatusEnum QUALIFIED = new LeadStatusEnum(Value.QUALIFIED, "QUALIFIED"); + + public static final LeadStatusEnum UNQUALIFIED = new LeadStatusEnum(Value.UNQUALIFIED, "UNQUALIFIED"); + + public static final LeadStatusEnum OPEN = new LeadStatusEnum(Value.OPEN, "OPEN"); + + private final Value value; + + private final String string; + + LeadStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LeadStatusEnum && this.string.equals(((LeadStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CLOSED: + return visitor.visitClosed(); + case QUALIFIED: + return visitor.visitQualified(); + case UNQUALIFIED: + return visitor.visitUnqualified(); + case OPEN: + return visitor.visitOpen(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LeadStatusEnum valueOf(String value) { + switch (value) { + case "CLOSED": + return CLOSED; + case "QUALIFIED": + return QUALIFIED; + case "UNQUALIFIED": + return UNQUALIFIED; + case "OPEN": + return OPEN; + default: + return new LeadStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + OPEN, + + CLOSED, + + UNQUALIFIED, + + QUALIFIED, + + UNKNOWN + } + + public interface Visitor { + T visitOpen(); + + T visitClosed(); + + T visitUnqualified(); + + T visitQualified(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/LeadsListRequest.java b/src/main/java/com/merge/api/crm/types/LeadsListRequest.java index 698296537..83a5c12b0 100644 --- a/src/main/java/com/merge/api/crm/types/LeadsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadsListRequest.java @@ -211,7 +211,7 @@ public Optional getOwnerId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -560,7 +560,7 @@ public Builder ownerId(String ownerId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java index 274b0fc96..12fdb19bf 100644 --- a/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java index 90189dc78..0fdaf27d5 100644 --- a/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java @@ -174,7 +174,7 @@ public Optional getIsTestAccount() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -454,7 +454,7 @@ public Builder isTestAccount(String isTestAccount) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/NotesListRequest.java b/src/main/java/com/merge/api/crm/types/NotesListRequest.java index c6f477d2f..d188773cc 100644 --- a/src/main/java/com/merge/api/crm/types/NotesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/NotesListRequest.java @@ -207,7 +207,7 @@ public Optional getOwnerId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -543,7 +543,7 @@ public Builder ownerId(String ownerId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java index 2177905ac..739cbdbc8 100644 --- a/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java index 39f33e95d..71996a793 100644 --- a/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java @@ -203,7 +203,7 @@ public Optional getOwnerId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -571,7 +571,7 @@ public Builder ownerId(String ownerId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java index 060592459..eef767674 100644 --- a/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/crm/types/PatchedEditFieldMappingRequest.java index 03d84b1d8..88ebb906c 100644 --- a/src/main/java/com/merge/api/crm/types/PatchedEditFieldMappingRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedEditFieldMappingRequest.java @@ -22,25 +22,41 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + private final Optional> remoteFieldTraversalPath; private final Optional remoteMethod; private final Optional remoteUrlPath; + private final Optional jmesPath; + private final Map additionalProperties; private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, Optional> remoteFieldTraversalPath, Optional remoteMethod, Optional remoteUrlPath, + Optional jmesPath, Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. */ @@ -65,6 +81,14 @@ public Optional getRemoteUrlPath() { return remoteUrlPath; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +101,21 @@ public Map getAdditionalProperties() { } private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath); } @java.lang.Override @@ -98,21 +129,41 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + private Optional> remoteFieldTraversalPath = Optional.empty(); private Optional remoteMethod = Optional.empty(); private Optional remoteUrlPath = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); return this; } @@ -158,9 +209,28 @@ public Builder remoteUrlPath(String remoteUrlPath) { return this; } + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public PatchedEditFieldMappingRequest build() { return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java b/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java index 146e9aeac..5f668fc12 100644 --- a/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java @@ -33,6 +33,8 @@ public final class PatchedTaskRequest { private final Optional opportunity; + private final Optional contact; + private final Optional completedDate; private final Optional dueDate; @@ -53,6 +55,7 @@ private PatchedTaskRequest( Optional owner, Optional account, Optional opportunity, + Optional contact, Optional completedDate, Optional dueDate, Optional status, @@ -65,6 +68,7 @@ private PatchedTaskRequest( this.owner = owner; this.account = account; this.opportunity = opportunity; + this.contact = contact; this.completedDate = completedDate; this.dueDate = dueDate; this.status = status; @@ -114,6 +118,14 @@ public Optional getOpportunity() { return opportunity; } + /** + * @return The task's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + /** * @return When the task is completed. */ @@ -174,6 +186,7 @@ private boolean equalTo(PatchedTaskRequest other) { && owner.equals(other.owner) && account.equals(other.account) && opportunity.equals(other.opportunity) + && contact.equals(other.contact) && completedDate.equals(other.completedDate) && dueDate.equals(other.dueDate) && status.equals(other.status) @@ -190,6 +203,7 @@ public int hashCode() { this.owner, this.account, this.opportunity, + this.contact, this.completedDate, this.dueDate, this.status, @@ -219,6 +233,8 @@ public static final class Builder { private Optional opportunity = Optional.empty(); + private Optional contact = Optional.empty(); + private Optional completedDate = Optional.empty(); private Optional dueDate = Optional.empty(); @@ -242,6 +258,7 @@ public Builder from(PatchedTaskRequest other) { owner(other.getOwner()); account(other.getAccount()); opportunity(other.getOpportunity()); + contact(other.getContact()); completedDate(other.getCompletedDate()); dueDate(other.getDueDate()); status(other.getStatus()); @@ -321,6 +338,20 @@ public Builder opportunity(String opportunity) { return this; } + /** + *

    The task's contact.

    + */ + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(String contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + /** *

    When the task is completed.

    */ @@ -407,6 +438,7 @@ public PatchedTaskRequest build() { owner, account, opportunity, + contact, completedDate, dueDate, status, diff --git a/src/main/java/com/merge/api/crm/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/crm/types/RegenerateAccountToken.java new file mode 100644 index 000000000..dc143de1b --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/RemoteData.java b/src/main/java/com/merge/api/crm/types/RemoteData.java index 327e796bd..c99b28b03 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteData.java +++ b/src/main/java/com/merge/api/crm/types/RemoteData.java @@ -42,6 +42,9 @@ public String getPath() { return path; } + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ @JsonProperty("data") public Optional getData() { return data; @@ -88,6 +91,9 @@ public interface PathStage { public interface _FinalStage { RemoteData build(); + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ _FinalStage data(Optional data); _FinalStage data(JsonNode data); @@ -123,12 +129,19 @@ public _FinalStage path(@NotNull String path) { return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage data(JsonNode data) { this.data = Optional.ofNullable(data); return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional data) { diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java index 5a6206b21..40175bc33 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java @@ -31,6 +31,8 @@ public final class RemoteFieldClass { private final Optional isCustom; + private final Optional isCommonModelField; + private final Optional isRequired; private final Optional fieldType; @@ -49,6 +51,7 @@ private RemoteFieldClass( Optional remoteKeyName, Optional description, Optional isCustom, + Optional isCommonModelField, Optional isRequired, Optional fieldType, Optional fieldFormat, @@ -60,6 +63,7 @@ private RemoteFieldClass( this.remoteKeyName = remoteKeyName; this.description = description; this.isCustom = isCustom; + this.isCommonModelField = isCommonModelField; this.isRequired = isRequired; this.fieldType = fieldType; this.fieldFormat = fieldFormat; @@ -93,6 +97,11 @@ public Optional getIsCustom() { return isCustom; } + @JsonProperty("is_common_model_field") + public Optional getIsCommonModelField() { + return isCommonModelField; + } + @JsonProperty("is_required") public Optional getIsRequired() { return isRequired; @@ -135,6 +144,7 @@ private boolean equalTo(RemoteFieldClass other) { && remoteKeyName.equals(other.remoteKeyName) && description.equals(other.description) && isCustom.equals(other.isCustom) + && isCommonModelField.equals(other.isCommonModelField) && isRequired.equals(other.isRequired) && fieldType.equals(other.fieldType) && fieldFormat.equals(other.fieldFormat) @@ -150,6 +160,7 @@ public int hashCode() { this.remoteKeyName, this.description, this.isCustom, + this.isCommonModelField, this.isRequired, this.fieldType, this.fieldFormat, @@ -178,6 +189,8 @@ public static final class Builder { private Optional isCustom = Optional.empty(); + private Optional isCommonModelField = Optional.empty(); + private Optional isRequired = Optional.empty(); private Optional fieldType = Optional.empty(); @@ -199,6 +212,7 @@ public Builder from(RemoteFieldClass other) { remoteKeyName(other.getRemoteKeyName()); description(other.getDescription()); isCustom(other.getIsCustom()); + isCommonModelField(other.getIsCommonModelField()); isRequired(other.getIsRequired()); fieldType(other.getFieldType()); fieldFormat(other.getFieldFormat()); @@ -262,6 +276,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + @JsonSetter(value = "is_common_model_field", nulls = Nulls.SKIP) + public Builder isCommonModelField(Optional isCommonModelField) { + this.isCommonModelField = isCommonModelField; + return this; + } + + public Builder isCommonModelField(Boolean isCommonModelField) { + this.isCommonModelField = Optional.ofNullable(isCommonModelField); + return this; + } + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) public Builder isRequired(Optional isRequired) { this.isRequired = isRequired; @@ -324,6 +349,7 @@ public RemoteFieldClass build() { remoteKeyName, description, isCustom, + isCommonModelField, isRequired, fieldType, fieldFormat, diff --git a/src/main/java/com/merge/api/crm/types/RoleEnum.java b/src/main/java/com/merge/api/crm/types/RoleEnum.java index 5dcd25f5f..ccd110ad0 100644 --- a/src/main/java/com/merge/api/crm/types/RoleEnum.java +++ b/src/main/java/com/merge/api/crm/types/RoleEnum.java @@ -17,6 +17,8 @@ public final class RoleEnum { public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); private final Value value; @@ -60,6 +62,8 @@ public T visit(Visitor visitor) { return visitor.visitMember(); case SYSTEM: return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); case ADMIN: return visitor.visitAdmin(); case UNKNOWN: @@ -81,6 +85,8 @@ public static RoleEnum valueOf(String value) { return MEMBER; case "SYSTEM": return SYSTEM; + case "SUPPORT": + return SUPPORT; case "ADMIN": return ADMIN; default: @@ -101,6 +107,8 @@ public enum Value { MERGE_TEAM, + SUPPORT, + UNKNOWN } @@ -117,6 +125,8 @@ public interface Visitor { T visitMergeTeam(); + T visitSupport(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/crm/types/StagesListRequest.java b/src/main/java/com/merge/api/crm/types/StagesListRequest.java index 669757c09..7f252da88 100644 --- a/src/main/java/com/merge/api/crm/types/StagesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/StagesListRequest.java @@ -145,7 +145,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -381,7 +381,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java index c90dba1f1..6e14099bd 100644 --- a/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/crm/types/SyncStatusListRequest.java index c28cd55f7..d613a57a4 100644 --- a/src/main/java/com/merge/api/crm/types/SyncStatusListRequest.java +++ b/src/main/java/com/merge/api/crm/types/SyncStatusListRequest.java @@ -42,7 +42,7 @@ public Optional getCursor() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -110,7 +110,7 @@ public Builder cursor(String cursor) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/Task.java b/src/main/java/com/merge/api/crm/types/Task.java index 8446e9b0b..b7ad4bbb0 100644 --- a/src/main/java/com/merge/api/crm/types/Task.java +++ b/src/main/java/com/merge/api/crm/types/Task.java @@ -41,6 +41,8 @@ public final class Task { private final Optional opportunity; + private final Optional contact; + private final Optional completedDate; private final Optional dueDate; @@ -67,6 +69,7 @@ private Task( Optional owner, Optional account, Optional opportunity, + Optional contact, Optional completedDate, Optional dueDate, Optional status, @@ -84,6 +87,7 @@ private Task( this.owner = owner; this.account = account; this.opportunity = opportunity; + this.contact = contact; this.completedDate = completedDate; this.dueDate = dueDate; this.status = status; @@ -163,6 +167,14 @@ public Optional getOpportunity() { return opportunity; } + /** + * @return The task's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + /** * @return When the task is completed. */ @@ -235,6 +247,7 @@ private boolean equalTo(Task other) { && owner.equals(other.owner) && account.equals(other.account) && opportunity.equals(other.opportunity) + && contact.equals(other.contact) && completedDate.equals(other.completedDate) && dueDate.equals(other.dueDate) && status.equals(other.status) @@ -256,6 +269,7 @@ public int hashCode() { this.owner, this.account, this.opportunity, + this.contact, this.completedDate, this.dueDate, this.status, @@ -294,6 +308,8 @@ public static final class Builder { private Optional opportunity = Optional.empty(); + private Optional contact = Optional.empty(); + private Optional completedDate = Optional.empty(); private Optional dueDate = Optional.empty(); @@ -323,6 +339,7 @@ public Builder from(Task other) { owner(other.getOwner()); account(other.getAccount()); opportunity(other.getOpportunity()); + contact(other.getContact()); completedDate(other.getCompletedDate()); dueDate(other.getDueDate()); status(other.getStatus()); @@ -456,6 +473,20 @@ public Builder opportunity(TaskOpportunity opportunity) { return this; } + /** + *

    The task's contact.

    + */ + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(TaskContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + /** *

    When the task is completed.

    */ @@ -560,6 +591,7 @@ public Task build() { owner, account, opportunity, + contact, completedDate, dueDate, status, diff --git a/src/main/java/com/merge/api/crm/types/TaskContact.java b/src/main/java/com/merge/api/crm/types/TaskContact.java new file mode 100644 index 000000000..68af59b3c --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/TaskContact.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskContact.Deserializer.class) +public final class TaskContact { + private final Object value; + + private final int type; + + private TaskContact(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskContact && equalTo((TaskContact) other); + } + + private boolean equalTo(TaskContact other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TaskContact of(String value) { + return new TaskContact(value, 0); + } + + public static TaskContact of(Contact value) { + return new TaskContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskContact.class); + } + + @java.lang.Override + public TaskContact deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Contact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/TaskRequest.java b/src/main/java/com/merge/api/crm/types/TaskRequest.java index 929645569..96aad1891 100644 --- a/src/main/java/com/merge/api/crm/types/TaskRequest.java +++ b/src/main/java/com/merge/api/crm/types/TaskRequest.java @@ -33,6 +33,8 @@ public final class TaskRequest { private final Optional opportunity; + private final Optional contact; + private final Optional completedDate; private final Optional dueDate; @@ -53,6 +55,7 @@ private TaskRequest( Optional owner, Optional account, Optional opportunity, + Optional contact, Optional completedDate, Optional dueDate, Optional status, @@ -65,6 +68,7 @@ private TaskRequest( this.owner = owner; this.account = account; this.opportunity = opportunity; + this.contact = contact; this.completedDate = completedDate; this.dueDate = dueDate; this.status = status; @@ -114,6 +118,14 @@ public Optional getOpportunity() { return opportunity; } + /** + * @return The task's contact. + */ + @JsonProperty("contact") + public Optional getContact() { + return contact; + } + /** * @return When the task is completed. */ @@ -174,6 +186,7 @@ private boolean equalTo(TaskRequest other) { && owner.equals(other.owner) && account.equals(other.account) && opportunity.equals(other.opportunity) + && contact.equals(other.contact) && completedDate.equals(other.completedDate) && dueDate.equals(other.dueDate) && status.equals(other.status) @@ -190,6 +203,7 @@ public int hashCode() { this.owner, this.account, this.opportunity, + this.contact, this.completedDate, this.dueDate, this.status, @@ -219,6 +233,8 @@ public static final class Builder { private Optional opportunity = Optional.empty(); + private Optional contact = Optional.empty(); + private Optional completedDate = Optional.empty(); private Optional dueDate = Optional.empty(); @@ -242,6 +258,7 @@ public Builder from(TaskRequest other) { owner(other.getOwner()); account(other.getAccount()); opportunity(other.getOpportunity()); + contact(other.getContact()); completedDate(other.getCompletedDate()); dueDate(other.getDueDate()); status(other.getStatus()); @@ -321,6 +338,20 @@ public Builder opportunity(TaskRequestOpportunity opportunity) { return this; } + /** + *

    The task's contact.

    + */ + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public Builder contact(Optional contact) { + this.contact = contact; + return this; + } + + public Builder contact(TaskRequestContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + /** *

    When the task is completed.

    */ @@ -407,6 +438,7 @@ public TaskRequest build() { owner, account, opportunity, + contact, completedDate, dueDate, status, diff --git a/src/main/java/com/merge/api/crm/types/TaskRequestContact.java b/src/main/java/com/merge/api/crm/types/TaskRequestContact.java new file mode 100644 index 000000000..846e301c1 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/TaskRequestContact.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.crm.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = TaskRequestContact.Deserializer.class) +public final class TaskRequestContact { + private final Object value; + + private final int type; + + private TaskRequestContact(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Contact) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TaskRequestContact && equalTo((TaskRequestContact) other); + } + + private boolean equalTo(TaskRequestContact other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static TaskRequestContact of(String value) { + return new TaskRequestContact(value, 0); + } + + public static TaskRequestContact of(Contact value) { + return new TaskRequestContact(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Contact value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(TaskRequestContact.class); + } + + @java.lang.Override + public TaskRequestContact deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Contact.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/TasksListRequest.java b/src/main/java/com/merge/api/crm/types/TasksListRequest.java index 5e2fdba30..7ab6fa4d4 100644 --- a/src/main/java/com/merge/api/crm/types/TasksListRequest.java +++ b/src/main/java/com/merge/api/crm/types/TasksListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/TasksListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/TasksListRequestExpandItem.java index 3ff9f1532..3b89a654f 100644 --- a/src/main/java/com/merge/api/crm/types/TasksListRequestExpandItem.java +++ b/src/main/java/com/merge/api/crm/types/TasksListRequestExpandItem.java @@ -14,6 +14,8 @@ public final class TasksListRequestExpandItem { public static final TasksListRequestExpandItem ACCOUNT = new TasksListRequestExpandItem(Value.ACCOUNT, "account"); + public static final TasksListRequestExpandItem CONTACT = new TasksListRequestExpandItem(Value.CONTACT, "contact"); + private final Value value; private final String string; @@ -53,6 +55,8 @@ public T visit(Visitor visitor) { return visitor.visitOpportunity(); case ACCOUNT: return visitor.visitAccount(); + case CONTACT: + return visitor.visitContact(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -68,6 +72,8 @@ public static TasksListRequestExpandItem valueOf(String value) { return OPPORTUNITY; case "account": return ACCOUNT; + case "contact": + return CONTACT; default: return new TasksListRequestExpandItem(Value.UNKNOWN, value); } @@ -76,6 +82,8 @@ public static TasksListRequestExpandItem valueOf(String value) { public enum Value { ACCOUNT, + CONTACT, + OPPORTUNITY, OWNER, @@ -86,6 +94,8 @@ public enum Value { public interface Visitor { T visitAccount(); + T visitContact(); + T visitOpportunity(); T visitOwner(); diff --git a/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java index e5efac55c..3d9279ac6 100644 --- a/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/TasksRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/TasksRetrieveRequestExpandItem.java index 506528eca..aec201752 100644 --- a/src/main/java/com/merge/api/crm/types/TasksRetrieveRequestExpandItem.java +++ b/src/main/java/com/merge/api/crm/types/TasksRetrieveRequestExpandItem.java @@ -15,6 +15,9 @@ public final class TasksRetrieveRequestExpandItem { public static final TasksRetrieveRequestExpandItem ACCOUNT = new TasksRetrieveRequestExpandItem(Value.ACCOUNT, "account"); + public static final TasksRetrieveRequestExpandItem CONTACT = + new TasksRetrieveRequestExpandItem(Value.CONTACT, "contact"); + private final Value value; private final String string; @@ -54,6 +57,8 @@ public T visit(Visitor visitor) { return visitor.visitOpportunity(); case ACCOUNT: return visitor.visitAccount(); + case CONTACT: + return visitor.visitContact(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -69,6 +74,8 @@ public static TasksRetrieveRequestExpandItem valueOf(String value) { return OPPORTUNITY; case "account": return ACCOUNT; + case "contact": + return CONTACT; default: return new TasksRetrieveRequestExpandItem(Value.UNKNOWN, value); } @@ -77,6 +84,8 @@ public static TasksRetrieveRequestExpandItem valueOf(String value) { public enum Value { ACCOUNT, + CONTACT, + OPPORTUNITY, OWNER, @@ -87,6 +96,8 @@ public enum Value { public interface Visitor { T visitAccount(); + T visitContact(); + T visitOpportunity(); T visitOwner(); diff --git a/src/main/java/com/merge/api/crm/types/UsersListRequest.java b/src/main/java/com/merge/api/crm/types/UsersListRequest.java index 45913de32..d72295d3d 100644 --- a/src/main/java/com/merge/api/crm/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/crm/types/UsersListRequest.java @@ -157,7 +157,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -412,7 +412,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java index 18388b817..23c7180c9 100644 --- a/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/filestorage/AccountTokenClient.java b/src/main/java/com/merge/api/filestorage/AccountTokenClient.java index c1d0b59f1..09e70a0f9 100644 --- a/src/main/java/com/merge/api/filestorage/AccountTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/AccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.filestorage.types.AccountToken; +import com.merge.api.filestorage.types.RegenerateAccountToken; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -37,4 +38,18 @@ public AccountToken retrieve(String publicToken) { public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).body(); } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } } diff --git a/src/main/java/com/merge/api/filestorage/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncAccountTokenClient.java index 92730e571..9b554a005 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncAccountTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncAccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.filestorage.types.AccountToken; +import com.merge.api.filestorage.types.RegenerateAccountToken; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -38,4 +39,18 @@ public CompletableFuture retrieve(String publicToken) { public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/merge/api/filestorage/AsyncFilesClient.java b/src/main/java/com/merge/api/filestorage/AsyncFilesClient.java index 82ac1a4b8..f87bee64c 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncFilesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncFilesClient.java @@ -116,14 +116,14 @@ public CompletableFuture downloadRetrieve( } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public CompletableFuture downloadRequestMetaRetrieve(String id) { return this.rawClient.downloadRequestMetaRetrieve(id).thenApply(response -> response.body()); } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public CompletableFuture downloadRequestMetaRetrieve( String id, FilesDownloadRequestMetaRetrieveRequest request) { @@ -131,7 +131,7 @@ public CompletableFuture downloadRequestMetaRetrieve( } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public CompletableFuture downloadRequestMetaRetrieve( String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/merge/api/filestorage/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncLinkTokenClient.java index 0525c203b..f46e03a6a 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncLinkTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncLinkTokenClient.java @@ -27,14 +27,14 @@ public AsyncRawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request) { return this.rawClient.create(request).thenApply(response -> response.body()); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAccountDetailsClient.java index 3b63d99a9..aafcad5fa 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAccountDetailsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(RequestO @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAccountTokenClient.java index 2c584f1eb..d26127e3f 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawAccountTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAccountTokenClient.java @@ -10,6 +10,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.filestorage.types.AccountToken; +import com.merge.api.filestorage.types.RegenerateAccountToken; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -18,6 +19,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; @@ -61,18 +63,70 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("filestorage/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java index a8678980d..fa6343601 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java @@ -73,19 +73,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -133,19 +130,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + responseBodyString, AsyncPassthroughRetrieveResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java index 7deda98e4..64980cb95 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java @@ -99,9 +99,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAuditLogEventList.class); + responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -122,12 +123,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawAvailableActionsClient.java index 9a5e18bce..5bff0666e 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAvailableActionsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawDeleteAccountClient.java index bc1c5c40d..20b9fa5de 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawDeleteAccountClient.java @@ -63,11 +63,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java index 165bf7e3c..85d616452 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java @@ -125,9 +125,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedDriveList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDriveList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDriveList.class); Optional startingAfter = parsedResponse.getNext(); DrivesListRequest nextRequest = DrivesListRequest.builder() .from(request) @@ -147,12 +148,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -216,17 +214,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Drive.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Drive.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java index b40188876..6a029ddfd 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.filestorage; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.filestorage.types.RemoteFieldApiResponse; import com.merge.api.filestorage.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -87,19 +84,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + responseBodyString, FieldMappingApiInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -137,17 +132,17 @@ public CompletableFuture> fie request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -167,19 +162,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,19 +220,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -276,25 +267,31 @@ public CompletableFuture> fie */ public CompletableFuture> fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -304,19 +301,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,19 +375,16 @@ public CompletableFuture> remoteFie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -438,19 +430,17 @@ public CompletableFuture> t @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + responseBodyString, ExternalTargetFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java index 7f853f20d..4c66f9cce 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java @@ -28,9 +28,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -136,6 +134,20 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get(), + false); + } + if (request.getRemoteCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_before", + request.getRemoteCreatedBefore().get(), + false); + } if (request.getRemoteId().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "remote_id", request.getRemoteId().get(), false); @@ -159,9 +171,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedFileList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFileList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFileList.class); Optional startingAfter = parsedResponse.getNext(); FilesListRequest nextRequest = FilesListRequest.builder() .from(request) @@ -181,12 +194,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -225,12 +235,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -250,19 +258,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FileStorageFileResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FileStorageFileResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -330,17 +335,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), File.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, File.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -408,11 +411,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -428,7 +429,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public CompletableFuture> downloadRequestMetaRetrieve(String id) { return downloadRequestMetaRetrieve( @@ -436,7 +437,7 @@ public CompletableFuture> downloadRequ } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public CompletableFuture> downloadRequestMetaRetrieve( String id, FilesDownloadRequestMetaRetrieveRequest request) { @@ -444,7 +445,7 @@ public CompletableFuture> downloadRequ } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public CompletableFuture> downloadRequestMetaRetrieve( String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { @@ -452,7 +453,8 @@ public CompletableFuture> downloadRequ .newBuilder() .addPathSegments("filestorage/v1/files") .addPathSegment(id) - .addPathSegments("download/request-meta"); + .addPathSegments("download") + .addPathSegments("request-meta"); if (request.getMimeType().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "mime_type", request.getMimeType().get(), false); @@ -472,18 +474,16 @@ public CompletableFuture> downloadRequ @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DownloadRequestMeta.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DownloadRequestMeta.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -561,6 +561,9 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); FilesDownloadRequestMetaListRequest nextRequest = FilesDownloadRequestMetaListRequest.builder() .from(request) @@ -601,12 +605,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -651,18 +652,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java index 5baddd10b..f2cc2c380 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java @@ -21,9 +21,7 @@ import com.merge.api.filestorage.types.PaginatedFolderList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -144,9 +142,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedFolderList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFolderList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFolderList.class); Optional startingAfter = parsedResponse.getNext(); FoldersListRequest nextRequest = FoldersListRequest.builder() .from(request) @@ -167,12 +166,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -211,12 +207,10 @@ public CompletableFuture> create QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -236,19 +230,17 @@ public CompletableFuture> create @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FileStorageFolderResponse.class), + responseBodyString, FileStorageFolderResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -316,17 +308,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Folder.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Folder.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -371,18 +361,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawForceResyncClient.java index c60e573c1..d42735421 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawForceResyncClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawForceResyncClient.java @@ -63,19 +63,17 @@ public CompletableFuture>> syncStatusResyn @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawGenerateKeyClient.java index 41672596f..e29de1a3d 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawGenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java index 6ca9a1089..0a20bbae1 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java @@ -125,9 +125,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedGroupList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); Optional startingAfter = parsedResponse.getNext(); GroupsListRequest nextRequest = GroupsListRequest.builder() .from(request) @@ -147,12 +148,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -220,17 +218,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java index 3d298ab44..3c22ef2d8 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java @@ -145,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -167,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,17 +216,15 @@ public CompletableFuture> retrieve(String id, Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java index f8c724952..b2d3b68cb 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java @@ -34,14 +34,14 @@ public AsyncRawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create( EndUserDetailsRequest request, RequestOptions requestOptions) { @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java index 7b5468283..c360e961f 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java @@ -138,9 +138,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -162,12 +163,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawPassthroughClient.java index f7f1e8d76..6fce31269 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawPassthroughClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawPassthroughClient.java @@ -72,18 +72,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawRegenerateKeyClient.java index 8966768a8..153358e02 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawRegenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawScopesClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawScopesClient.java index 14a7060a9..f6e691a66 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawScopesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawScopesClient.java @@ -64,18 +64,16 @@ public CompletableFuture> defaultScope @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -121,18 +119,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -187,18 +183,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java index df18cb20b..4b5ec48c4 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java @@ -82,9 +82,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedSyncStatusList.class); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -105,12 +106,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java index e48bd6af5..9f5ad0589 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java @@ -72,6 +72,10 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); } + if (request.getEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_address", request.getEmailAddress().get(), false); + } if (request.getIncludeDeletedData().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -125,9 +129,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -147,12 +152,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -216,17 +218,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/filestorage/AsyncRawWebhookReceiversClient.java index c938d1654..bea69f94f 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawWebhookReceiversClient.java @@ -65,19 +65,17 @@ public CompletableFuture>> list(Reque @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -131,18 +129,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/filestorage/FilesClient.java b/src/main/java/com/merge/api/filestorage/FilesClient.java index f6001c2b0..5277c8abd 100644 --- a/src/main/java/com/merge/api/filestorage/FilesClient.java +++ b/src/main/java/com/merge/api/filestorage/FilesClient.java @@ -114,21 +114,21 @@ public InputStream downloadRetrieve( } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public DownloadRequestMeta downloadRequestMetaRetrieve(String id) { return this.rawClient.downloadRequestMetaRetrieve(id).body(); } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public DownloadRequestMeta downloadRequestMetaRetrieve(String id, FilesDownloadRequestMetaRetrieveRequest request) { return this.rawClient.downloadRequestMetaRetrieve(id, request).body(); } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public DownloadRequestMeta downloadRequestMetaRetrieve( String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/merge/api/filestorage/LinkTokenClient.java b/src/main/java/com/merge/api/filestorage/LinkTokenClient.java index 2b581d1a0..a0cc848d9 100644 --- a/src/main/java/com/merge/api/filestorage/LinkTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/LinkTokenClient.java @@ -26,14 +26,14 @@ public RawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request) { return this.rawClient.create(request).body(); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); diff --git a/src/main/java/com/merge/api/filestorage/RawAccountDetailsClient.java b/src/main/java/com/merge/api/filestorage/RawAccountDetailsClient.java index 56b477b37..dd0385a1b 100644 --- a/src/main/java/com/merge/api/filestorage/RawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAccountDetailsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOptio } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java b/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java index e13c72499..b2e006227 100644 --- a/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java @@ -10,11 +10,13 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.filestorage.types.AccountToken; +import com.merge.api.filestorage.types.RegenerateAccountToken; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; @@ -53,16 +55,53 @@ public MergeApiHttpResponse retrieve(String publicToken, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("filestorage/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java index 9a3d75e3f..39d34c2d0 100644 --- a/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java @@ -66,17 +66,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -111,18 +108,14 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java b/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java index e0fccd1b1..e74a30bed 100644 --- a/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java @@ -90,9 +90,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -106,12 +107,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawAvailableActionsClient.java b/src/main/java/com/merge/api/filestorage/RawAvailableActionsClient.java index 98768b638..8311f4c99 100644 --- a/src/main/java/com/merge/api/filestorage/RawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAvailableActionsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawDeleteAccountClient.java b/src/main/java/com/merge/api/filestorage/RawDeleteAccountClient.java index 81a474def..fa1564fcc 100644 --- a/src/main/java/com/merge/api/filestorage/RawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/filestorage/RawDeleteAccountClient.java @@ -55,11 +55,8 @@ public MergeApiHttpResponse delete(RequestOptions requestOptions) { return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawDrivesClient.java b/src/main/java/com/merge/api/filestorage/RawDrivesClient.java index c0859de30..f0f61bdc3 100644 --- a/src/main/java/com/merge/api/filestorage/RawDrivesClient.java +++ b/src/main/java/com/merge/api/filestorage/RawDrivesClient.java @@ -117,9 +117,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedDriveList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDriveList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDriveList.class); Optional startingAfter = parsedResponse.getNext(); DrivesListRequest nextRequest = DrivesListRequest.builder() .from(request) @@ -132,12 +133,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -189,16 +186,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Drive.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Drive.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java b/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java index fb475fffc..18c9c7ed6 100644 --- a/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.filestorage; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.filestorage.types.RemoteFieldApiResponse; import com.merge.api.filestorage.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -80,18 +77,14 @@ public MergeApiHttpResponse fieldMappingsRetrie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -119,17 +112,17 @@ public MergeApiHttpResponse fieldMappingsCreate( request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -146,17 +139,14 @@ public MergeApiHttpResponse fieldMappingsCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,17 +181,14 @@ public MergeApiHttpResponse fieldMappingsDestroy( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -228,42 +215,45 @@ public MergeApiHttpResponse fieldMappingsPartialUp */ public MergeApiHttpResponse fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -314,17 +304,14 @@ public MergeApiHttpResponse remoteFieldsRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -357,18 +344,14 @@ public MergeApiHttpResponse targetFieldsRetrieve } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawFilesClient.java b/src/main/java/com/merge/api/filestorage/RawFilesClient.java index 4fb34a6e5..b5d04f3bc 100644 --- a/src/main/java/com/merge/api/filestorage/RawFilesClient.java +++ b/src/main/java/com/merge/api/filestorage/RawFilesClient.java @@ -28,9 +28,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -131,6 +129,20 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); } + if (request.getRemoteCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_after", + request.getRemoteCreatedAfter().get(), + false); + } + if (request.getRemoteCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_created_before", + request.getRemoteCreatedBefore().get(), + false); + } if (request.getRemoteId().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "remote_id", request.getRemoteId().get(), false); @@ -151,9 +163,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedFileList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFileList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFileList.class); Optional startingAfter = parsedResponse.getNext(); FilesListRequest nextRequest = FilesListRequest.builder() .from(request) @@ -166,12 +179,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -200,12 +209,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -222,17 +229,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FileStorageFileResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FileStorageFileResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -287,16 +291,13 @@ public MergeApiHttpResponse retrieve(String id, FilesRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), File.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, File.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -350,18 +351,15 @@ public MergeApiHttpResponse downloadRetrieve( return new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public MergeApiHttpResponse downloadRequestMetaRetrieve(String id) { return downloadRequestMetaRetrieve( @@ -369,7 +367,7 @@ public MergeApiHttpResponse downloadRequestMetaRetrieve(Str } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public MergeApiHttpResponse downloadRequestMetaRetrieve( String id, FilesDownloadRequestMetaRetrieveRequest request) { @@ -377,7 +375,7 @@ public MergeApiHttpResponse downloadRequestMetaRetrieve( } /** - * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. + * Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. For information on our download process please refer to our <a href='https://help.merge.dev/articles/10644317' target='_blank'>direct file download help center article</a>. */ public MergeApiHttpResponse downloadRequestMetaRetrieve( String id, FilesDownloadRequestMetaRetrieveRequest request, RequestOptions requestOptions) { @@ -385,7 +383,8 @@ public MergeApiHttpResponse downloadRequestMetaRetrieve( .newBuilder() .addPathSegments("filestorage/v1/files") .addPathSegment(id) - .addPathSegments("download/request-meta"); + .addPathSegments("download") + .addPathSegments("request-meta"); if (request.getMimeType().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "mime_type", request.getMimeType().get(), false); @@ -402,17 +401,13 @@ public MergeApiHttpResponse downloadRequestMetaRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), DownloadRequestMeta.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DownloadRequestMeta.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -481,6 +476,9 @@ public MergeApiHttpResponse> downloadReq QueryStringMapper.addQueryParameter( httpUrl, "page_size", request.getPageSize().get(), false); } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), true); + } Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl.build()) .method("GET", null) @@ -493,9 +491,10 @@ public MergeApiHttpResponse> downloadReq } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedDownloadRequestMetaList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedDownloadRequestMetaList.class); + PaginatedDownloadRequestMetaList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDownloadRequestMetaList.class); Optional startingAfter = parsedResponse.getNext(); FilesDownloadRequestMetaListRequest nextRequest = FilesDownloadRequestMetaListRequest.builder() .from(request) @@ -509,12 +508,8 @@ public MergeApiHttpResponse> downloadReq .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -547,16 +542,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawFoldersClient.java b/src/main/java/com/merge/api/filestorage/RawFoldersClient.java index 3d09fd355..7dcaddd68 100644 --- a/src/main/java/com/merge/api/filestorage/RawFoldersClient.java +++ b/src/main/java/com/merge/api/filestorage/RawFoldersClient.java @@ -21,9 +21,7 @@ import com.merge.api.filestorage.types.PaginatedFolderList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -136,9 +134,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedFolderList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedFolderList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFolderList.class); Optional startingAfter = parsedResponse.getNext(); FoldersListRequest nextRequest = FoldersListRequest.builder() .from(request) @@ -151,12 +150,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -185,12 +180,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -207,17 +200,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FileStorageFolderResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FileStorageFolderResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -273,16 +263,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Folder.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Folder.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -315,16 +302,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawForceResyncClient.java b/src/main/java/com/merge/api/filestorage/RawForceResyncClient.java index 7ada77eb0..e0224eef9 100644 --- a/src/main/java/com/merge/api/filestorage/RawForceResyncClient.java +++ b/src/main/java/com/merge/api/filestorage/RawForceResyncClient.java @@ -55,18 +55,15 @@ public MergeApiHttpResponse> syncStatusResyncCreate(RequestOpti } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawGenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/RawGenerateKeyClient.java index 77177871f..df781293d 100644 --- a/src/main/java/com/merge/api/filestorage/RawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/filestorage/RawGenerateKeyClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawGroupsClient.java b/src/main/java/com/merge/api/filestorage/RawGroupsClient.java index 86f67c14f..ed36c2bd6 100644 --- a/src/main/java/com/merge/api/filestorage/RawGroupsClient.java +++ b/src/main/java/com/merge/api/filestorage/RawGroupsClient.java @@ -117,9 +117,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedGroupList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); Optional startingAfter = parsedResponse.getNext(); GroupsListRequest nextRequest = GroupsListRequest.builder() .from(request) @@ -132,12 +133,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -193,16 +190,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawIssuesClient.java b/src/main/java/com/merge/api/filestorage/RawIssuesClient.java index 7eaccfd09..d6122527f 100644 --- a/src/main/java/com/merge/api/filestorage/RawIssuesClient.java +++ b/src/main/java/com/merge/api/filestorage/RawIssuesClient.java @@ -137,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -152,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,16 +188,13 @@ public MergeApiHttpResponse retrieve(String id, RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java b/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java index b7de7f977..f0c4c551e 100644 --- a/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java @@ -30,14 +30,14 @@ public RawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(EndUserDetailsRequest request, Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java index 0fe590c8d..3d1491ad1 100644 --- a/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java @@ -128,9 +128,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); Optional startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -145,12 +146,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawPassthroughClient.java b/src/main/java/com/merge/api/filestorage/RawPassthroughClient.java index eb81ed2e8..e50ed5d07 100644 --- a/src/main/java/com/merge/api/filestorage/RawPassthroughClient.java +++ b/src/main/java/com/merge/api/filestorage/RawPassthroughClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(DataPassthroughRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/filestorage/RawRegenerateKeyClient.java index 11ffdab5f..3742e512f 100644 --- a/src/main/java/com/merge/api/filestorage/RawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/filestorage/RawRegenerateKeyClient.java @@ -65,16 +65,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawScopesClient.java b/src/main/java/com/merge/api/filestorage/RawScopesClient.java index bdc33abbe..f20bf9953 100644 --- a/src/main/java/com/merge/api/filestorage/RawScopesClient.java +++ b/src/main/java/com/merge/api/filestorage/RawScopesClient.java @@ -56,17 +56,13 @@ public MergeApiHttpResponse defaultScopesRetrieve(RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -99,17 +95,13 @@ public MergeApiHttpResponse linkedAccountScopesRetrieve(Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -152,17 +144,13 @@ public MergeApiHttpResponse linkedAccountScopesCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java b/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java index 44d7fe9fd..0dd72e305 100644 --- a/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java @@ -74,9 +74,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedSyncStatusList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -90,12 +91,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawUsersClient.java b/src/main/java/com/merge/api/filestorage/RawUsersClient.java index 282b07cb5..17b169ae8 100644 --- a/src/main/java/com/merge/api/filestorage/RawUsersClient.java +++ b/src/main/java/com/merge/api/filestorage/RawUsersClient.java @@ -67,6 +67,10 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); } + if (request.getEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "email_address", request.getEmailAddress().get(), false); + } if (request.getIncludeDeletedData().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -117,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -132,12 +137,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -188,16 +189,13 @@ public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/filestorage/RawWebhookReceiversClient.java index 01cff8aaa..0ecdea4f8 100644 --- a/src/main/java/com/merge/api/filestorage/RawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/filestorage/RawWebhookReceiversClient.java @@ -58,18 +58,15 @@ public MergeApiHttpResponse> list(RequestOptions requestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -110,16 +107,13 @@ public MergeApiHttpResponse create(WebhookReceiverRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/filestorage/types/AccountDetails.java b/src/main/java/com/merge/api/filestorage/types/AccountDetails.java index 683841fde..1d8c0ab0f 100644 --- a/src/main/java/com/merge/api/filestorage/types/AccountDetails.java +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetails.java @@ -45,6 +45,10 @@ public final class AccountDetails { private final Optional completedAt; + private final Optional instanceId; + + private final Optional instanceDisplayValue; + private final Map additionalProperties; private AccountDetails( @@ -60,6 +64,8 @@ private AccountDetails( Optional isDuplicate, Optional accountType, Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, Map additionalProperties) { this.id = id; this.integration = integration; @@ -73,6 +79,8 @@ private AccountDetails( this.isDuplicate = isDuplicate; this.accountType = accountType; this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; this.additionalProperties = additionalProperties; } @@ -142,6 +150,16 @@ public Optional getCompletedAt() { return completedAt; } + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -165,7 +183,9 @@ private boolean equalTo(AccountDetails other) { && webhookListenerUrl.equals(other.webhookListenerUrl) && isDuplicate.equals(other.isDuplicate) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); } @java.lang.Override @@ -182,7 +202,9 @@ public int hashCode() { this.webhookListenerUrl, this.isDuplicate, this.accountType, - this.completedAt); + this.completedAt, + this.instanceId, + this.instanceDisplayValue); } @java.lang.Override @@ -220,6 +242,10 @@ public static final class Builder { private Optional completedAt = Optional.empty(); + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -238,6 +264,8 @@ public Builder from(AccountDetails other) { isDuplicate(other.getIsDuplicate()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); return this; } @@ -379,6 +407,28 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + public AccountDetails build() { return new AccountDetails( id, @@ -393,6 +443,8 @@ public AccountDetails build() { isDuplicate, accountType, completedAt, + instanceId, + instanceDisplayValue, additionalProperties); } } diff --git a/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java index 7e5fdb6b0..eda8e7b9a 100644 --- a/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -48,6 +49,8 @@ public final class AccountDetailsAndActions { private final OffsetDateTime completedAt; + private final Optional> integrationSpecificFields; + private final Map additionalProperties; private AccountDetailsAndActions( @@ -64,6 +67,7 @@ private AccountDetailsAndActions( Optional integration, String accountType, OffsetDateTime completedAt, + Optional> integrationSpecificFields, Map additionalProperties) { this.id = id; this.category = category; @@ -78,6 +82,7 @@ private AccountDetailsAndActions( this.integration = integration; this.accountType = accountType; this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; this.additionalProperties = additionalProperties; } @@ -152,6 +157,11 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -176,7 +186,8 @@ private boolean equalTo(AccountDetailsAndActions other) { && isDuplicate.equals(other.isDuplicate) && integration.equals(other.integration) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); } @java.lang.Override @@ -194,7 +205,8 @@ public int hashCode() { this.isDuplicate, this.integration, this.accountType, - this.completedAt); + this.completedAt, + this.integrationSpecificFields); } @java.lang.Override @@ -268,6 +280,10 @@ public interface _FinalStage { _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -294,6 +310,8 @@ public static final class Builder private OffsetDateTime completedAt; + private Optional> integrationSpecificFields = Optional.empty(); + private Optional integration = Optional.empty(); private Optional isDuplicate = Optional.empty(); @@ -326,6 +344,7 @@ public Builder from(AccountDetailsAndActions other) { integration(other.getIntegration()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); return this; } @@ -378,6 +397,19 @@ public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { return this; } + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + @java.lang.Override public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { this.integration = Optional.ofNullable(integration); @@ -486,6 +518,7 @@ public AccountDetailsAndActions build() { integration, accountType, completedAt, + integrationSpecificFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/filestorage/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/filestorage/types/AuditTrailListRequest.java index 01100928d..227c4f441 100644 --- a/src/main/java/com/merge/api/filestorage/types/AuditTrailListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/AuditTrailListRequest.java @@ -76,7 +76,7 @@ public Optional getEventType() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -205,7 +205,7 @@ public Builder eventType(String eventType) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/filestorage/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/filestorage/types/CreateFieldMappingRequest.java index 26291d48c..2937e8c73 100644 --- a/src/main/java/com/merge/api/filestorage/types/CreateFieldMappingRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/CreateFieldMappingRequest.java @@ -26,6 +26,8 @@ public final class CreateFieldMappingRequest { private final Optional excludeRemoteFieldMetadata; + private final Optional remoteDataIterationCount; + private final String targetFieldName; private final String targetFieldDescription; @@ -38,24 +40,30 @@ public final class CreateFieldMappingRequest { private final String commonModelName; + private final Optional jmesPath; + private final Map additionalProperties; private CreateFieldMappingRequest( Optional excludeRemoteFieldMetadata, + Optional remoteDataIterationCount, String targetFieldName, String targetFieldDescription, List remoteFieldTraversalPath, String remoteMethod, String remoteUrlPath, String commonModelName, + Optional jmesPath, Map additionalProperties) { this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.remoteDataIterationCount = remoteDataIterationCount; this.targetFieldName = targetFieldName; this.targetFieldDescription = targetFieldDescription; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; this.commonModelName = commonModelName; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -67,6 +75,14 @@ public Optional getExcludeRemoteFieldMetadata() { return excludeRemoteFieldMetadata; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The name of the target field you want this remote field to map to. */ @@ -115,6 +131,14 @@ public String getCommonModelName() { return commonModelName; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -128,24 +152,28 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateFieldMappingRequest other) { return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && remoteDataIterationCount.equals(other.remoteDataIterationCount) && targetFieldName.equals(other.targetFieldName) && targetFieldDescription.equals(other.targetFieldDescription) && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { return Objects.hash( this.excludeRemoteFieldMetadata, + this.remoteDataIterationCount, this.targetFieldName, this.targetFieldDescription, this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath, - this.commonModelName); + this.commonModelName, + this.jmesPath); } @java.lang.Override @@ -204,6 +232,13 @@ public interface _FinalStage { _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount); + + _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount); + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    */ @@ -212,6 +247,13 @@ public interface _FinalStage { _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -232,8 +274,12 @@ public static final class Builder private String commonModelName; + private Optional jmesPath = Optional.empty(); + private List remoteFieldTraversalPath = new ArrayList<>(); + private Optional remoteDataIterationCount = Optional.empty(); + private Optional excludeRemoteFieldMetadata = Optional.empty(); @JsonAnySetter @@ -244,12 +290,14 @@ private Builder() {} @java.lang.Override public Builder from(CreateFieldMappingRequest other) { excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + remoteDataIterationCount(other.getRemoteDataIterationCount()); targetFieldName(other.getTargetFieldName()); targetFieldDescription(other.getTargetFieldDescription()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); return this; } @@ -313,6 +361,26 @@ public _FinalStage commonModelName(@NotNull String commonModelName) { return this; } + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -348,6 +416,26 @@ public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalP return this; } + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @java.lang.Override + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + /** *

    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.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -372,12 +460,14 @@ public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFie public CreateFieldMappingRequest build() { return new CreateFieldMappingRequest( excludeRemoteFieldMetadata, + remoteDataIterationCount, targetFieldName, targetFieldDescription, remoteFieldTraversalPath, remoteMethod, remoteUrlPath, commonModelName, + jmesPath, additionalProperties); } } diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java index 9cdf36de8..c46685ebc 100644 --- a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java @@ -28,6 +28,8 @@ public final class FieldMappingApiInstance { private final Optional remoteField; + private final Optional jmesPath; + private final Map additionalProperties; private FieldMappingApiInstance( @@ -35,11 +37,13 @@ private FieldMappingApiInstance( Optional isIntegrationWide, Optional targetField, Optional remoteField, + Optional jmesPath, Map additionalProperties) { this.id = id; this.isIntegrationWide = isIntegrationWide; this.targetField = targetField; this.remoteField = remoteField; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -63,6 +67,11 @@ public Optional getRemoteField() { return remoteField; } + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +87,13 @@ private boolean equalTo(FieldMappingApiInstance other) { return id.equals(other.id) && isIntegrationWide.equals(other.isIntegrationWide) && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField, this.jmesPath); } @java.lang.Override @@ -105,6 +115,8 @@ public static final class Builder { private Optional remoteField = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -115,6 +127,7 @@ public Builder from(FieldMappingApiInstance other) { isIntegrationWide(other.getIsIntegrationWide()); targetField(other.getTargetField()); remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); return this; } @@ -162,8 +175,20 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + return new FieldMappingApiInstance( + id, isIntegrationWide, targetField, remoteField, jmesPath, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaListRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaListRequest.java index 61a65f80b..c5cff850d 100644 --- a/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaListRequest.java @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -20,6 +22,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = FilesDownloadRequestMetaListRequest.Builder.class) public final class FilesDownloadRequestMetaListRequest { + private final Optional> ids; + private final Optional createdAfter; private final Optional createdBefore; @@ -41,6 +45,7 @@ public final class FilesDownloadRequestMetaListRequest { private final Map additionalProperties; private FilesDownloadRequestMetaListRequest( + Optional> ids, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -51,6 +56,7 @@ private FilesDownloadRequestMetaListRequest( Optional orderBy, Optional pageSize, Map additionalProperties) { + this.ids = ids; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; @@ -63,6 +69,14 @@ private FilesDownloadRequestMetaListRequest( this.additionalProperties = additionalProperties; } + /** + * @return If provided, will only return objects with the given IDs. Comma-separated list of strings. + */ + @JsonProperty("ids") + public Optional> getIds() { + return ids; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -148,7 +162,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(FilesDownloadRequestMetaListRequest other) { - return createdAfter.equals(other.createdAfter) + return ids.equals(other.ids) + && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && includeDeletedData.equals(other.includeDeletedData) @@ -162,6 +177,7 @@ private boolean equalTo(FilesDownloadRequestMetaListRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.ids, this.createdAfter, this.createdBefore, this.cursor, @@ -184,6 +200,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional> ids = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -208,6 +226,7 @@ public static final class Builder { private Builder() {} public Builder from(FilesDownloadRequestMetaListRequest other) { + ids(other.getIds()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); @@ -220,6 +239,25 @@ public Builder from(FilesDownloadRequestMetaListRequest other) { return this; } + /** + *

    If provided, will only return objects with the given IDs. Comma-separated list of strings.

    + */ + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional> ids) { + this.ids = ids; + return this; + } + + public Builder ids(List ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.of(Collections.singletonList(ids)); + return this; + } + /** *

    If provided, will only return objects created after this datetime.

    */ @@ -348,6 +386,7 @@ public Builder pageSize(Integer pageSize) { public FilesDownloadRequestMetaListRequest build() { return new FilesDownloadRequestMetaListRequest( + ids, createdAfter, createdBefore, cursor, diff --git a/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaRetrieveRequest.java index b6735214d..b8cac77e1 100644 --- a/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaRetrieveRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FilesDownloadRequestMetaRetrieveRequest.java @@ -31,7 +31,7 @@ private FilesDownloadRequestMetaRetrieveRequest( } /** - * @return If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>. + * @return If provided, specifies the export format of the file to be downloaded. */ @JsonProperty("mime_type") public Optional getMimeType() { @@ -83,7 +83,7 @@ public Builder from(FilesDownloadRequestMetaRetrieveRequest other) { } /** - *

    If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our <a href='https://help.merge.dev/en/articles/8615316-file-export-and-download-specification' target='_blank'>export format help center article</a>.

    + *

    If provided, specifies the export format of the file to be downloaded.

    */ @JsonSetter(value = "mime_type", nulls = Nulls.SKIP) public Builder mimeType(Optional mimeType) { diff --git a/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java index 463de88d9..740243600 100644 --- a/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java @@ -53,6 +53,10 @@ public final class FilesListRequest { private final Optional pageSize; + private final Optional remoteCreatedAfter; + + private final Optional remoteCreatedBefore; + private final Optional remoteId; private final Map additionalProperties; @@ -73,6 +77,8 @@ private FilesListRequest( Optional name, Optional orderBy, Optional pageSize, + Optional remoteCreatedAfter, + Optional remoteCreatedBefore, Optional remoteId, Map additionalProperties) { this.expand = expand; @@ -90,6 +96,8 @@ private FilesListRequest( this.name = name; this.orderBy = orderBy; this.pageSize = pageSize; + this.remoteCreatedAfter = remoteCreatedAfter; + this.remoteCreatedBefore = remoteCreatedBefore; this.remoteId = remoteId; this.additionalProperties = additionalProperties; } @@ -207,13 +215,29 @@ public Optional getOrderBy() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { return pageSize; } + /** + * @return If provided, will only return files created in the third party platform after this datetime. + */ + @JsonProperty("remote_created_after") + public Optional getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + /** + * @return If provided, will only return files created in the third party platform before this datetime. + */ + @JsonProperty("remote_created_before") + public Optional getRemoteCreatedBefore() { + return remoteCreatedBefore; + } + /** * @return The API provider's ID for the given object. */ @@ -249,6 +273,8 @@ private boolean equalTo(FilesListRequest other) { && name.equals(other.name) && orderBy.equals(other.orderBy) && pageSize.equals(other.pageSize) + && remoteCreatedAfter.equals(other.remoteCreatedAfter) + && remoteCreatedBefore.equals(other.remoteCreatedBefore) && remoteId.equals(other.remoteId); } @@ -270,6 +296,8 @@ public int hashCode() { this.name, this.orderBy, this.pageSize, + this.remoteCreatedAfter, + this.remoteCreatedBefore, this.remoteId); } @@ -314,6 +342,10 @@ public static final class Builder { private Optional pageSize = Optional.empty(); + private Optional remoteCreatedAfter = Optional.empty(); + + private Optional remoteCreatedBefore = Optional.empty(); + private Optional remoteId = Optional.empty(); @JsonAnySetter @@ -337,6 +369,8 @@ public Builder from(FilesListRequest other) { name(other.getName()); orderBy(other.getOrderBy()); pageSize(other.getPageSize()); + remoteCreatedAfter(other.getRemoteCreatedAfter()); + remoteCreatedBefore(other.getRemoteCreatedBefore()); remoteId(other.getRemoteId()); return this; } @@ -543,7 +577,7 @@ public Builder orderBy(FilesListRequestOrderBy orderBy) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -556,6 +590,34 @@ public Builder pageSize(Integer pageSize) { return this; } + /** + *

    If provided, will only return files created in the third party platform after this datetime.

    + */ + @JsonSetter(value = "remote_created_after", nulls = Nulls.SKIP) + public Builder remoteCreatedAfter(Optional remoteCreatedAfter) { + this.remoteCreatedAfter = remoteCreatedAfter; + return this; + } + + public Builder remoteCreatedAfter(OffsetDateTime remoteCreatedAfter) { + this.remoteCreatedAfter = Optional.ofNullable(remoteCreatedAfter); + return this; + } + + /** + *

    If provided, will only return files created in the third party platform before this datetime.

    + */ + @JsonSetter(value = "remote_created_before", nulls = Nulls.SKIP) + public Builder remoteCreatedBefore(Optional remoteCreatedBefore) { + this.remoteCreatedBefore = remoteCreatedBefore; + return this; + } + + public Builder remoteCreatedBefore(OffsetDateTime remoteCreatedBefore) { + this.remoteCreatedBefore = Optional.ofNullable(remoteCreatedBefore); + return this; + } + /** *

    The API provider's ID for the given object.

    */ @@ -587,6 +649,8 @@ public FilesListRequest build() { name, orderBy, pageSize, + remoteCreatedAfter, + remoteCreatedBefore, remoteId, additionalProperties); } diff --git a/src/main/java/com/merge/api/filestorage/types/FoldersListRequest.java b/src/main/java/com/merge/api/filestorage/types/FoldersListRequest.java index a53188375..e81627eed 100644 --- a/src/main/java/com/merge/api/filestorage/types/FoldersListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FoldersListRequest.java @@ -175,7 +175,7 @@ public Optional getName() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -467,7 +467,7 @@ public Builder name(String name) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java b/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java index 968133545..aafe05c40 100644 --- a/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java @@ -147,7 +147,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -388,7 +388,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java b/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java index bb86d7da8..6377da482 100644 --- a/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java @@ -164,7 +164,7 @@ public Optional getLinkedAccountId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -446,7 +446,7 @@ public Builder linkedAccountId(String linkedAccountId) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java index 42d086fcd..063af07b2 100644 --- a/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java @@ -174,7 +174,7 @@ public Optional getIsTestAccount() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -454,7 +454,7 @@ public Builder isTestAccount(String isTestAccount) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/filestorage/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/filestorage/types/PatchedEditFieldMappingRequest.java index dfcd50a8d..e7e7b3132 100644 --- a/src/main/java/com/merge/api/filestorage/types/PatchedEditFieldMappingRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/PatchedEditFieldMappingRequest.java @@ -22,25 +22,41 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + private final Optional> remoteFieldTraversalPath; private final Optional remoteMethod; private final Optional remoteUrlPath; + private final Optional jmesPath; + private final Map additionalProperties; private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, Optional> remoteFieldTraversalPath, Optional remoteMethod, Optional remoteUrlPath, + Optional jmesPath, Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. */ @@ -65,6 +81,14 @@ public Optional getRemoteUrlPath() { return remoteUrlPath; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +101,21 @@ public Map getAdditionalProperties() { } private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath); } @java.lang.Override @@ -98,21 +129,41 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + private Optional> remoteFieldTraversalPath = Optional.empty(); private Optional remoteMethod = Optional.empty(); private Optional remoteUrlPath = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + return this; + } + + /** + *

    Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

    + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); return this; } @@ -158,9 +209,28 @@ public Builder remoteUrlPath(String remoteUrlPath) { return this; } + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public PatchedEditFieldMappingRequest build() { return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/filestorage/types/Permission.java b/src/main/java/com/merge/api/filestorage/types/Permission.java index 401d33bf1..4e8f47542 100644 --- a/src/main/java/com/merge/api/filestorage/types/Permission.java +++ b/src/main/java/com/merge/api/filestorage/types/Permission.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -38,6 +39,10 @@ public final class Permission { private final Optional>> roles; + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + private final Map additionalProperties; private Permission( @@ -49,6 +54,8 @@ private Permission( Optional group, Optional type, Optional>> roles, + Optional remoteWasDeleted, + Optional> fieldMappings, Map additionalProperties) { this.id = id; this.remoteId = remoteId; @@ -58,6 +65,8 @@ private Permission( this.group = group; this.type = type; this.roles = roles; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; this.additionalProperties = additionalProperties; } @@ -128,6 +137,19 @@ public Optional>> getRoles() { return roles; } + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -147,13 +169,24 @@ private boolean equalTo(Permission other) { && user.equals(other.user) && group.equals(other.group) && type.equals(other.type) - && roles.equals(other.roles); + && roles.equals(other.roles) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings); } @java.lang.Override public int hashCode() { return Objects.hash( - this.id, this.remoteId, this.createdAt, this.modifiedAt, this.user, this.group, this.type, this.roles); + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.user, + this.group, + this.type, + this.roles, + this.remoteWasDeleted, + this.fieldMappings); } @java.lang.Override @@ -183,6 +216,10 @@ public static final class Builder { private Optional>> roles = Optional.empty(); + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -197,6 +234,8 @@ public Builder from(Permission other) { group(other.getGroup()); type(other.getType()); roles(other.getRoles()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); return this; } @@ -315,8 +354,44 @@ public Builder roles(List> roles) { return this; } + /** + *

    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.

    + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + public Permission build() { - return new Permission(id, remoteId, createdAt, modifiedAt, user, group, type, roles, additionalProperties); + return new Permission( + id, + remoteId, + createdAt, + modifiedAt, + user, + group, + type, + roles, + remoteWasDeleted, + fieldMappings, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/filestorage/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/filestorage/types/RegenerateAccountToken.java new file mode 100644 index 000000000..cc8ba8d77 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.filestorage.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/RemoteData.java b/src/main/java/com/merge/api/filestorage/types/RemoteData.java index e96a73416..6e4a3278d 100644 --- a/src/main/java/com/merge/api/filestorage/types/RemoteData.java +++ b/src/main/java/com/merge/api/filestorage/types/RemoteData.java @@ -42,6 +42,9 @@ public String getPath() { return path; } + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ @JsonProperty("data") public Optional getData() { return data; @@ -88,6 +91,9 @@ public interface PathStage { public interface _FinalStage { RemoteData build(); + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ _FinalStage data(Optional data); _FinalStage data(JsonNode data); @@ -123,12 +129,19 @@ public _FinalStage path(@NotNull String path) { return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage data(JsonNode data) { this.data = Optional.ofNullable(data); return this; } + /** + *

    The data returned from the third-party for this object in its original, unnormalized format.

    + */ @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional data) { diff --git a/src/main/java/com/merge/api/filestorage/types/RoleEnum.java b/src/main/java/com/merge/api/filestorage/types/RoleEnum.java index a57ae07a8..6a5ab7f42 100644 --- a/src/main/java/com/merge/api/filestorage/types/RoleEnum.java +++ b/src/main/java/com/merge/api/filestorage/types/RoleEnum.java @@ -17,6 +17,8 @@ public final class RoleEnum { public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); private final Value value; @@ -60,6 +62,8 @@ public T visit(Visitor visitor) { return visitor.visitMember(); case SYSTEM: return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); case ADMIN: return visitor.visitAdmin(); case UNKNOWN: @@ -81,6 +85,8 @@ public static RoleEnum valueOf(String value) { return MEMBER; case "SYSTEM": return SYSTEM; + case "SUPPORT": + return SUPPORT; case "ADMIN": return ADMIN; default: @@ -101,6 +107,8 @@ public enum Value { MERGE_TEAM, + SUPPORT, + UNKNOWN } @@ -117,6 +125,8 @@ public interface Visitor { T visitMergeTeam(); + T visitSupport(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/filestorage/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/filestorage/types/SyncStatusListRequest.java index 8927a253f..64fd5e219 100644 --- a/src/main/java/com/merge/api/filestorage/types/SyncStatusListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/SyncStatusListRequest.java @@ -42,7 +42,7 @@ public Optional getCursor() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -110,7 +110,7 @@ public Builder cursor(String cursor) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java b/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java index 009651f5a..0523d5eef 100644 --- a/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java @@ -27,6 +27,8 @@ public final class UsersListRequest { private final Optional cursor; + private final Optional emailAddress; + private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -49,6 +51,7 @@ private UsersListRequest( Optional createdAfter, Optional createdBefore, Optional cursor, + Optional emailAddress, Optional includeDeletedData, Optional includeRemoteData, Optional includeShellData, @@ -61,6 +64,7 @@ private UsersListRequest( this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; + this.emailAddress = emailAddress; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -96,6 +100,14 @@ public Optional getCursor() { return cursor; } + /** + * @return If provided, will only return users with emails equal to this value (case insensitive). + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + /** * @return 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. */ @@ -145,7 +157,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -175,6 +187,7 @@ private boolean equalTo(UsersListRequest other) { return createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) + && emailAddress.equals(other.emailAddress) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData) @@ -191,6 +204,7 @@ public int hashCode() { this.createdAfter, this.createdBefore, this.cursor, + this.emailAddress, this.includeDeletedData, this.includeRemoteData, this.includeShellData, @@ -218,6 +232,8 @@ public static final class Builder { private Optional cursor = Optional.empty(); + private Optional emailAddress = Optional.empty(); + private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -243,6 +259,7 @@ public Builder from(UsersListRequest other) { createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); + emailAddress(other.getEmailAddress()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeShellData(other.getIncludeShellData()); @@ -296,6 +313,20 @@ public Builder cursor(String cursor) { return this; } + /** + *

    If provided, will only return users with emails equal to this value (case insensitive).

    + */ + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + /** *

    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.

    */ @@ -381,7 +412,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -413,6 +444,7 @@ public UsersListRequest build() { createdAfter, createdBefore, cursor, + emailAddress, includeDeletedData, includeRemoteData, includeShellData, diff --git a/src/main/java/com/merge/api/hris/AccountTokenClient.java b/src/main/java/com/merge/api/hris/AccountTokenClient.java index 175aa353b..912995327 100644 --- a/src/main/java/com/merge/api/hris/AccountTokenClient.java +++ b/src/main/java/com/merge/api/hris/AccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.hris.types.AccountToken; +import com.merge.api.hris.types.RegenerateAccountToken; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -37,4 +38,18 @@ public AccountToken retrieve(String publicToken) { public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).body(); } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } } diff --git a/src/main/java/com/merge/api/hris/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/hris/AsyncAccountTokenClient.java index b22f0157e..0d9a6f03e 100644 --- a/src/main/java/com/merge/api/hris/AsyncAccountTokenClient.java +++ b/src/main/java/com/merge/api/hris/AsyncAccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.hris.types.AccountToken; +import com.merge.api.hris.types.RegenerateAccountToken; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -38,4 +39,18 @@ public CompletableFuture retrieve(String publicToken) { public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/merge/api/hris/AsyncGroupsClient.java b/src/main/java/com/merge/api/hris/AsyncGroupsClient.java index f08ada98f..99b01eb43 100644 --- a/src/main/java/com/merge/api/hris/AsyncGroupsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncGroupsClient.java @@ -9,6 +9,8 @@ import com.merge.api.hris.types.Group; import com.merge.api.hris.types.GroupsListRequest; import com.merge.api.hris.types.GroupsRetrieveRequest; +import com.merge.api.hris.types.GroupsTypesListRequest; +import com.merge.api.hris.types.GroupsTypesListResponse; import java.util.concurrent.CompletableFuture; public class AsyncGroupsClient { @@ -69,4 +71,26 @@ public CompletableFuture retrieve(String id, GroupsRetrieveRequest reques public CompletableFuture retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public CompletableFuture typesList() { + return this.rawClient.typesList().thenApply(response -> response.body()); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public CompletableFuture typesList(GroupsTypesListRequest request) { + return this.rawClient.typesList(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public CompletableFuture typesList( + GroupsTypesListRequest request, RequestOptions requestOptions) { + return this.rawClient.typesList(request, requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/merge/api/hris/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/hris/AsyncLinkTokenClient.java index f2ebd7ba7..7e7ccb0c6 100644 --- a/src/main/java/com/merge/api/hris/AsyncLinkTokenClient.java +++ b/src/main/java/com/merge/api/hris/AsyncLinkTokenClient.java @@ -27,14 +27,14 @@ public AsyncRawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request) { return this.rawClient.create(request).thenApply(response -> response.body()); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); diff --git a/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java index 275807e28..050d108dc 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(RequestO @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/hris/AsyncRawAccountTokenClient.java index ddf3e2769..a7287b2f2 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAccountTokenClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAccountTokenClient.java @@ -10,6 +10,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.hris.types.AccountToken; +import com.merge.api.hris.types.RegenerateAccountToken; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -18,6 +19,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; @@ -61,18 +63,70 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hris/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java index 8ad1c8352..f64fc9e81 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java @@ -73,19 +73,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -133,19 +130,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + responseBodyString, AsyncPassthroughRetrieveResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java index fb44a958a..ef309bee9 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java @@ -99,9 +99,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAuditLogEventList.class); + responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -122,12 +123,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java index 53f1c86bf..3f4c57fdf 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java b/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java index d396e3788..52e11ad58 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java @@ -149,9 +149,10 @@ public CompletableFuture>> lis @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedBankInfoList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBankInfoList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankInfoList.class); Optional startingAfter = parsedResponse.getNext(); BankInfoListRequest nextRequest = BankInfoListRequest.builder() .from(request) @@ -172,12 +173,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -253,17 +251,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankInfo.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankInfo.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java b/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java index b421bc017..815c375a8 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java @@ -129,9 +129,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedBenefitList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBenefitList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBenefitList.class); Optional startingAfter = parsedResponse.getNext(); BenefitsListRequest nextRequest = BenefitsListRequest.builder() .from(request) @@ -152,12 +153,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -225,17 +223,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Benefit.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Benefit.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java b/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java index 846e9b4f0..e6ddef4a0 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java @@ -121,9 +121,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCompanyList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCompanyList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyList.class); Optional startingAfter = parsedResponse.getNext(); CompaniesListRequest nextRequest = CompaniesListRequest.builder() .from(request) @@ -144,12 +145,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -213,17 +211,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Company.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Company.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java index 2add19910..4c77ace7d 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java @@ -63,11 +63,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java b/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java index 8b3dccf25..fa52ea252 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java @@ -72,6 +72,10 @@ public CompletableFuture>> li QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } if (request.getIncludeDeletedData().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -128,9 +132,10 @@ public CompletableFuture>> li @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedDependentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedDependentList.class); + PaginatedDependentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDependentList.class); Optional startingAfter = parsedResponse.getNext(); DependentsListRequest nextRequest = DependentsListRequest.builder() .from(request) @@ -151,12 +156,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,17 +229,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Dependent.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Dependent.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java index 8885dadba..ed2a06e5a 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java @@ -151,9 +151,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); EmployeePayrollRunsListRequest nextRequest = EmployeePayrollRunsListRequest.builder() .from(request) @@ -175,12 +176,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -249,18 +247,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeePayrollRun.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EmployeePayrollRun.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java index 3168b15de..8deb98de8 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java @@ -23,9 +23,7 @@ import com.merge.api.hris.types.PaginatedEmployeeList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -89,6 +87,10 @@ public CompletableFuture>> lis QueryStringMapper.addQueryParameter( httpUrl, "display_full_name", request.getDisplayFullName().get(), false); } + if (request.getEmployeeNumber().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_number", request.getEmployeeNumber().get(), false); + } if (request.getEmploymentStatus().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "employment_status", request.getEmploymentStatus().get(), false); @@ -225,9 +227,10 @@ public CompletableFuture>> lis @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEmployeeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); Optional startingAfter = parsedResponse.getNext(); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) @@ -248,12 +251,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -291,12 +291,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -316,18 +314,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeeResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EmployeeResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -410,17 +406,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Employee.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -480,11 +474,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -529,18 +521,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java index d8978ab51..137ae63d9 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java @@ -122,9 +122,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); EmployerBenefitsListRequest nextRequest = EmployerBenefitsListRequest.builder() .from(request) @@ -146,12 +147,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -216,18 +214,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployerBenefit.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EmployerBenefit.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java b/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java index 86b332359..36c7b02f9 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java @@ -142,9 +142,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedEmploymentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedEmploymentList.class); + PaginatedEmploymentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmploymentList.class); Optional startingAfter = parsedResponse.getNext(); EmploymentsListRequest nextRequest = EmploymentsListRequest.builder() .from(request) @@ -165,12 +166,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -246,18 +244,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employment.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Employment.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java index 5d6f6c9ea..5fe947d26 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.hris; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.hris.types.RemoteFieldApiResponse; import com.merge.api.hris.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -87,19 +84,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + responseBodyString, FieldMappingApiInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -137,17 +132,10 @@ public CompletableFuture> fie request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -167,19 +155,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,19 +213,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -276,25 +260,31 @@ public CompletableFuture> fie */ public CompletableFuture> fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hris/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -304,19 +294,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,19 +368,16 @@ public CompletableFuture> remoteFie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -438,19 +423,17 @@ public CompletableFuture> t @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + responseBodyString, ExternalTargetFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java index bd854af36..5a6fe6fac 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java @@ -63,19 +63,17 @@ public CompletableFuture>> syncStatusResyn @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java index 88afde0f4..4a4144118 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java b/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java index 6967fa665..54ce750a4 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java @@ -14,6 +14,8 @@ import com.merge.api.hris.types.Group; import com.merge.api.hris.types.GroupsListRequest; import com.merge.api.hris.types.GroupsRetrieveRequest; +import com.merge.api.hris.types.GroupsTypesListRequest; +import com.merge.api.hris.types.GroupsTypesListResponse; import com.merge.api.hris.types.PaginatedGroupList; import java.io.IOException; import java.util.Collections; @@ -144,9 +146,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedGroupList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); Optional startingAfter = parsedResponse.getNext(); GroupsListRequest nextRequest = GroupsListRequest.builder() .from(request) @@ -166,12 +169,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -243,17 +243,87 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public CompletableFuture> typesList() { + return typesList(GroupsTypesListRequest.builder().build()); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public CompletableFuture> typesList(GroupsTypesListRequest request) { + return typesList(request, null); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public CompletableFuture> typesList( + GroupsTypesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hris/v1/groups/types"); + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GroupsTypesListResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java index f7e148be1..49faf34c9 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java @@ -145,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -167,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,17 +216,15 @@ public CompletableFuture> retrieve(String id, Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java index 7f56c2420..a551f1fc8 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java @@ -34,14 +34,14 @@ public AsyncRawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create( EndUserDetailsRequest request, RequestOptions requestOptions) { @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java index 854c73838..b651be31e 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java @@ -138,9 +138,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -162,12 +163,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java b/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java index e5ab7a389..ee38bcc27 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java @@ -133,9 +133,10 @@ public CompletableFuture>> lis @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedLocationList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLocationList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLocationList.class); Optional startingAfter = parsedResponse.getNext(); LocationsListRequest nextRequest = LocationsListRequest.builder() .from(request) @@ -156,12 +157,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -233,17 +231,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Location.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Location.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java index 746c70f87..8b3634f3f 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java @@ -72,18 +72,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java b/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java index a1a43ec71..2667ee802 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java @@ -121,9 +121,10 @@ public CompletableFuture>> lis @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPayGroupList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPayGroupList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayGroupList.class); Optional startingAfter = parsedResponse.getNext(); PayGroupsListRequest nextRequest = PayGroupsListRequest.builder() .from(request) @@ -144,12 +145,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -213,17 +211,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayGroup.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PayGroup.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java b/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java index 4a42c4e9d..3a72d3734 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java @@ -150,9 +150,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedPayrollRunList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedPayrollRunList.class); + PaginatedPayrollRunList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayrollRunList.class); Optional startingAfter = parsedResponse.getNext(); PayrollRunsListRequest nextRequest = PayrollRunsListRequest.builder() .from(request) @@ -173,12 +174,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -250,18 +248,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayrollRun.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PayrollRun.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java index 1b6d12013..55ed71c55 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java b/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java index cd6fe31e5..772078797 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java @@ -64,18 +64,16 @@ public CompletableFuture> defaultScope @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -121,18 +119,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -187,18 +183,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java index c36d44efa..bd757c536 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java @@ -82,9 +82,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedSyncStatusList.class); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -105,12 +106,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java b/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java index 0cda15a13..f9ecd2d22 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java @@ -129,9 +129,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTeamList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); Optional startingAfter = parsedResponse.getNext(); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) @@ -151,12 +152,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -224,17 +222,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Team.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java b/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java index ac346facc..5c6110e2f 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java @@ -142,9 +142,10 @@ public CompletableFuture @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTimeOffBalanceList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedTimeOffBalanceList.class); + responseBodyString, PaginatedTimeOffBalanceList.class); Optional startingAfter = parsedResponse.getNext(); TimeOffBalancesListRequest nextRequest = TimeOffBalancesListRequest.builder() .from(request) @@ -166,12 +167,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -248,18 +246,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffBalance.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimeOffBalance.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java b/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java index a707636ff..7e8bf6439 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java @@ -21,9 +21,7 @@ import com.merge.api.hris.types.TimeOffRetrieveRequest; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -172,9 +170,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTimeOffList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimeOffList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimeOffList.class); Optional startingAfter = parsedResponse.getNext(); TimeOffListRequest nextRequest = TimeOffListRequest.builder() .from(request) @@ -195,12 +194,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -238,12 +234,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -263,18 +257,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimeOffResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -350,17 +342,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOff.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimeOff.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -405,18 +395,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java b/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java index fd1099107..a5f352d57 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java @@ -21,9 +21,7 @@ import com.merge.api.hris.types.TimesheetEntryResponse; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -157,9 +155,10 @@ public CompletableFuture @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTimesheetEntryList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedTimesheetEntryList.class); + responseBodyString, PaginatedTimesheetEntryList.class); Optional startingAfter = parsedResponse.getNext(); TimesheetEntriesListRequest nextRequest = TimesheetEntriesListRequest.builder() .from(request) @@ -181,12 +180,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -225,12 +221,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -250,19 +244,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), TimesheetEntryResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimesheetEntryResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -331,18 +322,16 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimesheetEntry.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimesheetEntry.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -387,18 +376,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java index 27c07d12d..dea7d405e 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java @@ -65,19 +65,17 @@ public CompletableFuture>> list(Reque @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -131,18 +129,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/hris/GroupsClient.java b/src/main/java/com/merge/api/hris/GroupsClient.java index 4f542c585..1117dc2d7 100644 --- a/src/main/java/com/merge/api/hris/GroupsClient.java +++ b/src/main/java/com/merge/api/hris/GroupsClient.java @@ -9,6 +9,8 @@ import com.merge.api.hris.types.Group; import com.merge.api.hris.types.GroupsListRequest; import com.merge.api.hris.types.GroupsRetrieveRequest; +import com.merge.api.hris.types.GroupsTypesListRequest; +import com.merge.api.hris.types.GroupsTypesListResponse; public class GroupsClient { protected final ClientOptions clientOptions; @@ -68,4 +70,25 @@ public Group retrieve(String id, GroupsRetrieveRequest request) { public Group retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(id, request, requestOptions).body(); } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public GroupsTypesListResponse typesList() { + return this.rawClient.typesList().body(); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public GroupsTypesListResponse typesList(GroupsTypesListRequest request) { + return this.rawClient.typesList(request).body(); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public GroupsTypesListResponse typesList(GroupsTypesListRequest request, RequestOptions requestOptions) { + return this.rawClient.typesList(request, requestOptions).body(); + } } diff --git a/src/main/java/com/merge/api/hris/LinkTokenClient.java b/src/main/java/com/merge/api/hris/LinkTokenClient.java index c6a50a7f6..adef6970c 100644 --- a/src/main/java/com/merge/api/hris/LinkTokenClient.java +++ b/src/main/java/com/merge/api/hris/LinkTokenClient.java @@ -26,14 +26,14 @@ public RawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request) { return this.rawClient.create(request).body(); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); diff --git a/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java b/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java index 9ddafde1d..1985ef072 100644 --- a/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOptio } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawAccountTokenClient.java b/src/main/java/com/merge/api/hris/RawAccountTokenClient.java index 0e16fac96..18115d5c7 100644 --- a/src/main/java/com/merge/api/hris/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/hris/RawAccountTokenClient.java @@ -10,11 +10,13 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.hris.types.AccountToken; +import com.merge.api.hris.types.RegenerateAccountToken; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; @@ -53,16 +55,53 @@ public MergeApiHttpResponse retrieve(String publicToken, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hris/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java index 3c05abaec..8d83d82e2 100644 --- a/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java @@ -66,17 +66,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -111,18 +108,14 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawAuditTrailClient.java b/src/main/java/com/merge/api/hris/RawAuditTrailClient.java index 16817f8f7..eb3d1cce8 100644 --- a/src/main/java/com/merge/api/hris/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/hris/RawAuditTrailClient.java @@ -90,9 +90,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -106,12 +107,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java b/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java index 43bd22aed..d33b08785 100644 --- a/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawBankInfoClient.java b/src/main/java/com/merge/api/hris/RawBankInfoClient.java index 4f73b54e5..4cab73bc4 100644 --- a/src/main/java/com/merge/api/hris/RawBankInfoClient.java +++ b/src/main/java/com/merge/api/hris/RawBankInfoClient.java @@ -141,9 +141,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedBankInfoList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBankInfoList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankInfoList.class); Optional startingAfter = parsedResponse.getNext(); BankInfoListRequest nextRequest = BankInfoListRequest.builder() .from(request) @@ -156,12 +157,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -225,16 +222,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), BankInfo.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, BankInfo.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawBenefitsClient.java b/src/main/java/com/merge/api/hris/RawBenefitsClient.java index c27e71dca..f291e6847 100644 --- a/src/main/java/com/merge/api/hris/RawBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/RawBenefitsClient.java @@ -121,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedBenefitList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedBenefitList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBenefitList.class); Optional startingAfter = parsedResponse.getNext(); BenefitsListRequest nextRequest = BenefitsListRequest.builder() .from(request) @@ -136,12 +137,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -197,16 +194,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Benefit.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Benefit.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawCompaniesClient.java b/src/main/java/com/merge/api/hris/RawCompaniesClient.java index 45455a446..442ebb5bf 100644 --- a/src/main/java/com/merge/api/hris/RawCompaniesClient.java +++ b/src/main/java/com/merge/api/hris/RawCompaniesClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCompanyList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCompanyList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyList.class); Optional startingAfter = parsedResponse.getNext(); CompaniesListRequest nextRequest = CompaniesListRequest.builder() .from(request) @@ -128,12 +129,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -185,16 +182,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Company.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Company.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java b/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java index 3cb5ea479..018239117 100644 --- a/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java @@ -55,11 +55,8 @@ public MergeApiHttpResponse delete(RequestOptions requestOptions) { return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawDependentsClient.java b/src/main/java/com/merge/api/hris/RawDependentsClient.java index 895bad81d..2bd817c44 100644 --- a/src/main/java/com/merge/api/hris/RawDependentsClient.java +++ b/src/main/java/com/merge/api/hris/RawDependentsClient.java @@ -67,6 +67,10 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); } + if (request.getEmployeeId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_id", request.getEmployeeId().get(), false); + } if (request.getIncludeDeletedData().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -120,9 +124,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedDependentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedDependentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDependentList.class); Optional startingAfter = parsedResponse.getNext(); DependentsListRequest nextRequest = DependentsListRequest.builder() .from(request) @@ -135,12 +140,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -199,16 +200,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Dependent.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Dependent.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java b/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java index efe2db4fa..0ef93a9b4 100644 --- a/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java @@ -141,9 +141,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedEmployeePayrollRunList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedEmployeePayrollRunList.class); + PaginatedEmployeePayrollRunList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeePayrollRunList.class); Optional startingAfter = parsedResponse.getNext(); EmployeePayrollRunsListRequest nextRequest = EmployeePayrollRunsListRequest.builder() .from(request) @@ -157,12 +158,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -218,16 +215,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeePayrollRun.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EmployeePayrollRun.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawEmployeesClient.java b/src/main/java/com/merge/api/hris/RawEmployeesClient.java index 308955eb5..5cb5fcb46 100644 --- a/src/main/java/com/merge/api/hris/RawEmployeesClient.java +++ b/src/main/java/com/merge/api/hris/RawEmployeesClient.java @@ -23,9 +23,7 @@ import com.merge.api.hris.types.PaginatedEmployeeList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -84,6 +82,10 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "display_full_name", request.getDisplayFullName().get(), false); } + if (request.getEmployeeNumber().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "employee_number", request.getEmployeeNumber().get(), false); + } if (request.getEmploymentStatus().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "employment_status", request.getEmploymentStatus().get(), false); @@ -217,9 +219,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEmployeeList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployeeList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); Optional startingAfter = parsedResponse.getNext(); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) @@ -232,12 +235,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -266,12 +265,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -288,16 +285,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployeeResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EmployeeResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -368,16 +362,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employee.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Employee.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -423,11 +414,8 @@ public MergeApiHttpResponse ignoreCreate( return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -460,16 +448,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java b/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java index 63bc9bfbe..8b1a95d0e 100644 --- a/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEmployerBenefitList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmployerBenefitList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployerBenefitList.class); Optional startingAfter = parsedResponse.getNext(); EmployerBenefitsListRequest nextRequest = EmployerBenefitsListRequest.builder() .from(request) @@ -129,12 +130,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -186,16 +183,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), EmployerBenefit.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, EmployerBenefit.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawEmploymentsClient.java b/src/main/java/com/merge/api/hris/RawEmploymentsClient.java index 2aa345b5e..1a2efa954 100644 --- a/src/main/java/com/merge/api/hris/RawEmploymentsClient.java +++ b/src/main/java/com/merge/api/hris/RawEmploymentsClient.java @@ -133,9 +133,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedEmploymentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedEmploymentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmploymentList.class); Optional startingAfter = parsedResponse.getNext(); EmploymentsListRequest nextRequest = EmploymentsListRequest.builder() .from(request) @@ -149,12 +150,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -218,16 +215,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Employment.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Employment.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawFieldMappingClient.java b/src/main/java/com/merge/api/hris/RawFieldMappingClient.java index a018105b7..4e8ad6249 100644 --- a/src/main/java/com/merge/api/hris/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/hris/RawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.hris; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.hris.types.RemoteFieldApiResponse; import com.merge.api.hris.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -80,18 +77,14 @@ public MergeApiHttpResponse fieldMappingsRetrie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -119,17 +112,10 @@ public MergeApiHttpResponse fieldMappingsCreate( request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -146,17 +132,14 @@ public MergeApiHttpResponse fieldMappingsCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,17 +174,14 @@ public MergeApiHttpResponse fieldMappingsDestroy( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -228,42 +208,45 @@ public MergeApiHttpResponse fieldMappingsPartialUp */ public MergeApiHttpResponse fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("hris/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -314,17 +297,14 @@ public MergeApiHttpResponse remoteFieldsRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -357,18 +337,14 @@ public MergeApiHttpResponse targetFieldsRetrieve } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawForceResyncClient.java b/src/main/java/com/merge/api/hris/RawForceResyncClient.java index 9ab174d8e..f9cef2c28 100644 --- a/src/main/java/com/merge/api/hris/RawForceResyncClient.java +++ b/src/main/java/com/merge/api/hris/RawForceResyncClient.java @@ -55,18 +55,15 @@ public MergeApiHttpResponse> syncStatusResyncCreate(RequestOpti } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java b/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java index 484f787cc..70c883578 100644 --- a/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawGroupsClient.java b/src/main/java/com/merge/api/hris/RawGroupsClient.java index 6dc69d9f7..945e1db56 100644 --- a/src/main/java/com/merge/api/hris/RawGroupsClient.java +++ b/src/main/java/com/merge/api/hris/RawGroupsClient.java @@ -14,6 +14,8 @@ import com.merge.api.hris.types.Group; import com.merge.api.hris.types.GroupsListRequest; import com.merge.api.hris.types.GroupsRetrieveRequest; +import com.merge.api.hris.types.GroupsTypesListRequest; +import com.merge.api.hris.types.GroupsTypesListResponse; import com.merge.api.hris.types.PaginatedGroupList; import java.io.IOException; import java.util.Collections; @@ -136,9 +138,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedGroupList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedGroupList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); Optional startingAfter = parsedResponse.getNext(); GroupsListRequest nextRequest = GroupsListRequest.builder() .from(request) @@ -151,12 +154,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -216,16 +215,71 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Group.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public MergeApiHttpResponse typesList() { + return typesList(GroupsTypesListRequest.builder().build()); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public MergeApiHttpResponse typesList(GroupsTypesListRequest request) { + return typesList(request, null); + } + + /** + * Returns a list of distinct group type values from the Groups common model. + */ + public MergeApiHttpResponse typesList( + GroupsTypesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("hris/v1/groups/types"); + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, GroupsTypesListResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawIssuesClient.java b/src/main/java/com/merge/api/hris/RawIssuesClient.java index 1c753f97f..c85a1cf0a 100644 --- a/src/main/java/com/merge/api/hris/RawIssuesClient.java +++ b/src/main/java/com/merge/api/hris/RawIssuesClient.java @@ -137,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -152,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,16 +188,13 @@ public MergeApiHttpResponse retrieve(String id, RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawLinkTokenClient.java b/src/main/java/com/merge/api/hris/RawLinkTokenClient.java index 19979b229..fc44cfb6e 100644 --- a/src/main/java/com/merge/api/hris/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/hris/RawLinkTokenClient.java @@ -30,14 +30,14 @@ public RawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(EndUserDetailsRequest request, Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java index 93d246df2..21a91c587 100644 --- a/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java @@ -128,9 +128,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); Optional startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -145,12 +146,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawLocationsClient.java b/src/main/java/com/merge/api/hris/RawLocationsClient.java index 08ac35f54..c2a42ee1a 100644 --- a/src/main/java/com/merge/api/hris/RawLocationsClient.java +++ b/src/main/java/com/merge/api/hris/RawLocationsClient.java @@ -125,9 +125,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedLocationList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedLocationList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLocationList.class); Optional startingAfter = parsedResponse.getNext(); LocationsListRequest nextRequest = LocationsListRequest.builder() .from(request) @@ -140,12 +141,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -205,16 +202,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Location.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Location.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawPassthroughClient.java b/src/main/java/com/merge/api/hris/RawPassthroughClient.java index e8e662f6d..8323ad3cc 100644 --- a/src/main/java/com/merge/api/hris/RawPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/RawPassthroughClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(DataPassthroughRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawPayGroupsClient.java b/src/main/java/com/merge/api/hris/RawPayGroupsClient.java index 6407b80b1..7a0fffd53 100644 --- a/src/main/java/com/merge/api/hris/RawPayGroupsClient.java +++ b/src/main/java/com/merge/api/hris/RawPayGroupsClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPayGroupList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPayGroupList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayGroupList.class); Optional startingAfter = parsedResponse.getNext(); PayGroupsListRequest nextRequest = PayGroupsListRequest.builder() .from(request) @@ -128,12 +129,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -185,16 +182,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayGroup.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PayGroup.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java b/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java index 29d1841b5..76037440d 100644 --- a/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java @@ -141,9 +141,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedPayrollRunList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedPayrollRunList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayrollRunList.class); Optional startingAfter = parsedResponse.getNext(); PayrollRunsListRequest nextRequest = PayrollRunsListRequest.builder() .from(request) @@ -157,12 +158,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -222,16 +219,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PayrollRun.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PayrollRun.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java index ca1c148d6..61eae4e54 100644 --- a/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java @@ -65,16 +65,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawScopesClient.java b/src/main/java/com/merge/api/hris/RawScopesClient.java index ac4d9c26a..a3b4ea144 100644 --- a/src/main/java/com/merge/api/hris/RawScopesClient.java +++ b/src/main/java/com/merge/api/hris/RawScopesClient.java @@ -56,17 +56,13 @@ public MergeApiHttpResponse defaultScopesRetrieve(RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -99,17 +95,13 @@ public MergeApiHttpResponse linkedAccountScopesRetrieve(Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -152,17 +144,13 @@ public MergeApiHttpResponse linkedAccountScopesCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawSyncStatusClient.java b/src/main/java/com/merge/api/hris/RawSyncStatusClient.java index 233ee3ebc..858fa9b94 100644 --- a/src/main/java/com/merge/api/hris/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/hris/RawSyncStatusClient.java @@ -74,9 +74,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedSyncStatusList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -90,12 +91,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawTeamsClient.java b/src/main/java/com/merge/api/hris/RawTeamsClient.java index ab0c4c26a..445494260 100644 --- a/src/main/java/com/merge/api/hris/RawTeamsClient.java +++ b/src/main/java/com/merge/api/hris/RawTeamsClient.java @@ -121,9 +121,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTeamList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); Optional startingAfter = parsedResponse.getNext(); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) @@ -136,12 +137,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -196,16 +193,13 @@ public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Team.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java b/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java index 56bb0950f..bd375212d 100644 --- a/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java +++ b/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java @@ -133,9 +133,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTimeOffBalanceList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimeOffBalanceList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimeOffBalanceList.class); Optional startingAfter = parsedResponse.getNext(); TimeOffBalancesListRequest nextRequest = TimeOffBalancesListRequest.builder() .from(request) @@ -149,12 +150,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -218,16 +215,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffBalance.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimeOffBalance.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawTimeOffClient.java b/src/main/java/com/merge/api/hris/RawTimeOffClient.java index 7d00737d8..f8ea274a6 100644 --- a/src/main/java/com/merge/api/hris/RawTimeOffClient.java +++ b/src/main/java/com/merge/api/hris/RawTimeOffClient.java @@ -21,9 +21,7 @@ import com.merge.api.hris.types.TimeOffRetrieveRequest; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -164,9 +162,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTimeOffList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimeOffList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimeOffList.class); Optional startingAfter = parsedResponse.getNext(); TimeOffListRequest nextRequest = TimeOffListRequest.builder() .from(request) @@ -179,12 +178,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -212,12 +207,10 @@ public MergeApiHttpResponse create(TimeOffEndpointRequest reque QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -234,16 +227,13 @@ public MergeApiHttpResponse create(TimeOffEndpointRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOffResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimeOffResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -307,16 +297,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimeOff.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimeOff.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -349,16 +336,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java b/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java index ad3672462..94db14d07 100644 --- a/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java +++ b/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java @@ -21,9 +21,7 @@ import com.merge.api.hris.types.TimesheetEntryResponse; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -148,9 +146,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTimesheetEntryList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTimesheetEntryList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimesheetEntryList.class); Optional startingAfter = parsedResponse.getNext(); TimesheetEntriesListRequest nextRequest = TimesheetEntriesListRequest.builder() .from(request) @@ -164,12 +163,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -198,12 +193,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -220,17 +213,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimesheetEntryResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimesheetEntryResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -286,16 +276,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TimesheetEntry.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TimesheetEntry.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -328,16 +315,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java index f1ea223f2..a86c8fce4 100644 --- a/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java @@ -58,18 +58,15 @@ public MergeApiHttpResponse> list(RequestOptions requestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -110,16 +107,13 @@ public MergeApiHttpResponse create(WebhookReceiverRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/hris/types/AccountDetails.java b/src/main/java/com/merge/api/hris/types/AccountDetails.java index a3367a6c6..08e825409 100644 --- a/src/main/java/com/merge/api/hris/types/AccountDetails.java +++ b/src/main/java/com/merge/api/hris/types/AccountDetails.java @@ -45,6 +45,10 @@ public final class AccountDetails { private final Optional completedAt; + private final Optional instanceId; + + private final Optional instanceDisplayValue; + private final Map additionalProperties; private AccountDetails( @@ -60,6 +64,8 @@ private AccountDetails( Optional isDuplicate, Optional accountType, Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, Map additionalProperties) { this.id = id; this.integration = integration; @@ -73,6 +79,8 @@ private AccountDetails( this.isDuplicate = isDuplicate; this.accountType = accountType; this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; this.additionalProperties = additionalProperties; } @@ -142,6 +150,16 @@ public Optional getCompletedAt() { return completedAt; } + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -165,7 +183,9 @@ private boolean equalTo(AccountDetails other) { && webhookListenerUrl.equals(other.webhookListenerUrl) && isDuplicate.equals(other.isDuplicate) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); } @java.lang.Override @@ -182,7 +202,9 @@ public int hashCode() { this.webhookListenerUrl, this.isDuplicate, this.accountType, - this.completedAt); + this.completedAt, + this.instanceId, + this.instanceDisplayValue); } @java.lang.Override @@ -220,6 +242,10 @@ public static final class Builder { private Optional completedAt = Optional.empty(); + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -238,6 +264,8 @@ public Builder from(AccountDetails other) { isDuplicate(other.getIsDuplicate()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); return this; } @@ -379,6 +407,28 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + public AccountDetails build() { return new AccountDetails( id, @@ -393,6 +443,8 @@ public AccountDetails build() { isDuplicate, accountType, completedAt, + instanceId, + instanceDisplayValue, additionalProperties); } } diff --git a/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java index b1bd1afca..b72f67e87 100644 --- a/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -48,6 +49,8 @@ public final class AccountDetailsAndActions { private final OffsetDateTime completedAt; + private final Optional> integrationSpecificFields; + private final Map additionalProperties; private AccountDetailsAndActions( @@ -64,6 +67,7 @@ private AccountDetailsAndActions( Optional integration, String accountType, OffsetDateTime completedAt, + Optional> integrationSpecificFields, Map additionalProperties) { this.id = id; this.category = category; @@ -78,6 +82,7 @@ private AccountDetailsAndActions( this.integration = integration; this.accountType = accountType; this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; this.additionalProperties = additionalProperties; } @@ -152,6 +157,11 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -176,7 +186,8 @@ private boolean equalTo(AccountDetailsAndActions other) { && isDuplicate.equals(other.isDuplicate) && integration.equals(other.integration) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); } @java.lang.Override @@ -194,7 +205,8 @@ public int hashCode() { this.isDuplicate, this.integration, this.accountType, - this.completedAt); + this.completedAt, + this.integrationSpecificFields); } @java.lang.Override @@ -268,6 +280,10 @@ public interface _FinalStage { _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -294,6 +310,8 @@ public static final class Builder private OffsetDateTime completedAt; + private Optional> integrationSpecificFields = Optional.empty(); + private Optional integration = Optional.empty(); private Optional isDuplicate = Optional.empty(); @@ -326,6 +344,7 @@ public Builder from(AccountDetailsAndActions other) { integration(other.getIntegration()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); return this; } @@ -378,6 +397,19 @@ public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { return this; } + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + @java.lang.Override public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { this.integration = Optional.ofNullable(integration); @@ -486,6 +518,7 @@ public AccountDetailsAndActions build() { integration, accountType, completedAt, + integrationSpecificFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/hris/types/AuditLogEvent.java b/src/main/java/com/merge/api/hris/types/AuditLogEvent.java index 72bb37dbb..dc8253cbd 100644 --- a/src/main/java/com/merge/api/hris/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/hris/types/AuditLogEvent.java @@ -91,6 +91,7 @@ public Optional getUserEmail() { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ @JsonProperty("role") @@ -220,6 +221,7 @@ public interface RoleStage { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * */ IpAddressStage role(@NotNull AuditLogEventRole role); @@ -359,6 +361,7 @@ public Builder from(AuditLogEvent other) { *
  • API - API
  • *
  • SYSTEM - SYSTEM
  • *
  • MERGE_TEAM - MERGE_TEAM
  • + *
  • SUPPORT - SUPPORT
  • * *

    Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

    *
      @@ -368,6 +371,7 @@ public Builder from(AuditLogEvent other) { *
    • API - API
    • *
    • SYSTEM - SYSTEM
    • *
    • MERGE_TEAM - MERGE_TEAM
    • + *
    • SUPPORT - SUPPORT
    • *
    * @return Reference to {@code this} so that method calls can be chained together. */ diff --git a/src/main/java/com/merge/api/hris/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/hris/types/AuditTrailListRequest.java index 2b612a0b3..522e5da9a 100644 --- a/src/main/java/com/merge/api/hris/types/AuditTrailListRequest.java +++ b/src/main/java/com/merge/api/hris/types/AuditTrailListRequest.java @@ -68,7 +68,7 @@ public Optional getEndDate() { } /** - * @return 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, 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 + * @return 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 */ @JsonProperty("event_type") public Optional getEventType() { @@ -76,7 +76,7 @@ public Optional getEventType() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -191,7 +191,7 @@ public Builder endDate(String endDate) { } /** - *

    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, 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

    + *

    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

    */ @JsonSetter(value = "event_type", nulls = Nulls.SKIP) public Builder eventType(Optional eventType) { @@ -205,7 +205,7 @@ public Builder eventType(String eventType) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java b/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java index 6a566e69c..a866147e8 100644 --- a/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java @@ -207,7 +207,7 @@ public Optional getOrderBy() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -554,7 +554,7 @@ public Builder orderBy(BankInfoListRequestOrderBy orderBy) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/Benefit.java b/src/main/java/com/merge/api/hris/types/Benefit.java index 633107843..6c5bd85eb 100644 --- a/src/main/java/com/merge/api/hris/types/Benefit.java +++ b/src/main/java/com/merge/api/hris/types/Benefit.java @@ -45,10 +45,10 @@ public final class Benefit { private final Optional endDate; - private final Optional remoteWasDeleted; - private final Optional employerBenefit; + private final Optional remoteWasDeleted; + private final Optional> fieldMappings; private final Optional> remoteData; @@ -67,8 +67,8 @@ private Benefit( Optional companyContribution, Optional startDate, Optional endDate, - Optional remoteWasDeleted, Optional employerBenefit, + Optional remoteWasDeleted, Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { @@ -83,8 +83,8 @@ private Benefit( this.companyContribution = companyContribution; this.startDate = startDate; this.endDate = endDate; - this.remoteWasDeleted = remoteWasDeleted; this.employerBenefit = employerBenefit; + this.remoteWasDeleted = remoteWasDeleted; this.fieldMappings = fieldMappings; this.remoteData = remoteData; this.additionalProperties = additionalProperties; @@ -175,14 +175,6 @@ public Optional getEndDate() { return endDate; } - /** - * @return 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. - */ - @JsonProperty("remote_was_deleted") - public Optional getRemoteWasDeleted() { - return remoteWasDeleted; - } - /** * @return The employer benefit plan the employee is enrolled in. */ @@ -191,6 +183,14 @@ public Optional getEmployerBenefit() { return employerBenefit; } + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + @JsonProperty("field_mappings") public Optional> getFieldMappings() { return fieldMappings; @@ -224,8 +224,8 @@ private boolean equalTo(Benefit other) { && companyContribution.equals(other.companyContribution) && startDate.equals(other.startDate) && endDate.equals(other.endDate) - && remoteWasDeleted.equals(other.remoteWasDeleted) && employerBenefit.equals(other.employerBenefit) + && remoteWasDeleted.equals(other.remoteWasDeleted) && fieldMappings.equals(other.fieldMappings) && remoteData.equals(other.remoteData); } @@ -244,8 +244,8 @@ public int hashCode() { this.companyContribution, this.startDate, this.endDate, - this.remoteWasDeleted, this.employerBenefit, + this.remoteWasDeleted, this.fieldMappings, this.remoteData); } @@ -283,10 +283,10 @@ public static final class Builder { private Optional endDate = Optional.empty(); - private Optional remoteWasDeleted = Optional.empty(); - private Optional employerBenefit = Optional.empty(); + private Optional remoteWasDeleted = Optional.empty(); + private Optional> fieldMappings = Optional.empty(); private Optional> remoteData = Optional.empty(); @@ -308,8 +308,8 @@ public Builder from(Benefit other) { companyContribution(other.getCompanyContribution()); startDate(other.getStartDate()); endDate(other.getEndDate()); - remoteWasDeleted(other.getRemoteWasDeleted()); employerBenefit(other.getEmployerBenefit()); + remoteWasDeleted(other.getRemoteWasDeleted()); fieldMappings(other.getFieldMappings()); remoteData(other.getRemoteData()); return this; @@ -467,30 +467,30 @@ public Builder endDate(OffsetDateTime endDate) { } /** - *

    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.

    + *

    The employer benefit plan the employee is enrolled in.

    */ - @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) - public Builder remoteWasDeleted(Optional remoteWasDeleted) { - this.remoteWasDeleted = remoteWasDeleted; + @JsonSetter(value = "employer_benefit", nulls = Nulls.SKIP) + public Builder employerBenefit(Optional employerBenefit) { + this.employerBenefit = employerBenefit; return this; } - public Builder remoteWasDeleted(Boolean remoteWasDeleted) { - this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + public Builder employerBenefit(String employerBenefit) { + this.employerBenefit = Optional.ofNullable(employerBenefit); return this; } /** - *

    The employer benefit plan the employee is enrolled in.

    + *

    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.

    */ - @JsonSetter(value = "employer_benefit", nulls = Nulls.SKIP) - public Builder employerBenefit(Optional employerBenefit) { - this.employerBenefit = employerBenefit; + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; return this; } - public Builder employerBenefit(String employerBenefit) { - this.employerBenefit = Optional.ofNullable(employerBenefit); + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); return this; } @@ -529,8 +529,8 @@ public Benefit build() { companyContribution, startDate, endDate, - remoteWasDeleted, employerBenefit, + remoteWasDeleted, fieldMappings, remoteData, additionalProperties); diff --git a/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java b/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java index 570da3daf..bd09b3f69 100644 --- a/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java b/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java index be2f48358..8c55aad6a 100644 --- a/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/hris/types/CreateFieldMappingRequest.java index 56bf31f63..b11bfbaf9 100644 --- a/src/main/java/com/merge/api/hris/types/CreateFieldMappingRequest.java +++ b/src/main/java/com/merge/api/hris/types/CreateFieldMappingRequest.java @@ -38,6 +38,8 @@ public final class CreateFieldMappingRequest { private final String commonModelName; + private final Optional jmesPath; + private final Map additionalProperties; private CreateFieldMappingRequest( @@ -48,6 +50,7 @@ private CreateFieldMappingRequest( String remoteMethod, String remoteUrlPath, String commonModelName, + Optional jmesPath, Map additionalProperties) { this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; this.targetFieldName = targetFieldName; @@ -56,6 +59,7 @@ private CreateFieldMappingRequest( this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; this.commonModelName = commonModelName; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -115,6 +119,14 @@ public String getCommonModelName() { return commonModelName; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -133,7 +145,8 @@ private boolean equalTo(CreateFieldMappingRequest other) { && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath); } @java.lang.Override @@ -145,7 +158,8 @@ public int hashCode() { this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath, - this.commonModelName); + this.commonModelName, + this.jmesPath); } @java.lang.Override @@ -212,6 +226,13 @@ public interface _FinalStage { _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -232,6 +253,8 @@ public static final class Builder private String commonModelName; + private Optional jmesPath = Optional.empty(); + private List remoteFieldTraversalPath = new ArrayList<>(); private Optional excludeRemoteFieldMetadata = Optional.empty(); @@ -250,6 +273,7 @@ public Builder from(CreateFieldMappingRequest other) { remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); return this; } @@ -313,6 +337,26 @@ public _FinalStage commonModelName(@NotNull String commonModelName) { return this; } + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

    JMES path to specify json query expression to be used on field mapping.

    + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + /** *

    The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

    * @return Reference to {@code this} so that method calls can be chained together. @@ -378,6 +422,7 @@ public CreateFieldMappingRequest build() { remoteMethod, remoteUrlPath, commonModelName, + jmesPath, additionalProperties); } } diff --git a/src/main/java/com/merge/api/hris/types/DependentsListRequest.java b/src/main/java/com/merge/api/hris/types/DependentsListRequest.java index 9c3c9a64c..a998e3c02 100644 --- a/src/main/java/com/merge/api/hris/types/DependentsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/DependentsListRequest.java @@ -27,6 +27,8 @@ public final class DependentsListRequest { private final Optional cursor; + private final Optional employeeId; + private final Optional includeDeletedData; private final Optional includeRemoteData; @@ -49,6 +51,7 @@ private DependentsListRequest( Optional createdAfter, Optional createdBefore, Optional cursor, + Optional employeeId, Optional includeDeletedData, Optional includeRemoteData, Optional includeSensitiveFields, @@ -61,6 +64,7 @@ private DependentsListRequest( this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; + this.employeeId = employeeId; this.includeDeletedData = includeDeletedData; this.includeRemoteData = includeRemoteData; this.includeSensitiveFields = includeSensitiveFields; @@ -96,6 +100,14 @@ public Optional getCursor() { return cursor; } + /** + * @return If provided, will only return dependents for this employee. + */ + @JsonProperty("employee_id") + public Optional getEmployeeId() { + return employeeId; + } + /** * @return 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. */ @@ -145,7 +157,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -175,6 +187,7 @@ private boolean equalTo(DependentsListRequest other) { return createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) + && employeeId.equals(other.employeeId) && includeDeletedData.equals(other.includeDeletedData) && includeRemoteData.equals(other.includeRemoteData) && includeSensitiveFields.equals(other.includeSensitiveFields) @@ -191,6 +204,7 @@ public int hashCode() { this.createdAfter, this.createdBefore, this.cursor, + this.employeeId, this.includeDeletedData, this.includeRemoteData, this.includeSensitiveFields, @@ -218,6 +232,8 @@ public static final class Builder { private Optional cursor = Optional.empty(); + private Optional employeeId = Optional.empty(); + private Optional includeDeletedData = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -243,6 +259,7 @@ public Builder from(DependentsListRequest other) { createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); + employeeId(other.getEmployeeId()); includeDeletedData(other.getIncludeDeletedData()); includeRemoteData(other.getIncludeRemoteData()); includeSensitiveFields(other.getIncludeSensitiveFields()); @@ -296,6 +313,20 @@ public Builder cursor(String cursor) { return this; } + /** + *

    If provided, will only return dependents for this employee.

    + */ + @JsonSetter(value = "employee_id", nulls = Nulls.SKIP) + public Builder employeeId(Optional employeeId) { + this.employeeId = employeeId; + return this; + } + + public Builder employeeId(String employeeId) { + this.employeeId = Optional.ofNullable(employeeId); + return this; + } + /** *

    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.

    */ @@ -381,7 +412,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -413,6 +444,7 @@ public DependentsListRequest build() { createdAfter, createdBefore, cursor, + employeeId, includeDeletedData, includeRemoteData, includeSensitiveFields, diff --git a/src/main/java/com/merge/api/hris/types/Employee.java b/src/main/java/com/merge/api/hris/types/Employee.java index d6a966542..e4e72b528 100644 --- a/src/main/java/com/merge/api/hris/types/Employee.java +++ b/src/main/java/com/merge/api/hris/types/Employee.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Employee.Builder.class) public final class Employee { + private final Optional employeeUrl; + private final Optional id; private final Optional remoteId; @@ -98,6 +100,7 @@ public final class Employee { private final Map additionalProperties; private Employee( + Optional employeeUrl, Optional id, Optional remoteId, Optional createdAt, @@ -135,6 +138,7 @@ private Employee( Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { + this.employeeUrl = employeeUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -174,6 +178,14 @@ private Employee( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the employee. + */ + @JsonProperty("employee_url") + public Optional getEmployeeUrl() { + return employeeUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -491,7 +503,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(Employee other) { - return id.equals(other.id) + return employeeUrl.equals(other.employeeUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -532,6 +545,7 @@ private boolean equalTo(Employee other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.employeeUrl, this.id, this.remoteId, this.createdAt, @@ -581,6 +595,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional employeeUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -659,6 +675,7 @@ public static final class Builder { private Builder() {} public Builder from(Employee other) { + employeeUrl(other.getEmployeeUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -698,6 +715,20 @@ public Builder from(Employee other) { return this; } + /** + *

    The 3rd party URL of the employee.

    + */ + @JsonSetter(value = "employee_url", nulls = Nulls.SKIP) + public Builder employeeUrl(Optional employeeUrl) { + this.employeeUrl = employeeUrl; + return this; + } + + public Builder employeeUrl(String employeeUrl) { + this.employeeUrl = Optional.ofNullable(employeeUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -1221,6 +1252,7 @@ public Builder remoteData(List remoteData) { public Employee build() { return new Employee( + employeeUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequest.java b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequest.java index b7c456291..3112c127e 100644 --- a/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequest.java @@ -195,7 +195,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -532,7 +532,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

    Number of results to return per page.

    + *

    Number of results to return per page. The maximum limit is 100.

    */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/EmployeeRequest.java b/src/main/java/com/merge/api/hris/types/EmployeeRequest.java index 3e9258931..2b23be03e 100644 --- a/src/main/java/com/merge/api/hris/types/EmployeeRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequest.java @@ -27,6 +27,8 @@ public final class EmployeeRequest { private final Optional company; + private final Optional employeeUrl; + private final Optional firstName; private final Optional lastName; @@ -86,6 +88,7 @@ public final class EmployeeRequest { private EmployeeRequest( Optional employeeNumber, Optional company, + Optional employeeUrl, Optional firstName, Optional lastName, Optional preferredName, @@ -116,6 +119,7 @@ private EmployeeRequest( Map additionalProperties) { this.employeeNumber = employeeNumber; this.company = company; + this.employeeUrl = employeeUrl; this.firstName = firstName; this.lastName = lastName; this.preferredName = preferredName; @@ -162,6 +166,14 @@ public Optional getCompany() { return company; } + /** + * @return The 3rd party URL of the employee. + */ + @JsonProperty("employee_url") + public Optional getEmployeeUrl() { + return employeeUrl; + } + /** * @return The employee's first name. */ @@ -412,6 +424,7 @@ public Map getAdditionalProperties() { private boolean equalTo(EmployeeRequest other) { return employeeNumber.equals(other.employeeNumber) && company.equals(other.company) + && employeeUrl.equals(other.employeeUrl) && firstName.equals(other.firstName) && lastName.equals(other.lastName) && preferredName.equals(other.preferredName) @@ -446,6 +459,7 @@ public int hashCode() { return Objects.hash( this.employeeNumber, this.company, + this.employeeUrl, this.firstName, this.lastName, this.preferredName, @@ -490,6 +504,8 @@ public static final class Builder { private Optional company = Optional.empty(); + private Optional employeeUrl = Optional.empty(); + private Optional firstName = Optional.empty(); private Optional lastName = Optional.empty(); @@ -552,6 +568,7 @@ private Builder() {} public Builder from(EmployeeRequest other) { employeeNumber(other.getEmployeeNumber()); company(other.getCompany()); + employeeUrl(other.getEmployeeUrl()); firstName(other.getFirstName()); lastName(other.getLastName()); preferredName(other.getPreferredName()); @@ -610,6 +627,20 @@ public Builder company(EmployeeRequestCompany company) { return this; } + /** + *

    The 3rd party URL of the employee.

    + */ + @JsonSetter(value = "employee_url", nulls = Nulls.SKIP) + public Builder employeeUrl(Optional employeeUrl) { + this.employeeUrl = employeeUrl; + return this; + } + + public Builder employeeUrl(String employeeUrl) { + this.employeeUrl = Optional.ofNullable(employeeUrl); + return this; + } + /** *

    The employee's first name.

    */ @@ -1012,6 +1043,7 @@ public EmployeeRequest build() { return new EmployeeRequest( employeeNumber, company, + employeeUrl, firstName, lastName, preferredName, diff --git a/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java b/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java index 5953d1bf5..d4d86e240 100644 --- a/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java @@ -35,6 +35,8 @@ public final class EmployeesListRequest { private final Optional displayFullName; + private final Optional employeeNumber; + private final Optional employmentStatus; private final Optional employmentType; @@ -98,6 +100,7 @@ private EmployeesListRequest( Optional createdBefore, Optional cursor, Optional displayFullName, + Optional employeeNumber, Optional employmentStatus, Optional employmentType, Optional firstName, @@ -132,6 +135,7 @@ private EmployeesListRequest( this.createdBefore = createdBefore; this.cursor = cursor; this.displayFullName = displayFullName; + this.employeeNumber = employeeNumber; this.employmentStatus = employmentStatus; this.employmentType = employmentType; this.firstName = firstName; @@ -210,6 +214,14 @@ public Optional getDisplayFullName() { return displayFullName; } + /** + * @return If provided, will only return employees with this employee number. + */ + @JsonProperty("employee_number") + public Optional getEmployeeNumber() { + return employeeNumber; + } + /** * @return If provided, will only return employees with this employment status. *
      @@ -224,7 +236,7 @@ public Optional getEmploymentStatus() { } /** - * @return If provided, will only return employees that have an employment of the specified employment_type. + * @return If provided, will only return employees that have an employment of the specified employment type. */ @JsonProperty("employment_type") public Optional getEmploymentType() { @@ -288,7 +300,7 @@ public Optional getIncludeShellData() { } /** - * @return If provided, will only return employees that have an employment of the specified job_title. + * @return If provided, will only return employees that have an employment of the specified job title. */ @JsonProperty("job_title") public Optional getJobTitle() { @@ -328,7 +340,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -449,6 +461,7 @@ private boolean equalTo(EmployeesListRequest other) { && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) && displayFullName.equals(other.displayFullName) + && employeeNumber.equals(other.employeeNumber) && employmentStatus.equals(other.employmentStatus) && employmentType.equals(other.employmentType) && firstName.equals(other.firstName) @@ -487,6 +500,7 @@ public int hashCode() { this.createdBefore, this.cursor, this.displayFullName, + this.employeeNumber, this.employmentStatus, this.employmentType, this.firstName, @@ -539,6 +553,8 @@ public static final class Builder { private Optional displayFullName = Optional.empty(); + private Optional employeeNumber = Optional.empty(); + private Optional employmentStatus = Optional.empty(); private Optional employmentType = Optional.empty(); @@ -605,6 +621,7 @@ public Builder from(EmployeesListRequest other) { createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); displayFullName(other.getDisplayFullName()); + employeeNumber(other.getEmployeeNumber()); employmentStatus(other.getEmploymentStatus()); employmentType(other.getEmploymentType()); firstName(other.getFirstName()); @@ -724,6 +741,20 @@ public Builder displayFullName(String displayFullName) { return this; } + /** + *

      If provided, will only return employees with this employee number.

      + */ + @JsonSetter(value = "employee_number", nulls = Nulls.SKIP) + public Builder employeeNumber(Optional employeeNumber) { + this.employeeNumber = employeeNumber; + return this; + } + + public Builder employeeNumber(String employeeNumber) { + this.employeeNumber = Optional.ofNullable(employeeNumber); + return this; + } + /** *

      If provided, will only return employees with this employment status.

      *
        @@ -744,7 +775,7 @@ public Builder employmentStatus(EmployeesListRequestEmploymentStatus employmentS } /** - *

        If provided, will only return employees that have an employment of the specified employment_type.

        + *

        If provided, will only return employees that have an employment of the specified employment type.

        */ @JsonSetter(value = "employment_type", nulls = Nulls.SKIP) public Builder employmentType(Optional employmentType) { @@ -856,7 +887,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

        If provided, will only return employees that have an employment of the specified job_title.

        + *

        If provided, will only return employees that have an employment of the specified job title.

        */ @JsonSetter(value = "job_title", nulls = Nulls.SKIP) public Builder jobTitle(Optional jobTitle) { @@ -926,7 +957,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

        Number of results to return per page.

        + *

        Number of results to return per page. The maximum limit is 100.

        */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -1115,6 +1146,7 @@ public EmployeesListRequest build() { createdBefore, cursor, displayFullName, + employeeNumber, employmentStatus, employmentType, firstName, diff --git a/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java b/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java index 5ec3ae20e..90efe9020 100644 --- a/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

        Number of results to return per page.

        + *

        Number of results to return per page. The maximum limit is 100.

        */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java b/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java index 2be3e66a5..d2165bf74 100644 --- a/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java @@ -179,7 +179,7 @@ public Optional getOrderBy() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -484,7 +484,7 @@ public Builder orderBy(EmploymentsListRequestOrderBy orderBy) { } /** - *

        Number of results to return per page.

        + *

        Number of results to return per page. The maximum limit is 100.

        */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java index eb82ea479..dd3044c22 100644 --- a/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java @@ -51,6 +51,8 @@ public final class EndUserDetailsRequest { private final Optional> integrationSpecificConfig; + private final Optional linkedDestinationId; + private final Map additionalProperties; private EndUserDetailsRequest( @@ -68,6 +70,7 @@ private EndUserDetailsRequest( Optional language, Optional areSyncsDisabled, Optional> integrationSpecificConfig, + Optional linkedDestinationId, Map additionalProperties) { this.endUserEmailAddress = endUserEmailAddress; this.endUserOrganizationName = endUserOrganizationName; @@ -82,6 +85,7 @@ private EndUserDetailsRequest( this.language = language; this.areSyncsDisabled = areSyncsDisabled; this.integrationSpecificConfig = integrationSpecificConfig; + this.linkedDestinationId = linkedDestinationId; this.additionalProperties = additionalProperties; } @@ -194,6 +198,14 @@ public Optional> getIntegrationSpecificConfig() { return integrationSpecificConfig; } + /** + * @return The UUID of the linked destination that you want this Linked Account to be tied to. + */ + @JsonProperty("linked_destination_id") + public Optional getLinkedDestinationId() { + return linkedDestinationId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -218,7 +230,8 @@ private boolean equalTo(EndUserDetailsRequest other) { && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) && language.equals(other.language) && areSyncsDisabled.equals(other.areSyncsDisabled) - && integrationSpecificConfig.equals(other.integrationSpecificConfig); + && integrationSpecificConfig.equals(other.integrationSpecificConfig) + && linkedDestinationId.equals(other.linkedDestinationId); } @java.lang.Override @@ -236,7 +249,8 @@ public int hashCode() { this.categoryCommonModelScopes, this.language, this.areSyncsDisabled, - this.integrationSpecificConfig); + this.integrationSpecificConfig, + this.linkedDestinationId); } @java.lang.Override @@ -352,6 +366,13 @@ _FinalStage categoryCommonModelScopes( _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + /** + *

        The UUID of the linked destination that you want this Linked Account to be tied to.

        + */ + _FinalStage linkedDestinationId(Optional linkedDestinationId); + + _FinalStage linkedDestinationId(String linkedDestinationId); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -363,6 +384,8 @@ public static final class Builder private String endUserOriginId; + private Optional linkedDestinationId = Optional.empty(); + private Optional> integrationSpecificConfig = Optional.empty(); private Optional areSyncsDisabled = Optional.empty(); @@ -404,6 +427,7 @@ public Builder from(EndUserDetailsRequest other) { language(other.getLanguage()); areSyncsDisabled(other.getAreSyncsDisabled()); integrationSpecificConfig(other.getIntegrationSpecificConfig()); + linkedDestinationId(other.getLinkedDestinationId()); return this; } @@ -443,6 +467,26 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { return this; } + /** + *

        The UUID of the linked destination that you want this Linked Account to be tied to.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkedDestinationId(String linkedDestinationId) { + this.linkedDestinationId = Optional.ofNullable(linkedDestinationId); + return this; + } + + /** + *

        The UUID of the linked destination that you want this Linked Account to be tied to.

        + */ + @java.lang.Override + @JsonSetter(value = "linked_destination_id", nulls = Nulls.SKIP) + public _FinalStage linkedDestinationId(Optional linkedDestinationId) { + this.linkedDestinationId = linkedDestinationId; + return this; + } + /** *

        A JSON object containing integration-specific configuration options.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -685,6 +729,7 @@ public EndUserDetailsRequest build() { language, areSyncsDisabled, integrationSpecificConfig, + linkedDestinationId, additionalProperties); } } diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java index df5a64ddf..b92d3edf5 100644 --- a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java @@ -28,6 +28,8 @@ public final class FieldMappingApiInstance { private final Optional remoteField; + private final Optional jmesPath; + private final Map additionalProperties; private FieldMappingApiInstance( @@ -35,11 +37,13 @@ private FieldMappingApiInstance( Optional isIntegrationWide, Optional targetField, Optional remoteField, + Optional jmesPath, Map additionalProperties) { this.id = id; this.isIntegrationWide = isIntegrationWide; this.targetField = targetField; this.remoteField = remoteField; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -63,6 +67,11 @@ public Optional getRemoteField() { return remoteField; } + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +87,13 @@ private boolean equalTo(FieldMappingApiInstance other) { return id.equals(other.id) && isIntegrationWide.equals(other.isIntegrationWide) && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField, this.jmesPath); } @java.lang.Override @@ -105,6 +115,8 @@ public static final class Builder { private Optional remoteField = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -115,6 +127,7 @@ public Builder from(FieldMappingApiInstance other) { isIntegrationWide(other.getIsIntegrationWide()); targetField(other.getTargetField()); remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); return this; } @@ -162,8 +175,20 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + return new FieldMappingApiInstance( + id, isIntegrationWide, targetField, remoteField, jmesPath, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/hris/types/Group.java b/src/main/java/com/merge/api/hris/types/Group.java index 8f1bb40b4..4217f2ae3 100644 --- a/src/main/java/com/merge/api/hris/types/Group.java +++ b/src/main/java/com/merge/api/hris/types/Group.java @@ -23,6 +23,8 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = Group.Builder.class) public final class Group { + private final Optional groupUrl; + private final Optional id; private final Optional remoteId; @@ -48,6 +50,7 @@ public final class Group { private final Map additionalProperties; private Group( + Optional groupUrl, Optional id, Optional remoteId, Optional createdAt, @@ -60,6 +63,7 @@ private Group( Optional> fieldMappings, Optional> remoteData, Map additionalProperties) { + this.groupUrl = groupUrl; this.id = id; this.remoteId = remoteId; this.createdAt = createdAt; @@ -74,6 +78,14 @@ private Group( this.additionalProperties = additionalProperties; } + /** + * @return The 3rd party URL of the group. + */ + @JsonProperty("group_url") + public Optional getGroupUrl() { + return groupUrl; + } + @JsonProperty("id") public Optional getId() { return id; @@ -172,7 +184,8 @@ public Map getAdditionalProperties() { } private boolean equalTo(Group other) { - return id.equals(other.id) + return groupUrl.equals(other.groupUrl) + && id.equals(other.id) && remoteId.equals(other.remoteId) && createdAt.equals(other.createdAt) && modifiedAt.equals(other.modifiedAt) @@ -188,6 +201,7 @@ private boolean equalTo(Group other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.groupUrl, this.id, this.remoteId, this.createdAt, @@ -212,6 +226,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional groupUrl = Optional.empty(); + private Optional id = Optional.empty(); private Optional remoteId = Optional.empty(); @@ -240,6 +256,7 @@ public static final class Builder { private Builder() {} public Builder from(Group other) { + groupUrl(other.getGroupUrl()); id(other.getId()); remoteId(other.getRemoteId()); createdAt(other.getCreatedAt()); @@ -254,6 +271,20 @@ public Builder from(Group other) { return this; } + /** + *

        The 3rd party URL of the group.

        + */ + @JsonSetter(value = "group_url", nulls = Nulls.SKIP) + public Builder groupUrl(Optional groupUrl) { + this.groupUrl = groupUrl; + return this; + } + + public Builder groupUrl(String groupUrl) { + this.groupUrl = Optional.ofNullable(groupUrl); + return this; + } + @JsonSetter(value = "id", nulls = Nulls.SKIP) public Builder id(Optional id) { this.id = id; @@ -408,6 +439,7 @@ public Builder remoteData(List remoteData) { public Group build() { return new Group( + groupUrl, id, remoteId, createdAt, diff --git a/src/main/java/com/merge/api/hris/types/GroupsListRequest.java b/src/main/java/com/merge/api/hris/types/GroupsListRequest.java index 10a75a14c..d972833e3 100644 --- a/src/main/java/com/merge/api/hris/types/GroupsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/GroupsListRequest.java @@ -169,7 +169,7 @@ public Optional getNames() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -463,7 +463,7 @@ public Builder names(String names) { } /** - *

        Number of results to return per page.

        + *

        Number of results to return per page. The maximum limit is 100.

        */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/GroupsTypesListRequest.java b/src/main/java/com/merge/api/hris/types/GroupsTypesListRequest.java new file mode 100644 index 000000000..f86540f5b --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsTypesListRequest.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsTypesListRequest.Builder.class) +public final class GroupsTypesListRequest { + private final Optional includeDeletedData; + + private final Optional showEnumOrigins; + + private final Map additionalProperties; + + private GroupsTypesListRequest( + Optional includeDeletedData, + Optional showEnumOrigins, + Map additionalProperties) { + this.includeDeletedData = includeDeletedData; + this.showEnumOrigins = showEnumOrigins; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include data that was marked as deleted by third party webhooks. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return A comma separated list of enum field names for which you'd like the original values instead of Merge's normalized enum values. Learn more + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsTypesListRequest && equalTo((GroupsTypesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsTypesListRequest other) { + return includeDeletedData.equals(other.includeDeletedData) && showEnumOrigins.equals(other.showEnumOrigins); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeDeletedData, this.showEnumOrigins); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeDeletedData = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsTypesListRequest other) { + includeDeletedData(other.getIncludeDeletedData()); + showEnumOrigins(other.getShowEnumOrigins()); + return this; + } + + /** + *

        Whether to include data that was marked as deleted by third party webhooks.

        + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

        A comma separated list of enum field names for which you'd like the original values instead of Merge's normalized enum values. Learn more

        + */ + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(String showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + public GroupsTypesListRequest build() { + return new GroupsTypesListRequest(includeDeletedData, showEnumOrigins, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/GroupsTypesListResponse.java b/src/main/java/com/merge/api/hris/types/GroupsTypesListResponse.java new file mode 100644 index 000000000..80d361e38 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsTypesListResponse.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsTypesListResponse.Builder.class) +public final class GroupsTypesListResponse { + private final Optional> types; + + private final Map additionalProperties; + + private GroupsTypesListResponse(Optional> types, Map additionalProperties) { + this.types = types; + this.additionalProperties = additionalProperties; + } + + /** + * @return List of distinct group types + */ + @JsonProperty("types") + public Optional> getTypes() { + return types; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsTypesListResponse && equalTo((GroupsTypesListResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsTypesListResponse other) { + return types.equals(other.types); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.types); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> types = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsTypesListResponse other) { + types(other.getTypes()); + return this; + } + + /** + *

        List of distinct group types

        + */ + @JsonSetter(value = "types", nulls = Nulls.SKIP) + public Builder types(Optional> types) { + this.types = types; + return this; + } + + public Builder types(List types) { + this.types = Optional.ofNullable(types); + return this; + } + + public GroupsTypesListResponse build() { + return new GroupsTypesListResponse(types, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/IssuesListRequest.java b/src/main/java/com/merge/api/hris/types/IssuesListRequest.java index 741cf3a6c..9d3bc9994 100644 --- a/src/main/java/com/merge/api/hris/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/IssuesListRequest.java @@ -164,7 +164,7 @@ public Optional getLinkedAccountId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -446,7 +446,7 @@ public Builder linkedAccountId(String linkedAccountId) { } /** - *

        Number of results to return per page.

        + *

        Number of results to return per page. The maximum limit is 100.

        */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java index 0b04fc561..7c183e07d 100644 --- a/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java @@ -174,7 +174,7 @@ public Optional getIsTestAccount() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -454,7 +454,7 @@ public Builder isTestAccount(String isTestAccount) { } /** - *

        Number of results to return per page.

        + *

        Number of results to return per page. The maximum limit is 100.

        */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/LocationsListRequest.java b/src/main/java/com/merge/api/hris/types/LocationsListRequest.java index 5dbfd4312..06c1b3b48 100644 --- a/src/main/java/com/merge/api/hris/types/LocationsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/LocationsListRequest.java @@ -129,7 +129,7 @@ public Optional getIncludeShellData() { } /** - * @return If provided, will only return locations with this location_type + * @return If provided, will only return locations with this location type *
          *
        • HOME - HOME
        • *
        • WORK - WORK
        • @@ -157,7 +157,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -377,7 +377,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

          If provided, will only return locations with this location_type

          + *

          If provided, will only return locations with this location type

          *
            *
          • HOME - HOME
          • *
          • WORK - WORK
          • @@ -423,7 +423,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

            Number of results to return per page.

            + *

            Number of results to return per page. The maximum limit is 100.

            */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/MetaResponse.java b/src/main/java/com/merge/api/hris/types/MetaResponse.java index 74d2a4582..765ab8a04 100644 --- a/src/main/java/com/merge/api/hris/types/MetaResponse.java +++ b/src/main/java/com/merge/api/hris/types/MetaResponse.java @@ -15,6 +15,7 @@ import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -32,6 +33,8 @@ public final class MetaResponse { private final boolean hasRequiredLinkedAccountParams; + private final Optional> remoteFields; + private final Map additionalProperties; private MetaResponse( @@ -40,12 +43,14 @@ private MetaResponse( Optional status, boolean hasConditionalParams, boolean hasRequiredLinkedAccountParams, + Optional> remoteFields, Map additionalProperties) { this.requestSchema = requestSchema; this.remoteFieldClasses = remoteFieldClasses; this.status = status; this.hasConditionalParams = hasConditionalParams; this.hasRequiredLinkedAccountParams = hasRequiredLinkedAccountParams; + this.remoteFields = remoteFields; this.additionalProperties = additionalProperties; } @@ -74,6 +79,14 @@ public boolean getHasRequiredLinkedAccountParams() { return hasRequiredLinkedAccountParams; } + /** + * @return Remote field values to populate + */ + @JsonProperty("remote_fields") + public Optional> getRemoteFields() { + return remoteFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -90,7 +103,8 @@ private boolean equalTo(MetaResponse other) { && remoteFieldClasses.equals(other.remoteFieldClasses) && status.equals(other.status) && hasConditionalParams == other.hasConditionalParams - && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams; + && hasRequiredLinkedAccountParams == other.hasRequiredLinkedAccountParams + && remoteFields.equals(other.remoteFields); } @java.lang.Override @@ -100,7 +114,8 @@ public int hashCode() { this.remoteFieldClasses, this.status, this.hasConditionalParams, - this.hasRequiredLinkedAccountParams); + this.hasRequiredLinkedAccountParams, + this.remoteFields); } @java.lang.Override @@ -138,6 +153,13 @@ public interface _FinalStage { _FinalStage status(Optional status); _FinalStage status(LinkedAccountStatus status); + + /** + *

            Remote field values to populate

            + */ + _FinalStage remoteFields(Optional> remoteFields); + + _FinalStage remoteFields(List remoteFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -147,6 +169,8 @@ public static final class Builder private boolean hasRequiredLinkedAccountParams; + private Optional> remoteFields = Optional.empty(); + private Optional status = Optional.empty(); private Optional> remoteFieldClasses = Optional.empty(); @@ -165,6 +189,7 @@ public Builder from(MetaResponse other) { status(other.getStatus()); hasConditionalParams(other.getHasConditionalParams()); hasRequiredLinkedAccountParams(other.getHasRequiredLinkedAccountParams()); + remoteFields(other.getRemoteFields()); return this; } @@ -182,6 +207,26 @@ public _FinalStage hasRequiredLinkedAccountParams(boolean hasRequiredLinkedAccou return this; } + /** + *

            Remote field values to populate

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteFields(List remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + /** + *

            Remote field values to populate

            + */ + @java.lang.Override + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public _FinalStage remoteFields(Optional> remoteFields) { + this.remoteFields = remoteFields; + return this; + } + @java.lang.Override public _FinalStage status(LinkedAccountStatus status) { this.status = Optional.ofNullable(status); @@ -240,6 +285,7 @@ public MetaResponse build() { status, hasConditionalParams, hasRequiredLinkedAccountParams, + remoteFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/hris/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/hris/types/PatchedEditFieldMappingRequest.java index b8194466f..e84aab2a5 100644 --- a/src/main/java/com/merge/api/hris/types/PatchedEditFieldMappingRequest.java +++ b/src/main/java/com/merge/api/hris/types/PatchedEditFieldMappingRequest.java @@ -22,25 +22,41 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + private final Optional> remoteFieldTraversalPath; private final Optional remoteMethod; private final Optional remoteUrlPath; + private final Optional jmesPath; + private final Map additionalProperties; private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, Optional> remoteFieldTraversalPath, Optional remoteMethod, Optional remoteUrlPath, + Optional jmesPath, Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. */ @@ -65,6 +81,14 @@ public Optional getRemoteUrlPath() { return remoteUrlPath; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +101,21 @@ public Map getAdditionalProperties() { } private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath); } @java.lang.Override @@ -98,21 +129,41 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + private Optional> remoteFieldTraversalPath = Optional.empty(); private Optional remoteMethod = Optional.empty(); private Optional remoteUrlPath = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + return this; + } + + /** + *

            Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

            + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); return this; } @@ -158,9 +209,28 @@ public Builder remoteUrlPath(String remoteUrlPath) { return this; } + /** + *

            JMES path to specify json query expression to be used on field mapping.

            + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public PatchedEditFieldMappingRequest build() { return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java b/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java index 241e4bff5..9e8dc350f 100644 --- a/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

            Number of results to return per page.

            + *

            Number of results to return per page. The maximum limit is 100.

            */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java index fed56ad3c..717e4fa5d 100644 --- a/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java @@ -177,7 +177,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -504,7 +504,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

            Number of results to return per page.

            + *

            Number of results to return per page. The maximum limit is 100.

            */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/hris/types/RegenerateAccountToken.java new file mode 100644 index 000000000..b39056dde --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/RemoteData.java b/src/main/java/com/merge/api/hris/types/RemoteData.java index 7ab1bdbfa..843b8bdb8 100644 --- a/src/main/java/com/merge/api/hris/types/RemoteData.java +++ b/src/main/java/com/merge/api/hris/types/RemoteData.java @@ -42,6 +42,9 @@ public String getPath() { return path; } + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ @JsonProperty("data") public Optional getData() { return data; @@ -88,6 +91,9 @@ public interface PathStage { public interface _FinalStage { RemoteData build(); + /** + *

            The data returned from the third-party for this object in its original, unnormalized format.

            + */ _FinalStage data(Optional data); _FinalStage data(JsonNode data); @@ -123,12 +129,19 @@ public _FinalStage path(@NotNull String path) { return this; } + /** + *

            The data returned from the third-party for this object in its original, unnormalized format.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage data(JsonNode data) { this.data = Optional.ofNullable(data); return this; } + /** + *

            The data returned from the third-party for this object in its original, unnormalized format.

            + */ @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional data) { diff --git a/src/main/java/com/merge/api/hris/types/RoleEnum.java b/src/main/java/com/merge/api/hris/types/RoleEnum.java index b5ec2b259..18b29971b 100644 --- a/src/main/java/com/merge/api/hris/types/RoleEnum.java +++ b/src/main/java/com/merge/api/hris/types/RoleEnum.java @@ -17,6 +17,8 @@ public final class RoleEnum { public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); private final Value value; @@ -60,6 +62,8 @@ public T visit(Visitor visitor) { return visitor.visitMember(); case SYSTEM: return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); case ADMIN: return visitor.visitAdmin(); case UNKNOWN: @@ -81,6 +85,8 @@ public static RoleEnum valueOf(String value) { return MEMBER; case "SYSTEM": return SYSTEM; + case "SUPPORT": + return SUPPORT; case "ADMIN": return ADMIN; default: @@ -101,6 +107,8 @@ public enum Value { MERGE_TEAM, + SUPPORT, + UNKNOWN } @@ -117,6 +125,8 @@ public interface Visitor { T visitMergeTeam(); + T visitSupport(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/hris/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/hris/types/SyncStatusListRequest.java index df7c499c2..9a5c18550 100644 --- a/src/main/java/com/merge/api/hris/types/SyncStatusListRequest.java +++ b/src/main/java/com/merge/api/hris/types/SyncStatusListRequest.java @@ -42,7 +42,7 @@ public Optional getCursor() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -110,7 +110,7 @@ public Builder cursor(String cursor) { } /** - *

            Number of results to return per page.

            + *

            Number of results to return per page. The maximum limit is 100.

            */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/TeamsListRequest.java b/src/main/java/com/merge/api/hris/types/TeamsListRequest.java index 698e47f94..97e29ea99 100644 --- a/src/main/java/com/merge/api/hris/types/TeamsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TeamsListRequest.java @@ -151,7 +151,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -405,7 +405,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

            Number of results to return per page.

            + *

            Number of results to return per page. The maximum limit is 100.

            */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java index 2746e8924..d2a189bbe 100644 --- a/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java @@ -203,7 +203,7 @@ public Optional getOrderBy() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -546,7 +546,7 @@ public Builder orderBy(TimesheetEntriesListRequestOrderBy orderBy) { } /** - *

            Number of results to return per page.

            + *

            Number of results to return per page. The maximum limit is 100.

            */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/knowledgebase/AccountDetailsClient.java b/src/main/java/com/merge/api/knowledgebase/AccountDetailsClient.java new file mode 100644 index 000000000..023f5fe63 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AccountDetailsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountDetails; + +public class AccountDetailsClient { + protected final ClientOptions clientOptions; + + private final RawAccountDetailsClient rawClient; + + public AccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Get details for a linked account. + */ + public AccountDetails retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AccountTokenClient.java b/src/main/java/com/merge/api/knowledgebase/AccountTokenClient.java new file mode 100644 index 000000000..5cf9c72bb --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AccountTokenClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountToken; +import com.merge.api.knowledgebase.types.RegenerateAccountToken; + +public class AccountTokenClient { + protected final ClientOptions clientOptions; + + private final RawAccountTokenClient rawClient; + + public AccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/ArticlesClient.java b/src/main/java/com/merge/api/knowledgebase/ArticlesClient.java new file mode 100644 index 000000000..5893374ce --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/ArticlesClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Article; +import com.merge.api.knowledgebase.types.ArticlesListRequest; +import com.merge.api.knowledgebase.types.ArticlesRetrieveRequest; + +public class ArticlesClient { + protected final ClientOptions clientOptions; + + private final RawArticlesClient rawClient; + + public ArticlesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawArticlesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawArticlesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Article objects. + */ + public SyncPagingIterable
            list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Article objects. + */ + public SyncPagingIterable
            list(ArticlesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Article objects. + */ + public SyncPagingIterable
            list(ArticlesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Article object with the given id. + */ + public Article retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Article object with the given id. + */ + public Article retrieve(String id, ArticlesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Article object with the given id. + */ + public Article retrieve(String id, ArticlesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncAccountDetailsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncAccountDetailsClient.java new file mode 100644 index 000000000..77007ddbc --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncAccountDetailsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountDetails; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountDetailsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountDetailsClient rawClient; + + public AsyncAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountDetailsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountDetailsClient withRawResponse() { + return this.rawClient; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncAccountTokenClient.java new file mode 100644 index 000000000..639341167 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncAccountTokenClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountToken; +import com.merge.api.knowledgebase.types.RegenerateAccountToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncAccountTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAccountTokenClient rawClient; + + public AsyncAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAccountTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAccountTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken) { + return this.rawClient.retrieve(publicToken).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncArticlesClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncArticlesClient.java new file mode 100644 index 000000000..a00fd91bb --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncArticlesClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Article; +import com.merge.api.knowledgebase.types.ArticlesListRequest; +import com.merge.api.knowledgebase.types.ArticlesRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncArticlesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawArticlesClient rawClient; + + public AsyncArticlesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawArticlesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawArticlesClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Article objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Article objects. + */ + public CompletableFuture> list(ArticlesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Article objects. + */ + public CompletableFuture> list( + ArticlesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Article object with the given id. + */ + public CompletableFuture
            retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Article object with the given id. + */ + public CompletableFuture
            retrieve(String id, ArticlesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Article object with the given id. + */ + public CompletableFuture
            retrieve( + String id, ArticlesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncAsyncPassthroughClient.java new file mode 100644 index 000000000..98865458b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncAsyncPassthroughClient.java @@ -0,0 +1,61 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AsyncPassthroughReciept; +import com.merge.api.knowledgebase.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.knowledgebase.types.DataPassthroughRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAsyncPassthroughClient rawClient; + + public AsyncAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAsyncPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAsyncPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create( + DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve(String asyncPassthroughReceiptId) { + return this.rawClient.retrieve(asyncPassthroughReceiptId).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + return this.rawClient + .retrieve(asyncPassthroughReceiptId, requestOptions) + .thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncAttachmentsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncAttachmentsClient.java new file mode 100644 index 000000000..491db0eee --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncAttachmentsClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Attachment; +import com.merge.api.knowledgebase.types.AttachmentsListRequest; +import com.merge.api.knowledgebase.types.AttachmentsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAttachmentsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAttachmentsClient rawClient; + + public AsyncAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list(AttachmentsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncAuditTrailClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncAuditTrailClient.java new file mode 100644 index 000000000..07518997c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncAuditTrailClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AuditLogEvent; +import com.merge.api.knowledgebase.types.AuditTrailListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncAuditTrailClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAuditTrailClient rawClient; + + public AsyncAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list(AuditTrailListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncAvailableActionsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncAvailableActionsClient.java new file mode 100644 index 000000000..daa3fb499 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncAvailableActionsClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AvailableActions; +import java.util.concurrent.CompletableFuture; + +public class AsyncAvailableActionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawAvailableActionsClient rawClient; + + public AsyncAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve() { + return this.rawClient.retrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncContainersClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncContainersClient.java new file mode 100644 index 000000000..d82f81b01 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncContainersClient.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Container; +import com.merge.api.knowledgebase.types.ContainersListRequest; +import com.merge.api.knowledgebase.types.ContainersRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncContainersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawContainersClient rawClient; + + public AsyncContainersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawContainersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawContainersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Container objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Container objects. + */ + public CompletableFuture> list(ContainersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Container objects. + */ + public CompletableFuture> list( + ContainersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Container object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Container object with the given id. + */ + public CompletableFuture retrieve(String id, ContainersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Container object with the given id. + */ + public CompletableFuture retrieve( + String id, ContainersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncDeleteAccountClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncDeleteAccountClient.java new file mode 100644 index 000000000..dc61a39aa --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncDeleteAccountClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import java.util.concurrent.CompletableFuture; + +public class AsyncDeleteAccountClient { + protected final ClientOptions clientOptions; + + private final AsyncRawDeleteAccountClient rawClient; + + public AsyncDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete() { + return this.rawClient.delete().thenApply(response -> response.body()); + } + + /** + * Delete a linked account. + */ + public CompletableFuture delete(RequestOptions requestOptions) { + return this.rawClient.delete(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncFieldMappingClient.java new file mode 100644 index 000000000..45fa23138 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncFieldMappingClient.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CreateFieldMappingRequest; +import com.merge.api.knowledgebase.types.CreateTargetFieldRequest; +import com.merge.api.knowledgebase.types.ExternalTargetFieldApiResponse; +import com.merge.api.knowledgebase.types.FieldMappingApiInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingsRetrieveRequest; +import com.merge.api.knowledgebase.types.PatchedEditFieldMappingRequest; +import com.merge.api.knowledgebase.types.RemoteFieldApiResponse; +import com.merge.api.knowledgebase.types.RemoteFieldsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncFieldMappingClient { + protected final ClientOptions clientOptions; + + private final AsyncRawFieldMappingClient rawClient; + + public AsyncFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture targetFieldsCreate(CreateTargetFieldRequest request) { + return this.rawClient.targetFieldsCreate(request).thenApply(response -> response.body()); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + return this.rawClient.targetFieldsCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncForceResyncClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncForceResyncClient.java new file mode 100644 index 000000000..1a9a9865e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncForceResyncClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.SyncStatus; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncForceResyncClient { + protected final ClientOptions clientOptions; + + private final AsyncRawForceResyncClient rawClient; + + public AsyncForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public CompletableFuture> syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture> syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncGenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncGenerateKeyClient.java new file mode 100644 index 000000000..ef7c2cf45 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncGenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.GenerateRemoteKeyRequest; +import com.merge.api.knowledgebase.types.RemoteKey; +import java.util.concurrent.CompletableFuture; + +public class AsyncGenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGenerateKeyClient rawClient; + + public AsyncGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Create a remote key. + */ + public CompletableFuture create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncGroupsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncGroupsClient.java new file mode 100644 index 000000000..3cf0d21a3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncGroupsClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Group; +import com.merge.api.knowledgebase.types.GroupsListRequest; +import com.merge.api.knowledgebase.types.GroupsRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncGroupsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawGroupsClient rawClient; + + public AsyncGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture> list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncIssuesClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncIssuesClient.java new file mode 100644 index 000000000..08d4518b0 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncIssuesClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Issue; +import com.merge.api.knowledgebase.types.IssuesListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncIssuesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawIssuesClient rawClient; + + public AsyncIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture> list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncKnowledgebaseClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncKnowledgebaseClient.java new file mode 100644 index 000000000..07e6bf349 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncKnowledgebaseClient.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class AsyncKnowledgebaseClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier articlesClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier attachmentsClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier containersClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier groupsClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public AsyncKnowledgebaseClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AsyncAccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AsyncAccountTokenClient(clientOptions)); + this.articlesClient = Suppliers.memoize(() -> new AsyncArticlesClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncAsyncPassthroughClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AsyncAttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AsyncAuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AsyncAvailableActionsClient(clientOptions)); + this.containersClient = Suppliers.memoize(() -> new AsyncContainersClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new AsyncScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new AsyncDeleteAccountClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new AsyncFieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new AsyncGenerateKeyClient(clientOptions)); + this.groupsClient = Suppliers.memoize(() -> new AsyncGroupsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new AsyncIssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new AsyncLinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new AsyncLinkedAccountsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new AsyncRegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new AsyncSyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new AsyncForceResyncClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new AsyncUsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new AsyncWebhookReceiversClient(clientOptions)); + } + + public AsyncAccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AsyncAccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public AsyncArticlesClient articles() { + return this.articlesClient.get(); + } + + public AsyncAsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AsyncAttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AsyncAuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AsyncAvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public AsyncContainersClient containers() { + return this.containersClient.get(); + } + + public AsyncScopesClient scopes() { + return this.scopesClient.get(); + } + + public AsyncDeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public AsyncFieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public AsyncGenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public AsyncGroupsClient groups() { + return this.groupsClient.get(); + } + + public AsyncIssuesClient issues() { + return this.issuesClient.get(); + } + + public AsyncLinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public AsyncLinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public AsyncPassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public AsyncRegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public AsyncSyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public AsyncForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public AsyncUsersClient users() { + return this.usersClient.get(); + } + + public AsyncWebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncLinkTokenClient.java new file mode 100644 index 000000000..58405190b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncLinkTokenClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.EndUserDetailsRequest; +import com.merge.api.knowledgebase.types.LinkToken; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkTokenClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkTokenClient rawClient; + + public AsyncLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture create(EndUserDetailsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncLinkedAccountsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncLinkedAccountsClient.java new file mode 100644 index 000000000..8f551d7ce --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncLinkedAccountsClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AccountDetailsAndActions; +import com.merge.api.knowledgebase.types.LinkedAccountsListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncLinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawLinkedAccountsClient rawClient; + + public AsyncLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncPassthroughClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncPassthroughClient.java new file mode 100644 index 000000000..645aa17a8 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncPassthroughClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.DataPassthroughRequest; +import com.merge.api.knowledgebase.types.RemoteResponse; +import java.util.concurrent.CompletableFuture; + +public class AsyncPassthroughClient { + protected final ClientOptions clientOptions; + + private final AsyncRawPassthroughClient rawClient; + + public AsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawAccountDetailsClient.java new file mode 100644 index 000000000..5b2f1cfd0 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawAccountDetailsClient.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountDetails; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawAccountTokenClient.java new file mode 100644 index 000000000..37d8256c1 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawAccountTokenClient.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountToken; +import com.merge.api.knowledgebase.types.RegenerateAccountToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAccountTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawArticlesClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawArticlesClient.java new file mode 100644 index 000000000..0ae9be1e4 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawArticlesClient.java @@ -0,0 +1,267 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Article; +import com.merge.api.knowledgebase.types.ArticlesListRequest; +import com.merge.api.knowledgebase.types.ArticlesRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedArticleList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawArticlesClient { + protected final ClientOptions clientOptions; + + public AsyncRawArticlesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Article objects. + */ + public CompletableFuture>> list() { + return list(ArticlesListRequest.builder().build()); + } + + /** + * Returns a list of Article objects. + */ + public CompletableFuture>> list(ArticlesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Article objects. + */ + public CompletableFuture>> list( + ArticlesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/articles"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getParentArticleId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_article_id", request.getParentArticleId().get(), false); + } + if (request.getParentContainerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "parent_container_id", + request.getParentContainerId().get(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRootContainerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "root_container_id", request.getRootContainerId().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "type", request.getType().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedArticleList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedArticleList.class); + Optional startingAfter = parsedResponse.getNext(); + ArticlesListRequest nextRequest = ArticlesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List
            result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable
            ( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Article object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ArticlesRetrieveRequest.builder().build()); + } + + /** + * Returns an Article object with the given id. + */ + public CompletableFuture> retrieve(String id, ArticlesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Article object with the given id. + */ + public CompletableFuture> retrieve( + String id, ArticlesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/articles") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Article.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawAsyncPassthroughClient.java new file mode 100644 index 000000000..4f1994267 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawAsyncPassthroughClient.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AsyncPassthroughReciept; +import com.merge.api.knowledgebase.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.knowledgebase.types.DataPassthroughRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, AsyncPassthroughRetrieveResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawAttachmentsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawAttachmentsClient.java new file mode 100644 index 000000000..b3b7c83d5 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawAttachmentsClient.java @@ -0,0 +1,237 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Attachment; +import com.merge.api.knowledgebase.types.AttachmentsListRequest; +import com.merge.api.knowledgebase.types.AttachmentsRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedAttachmentList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAttachmentsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Attachment objects. + */ + public CompletableFuture>> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/attachments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve(String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Attachment object with the given id. + */ + public CompletableFuture> retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Attachment.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawAuditTrailClient.java new file mode 100644 index 000000000..ad6888f1c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawAuditTrailClient.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AuditLogEvent; +import com.merge.api.knowledgebase.types.AuditTrailListRequest; +import com.merge.api.knowledgebase.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAuditTrailClient { + protected final ClientOptions clientOptions; + + public AsyncRawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public CompletableFuture>> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawAvailableActionsClient.java new file mode 100644 index 000000000..d22bac078 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawAvailableActionsClient.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AvailableActions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public CompletableFuture> retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawContainersClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawContainersClient.java new file mode 100644 index 000000000..d34bef5a1 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawContainersClient.java @@ -0,0 +1,259 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Container; +import com.merge.api.knowledgebase.types.ContainersListRequest; +import com.merge.api.knowledgebase.types.ContainersRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedContainerList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawContainersClient { + protected final ClientOptions clientOptions; + + public AsyncRawContainersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Container objects. + */ + public CompletableFuture>> list() { + return list(ContainersListRequest.builder().build()); + } + + /** + * Returns a list of Container objects. + */ + public CompletableFuture>> list(ContainersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Container objects. + */ + public CompletableFuture>> list( + ContainersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/containers"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getParentArticleId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_article_id", request.getParentArticleId().get(), false); + } + if (request.getParentContainerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "parent_container_id", + request.getParentContainerId().get(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "type", request.getType().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedContainerList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContainerList.class); + Optional startingAfter = parsedResponse.getNext(); + ContainersListRequest nextRequest = ContainersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Container object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, ContainersRetrieveRequest.builder().build()); + } + + /** + * Returns a Container object with the given id. + */ + public CompletableFuture> retrieve(String id, ContainersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Container object with the given id. + */ + public CompletableFuture> retrieve( + String id, ContainersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/containers") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Container.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawDeleteAccountClient.java new file mode 100644 index 000000000..410918ff7 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawDeleteAccountClient.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public AsyncRawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public CompletableFuture> delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(null, response)); + return; + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawFieldMappingClient.java new file mode 100644 index 000000000..3f3e256e2 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawFieldMappingClient.java @@ -0,0 +1,524 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CreateFieldMappingRequest; +import com.merge.api.knowledgebase.types.CreateTargetFieldRequest; +import com.merge.api.knowledgebase.types.ExternalTargetFieldApiResponse; +import com.merge.api.knowledgebase.types.FieldMappingApiInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingsRetrieveRequest; +import com.merge.api.knowledgebase.types.PatchedEditFieldMappingRequest; +import com.merge.api.knowledgebase.types.RemoteFieldApiResponse; +import com.merge.api.knowledgebase.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawFieldMappingClient { + protected final ClientOptions clientOptions; + + public AsyncRawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public CompletableFuture> fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingApiInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * 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. + */ + public CompletableFuture> fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings") + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, FieldMappingInstanceResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * 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. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, 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. + */ + public CompletableFuture> remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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. + */ + public CompletableFuture> targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * 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. + */ + public CompletableFuture> targetFieldsRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ExternalTargetFieldApiResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture> targetFieldsCreate( + CreateTargetFieldRequest request) { + return targetFieldsCreate(request, null); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public CompletableFuture> targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/target-fields") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, ExternalTargetFieldApiResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawForceResyncClient.java new file mode 100644 index 000000000..be0c1a2ca --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawForceResyncClient.java @@ -0,0 +1,90 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawForceResyncClient { + protected final ClientOptions clientOptions; + + public AsyncRawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public CompletableFuture>> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * 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. + */ + public CompletableFuture>> syncStatusResyncCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawGenerateKeyClient.java new file mode 100644 index 000000000..1b60658a7 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawGenerateKeyClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.GenerateRemoteKeyRequest; +import com.merge.api.knowledgebase.types.RemoteKey; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public CompletableFuture> create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public CompletableFuture> create( + GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawGroupsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawGroupsClient.java new file mode 100644 index 000000000..cb83f3f95 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawGroupsClient.java @@ -0,0 +1,243 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Group; +import com.merge.api.knowledgebase.types.GroupsListRequest; +import com.merge.api.knowledgebase.types.GroupsRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedGroupList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawGroupsClient { + protected final ClientOptions clientOptions; + + public AsyncRawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public CompletableFuture>> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public CompletableFuture> retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawIssuesClient.java new file mode 100644 index 000000000..ab9854dc7 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawIssuesClient.java @@ -0,0 +1,241 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Issue; +import com.merge.api.knowledgebase.types.IssuesListRequest; +import com.merge.api.knowledgebase.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawIssuesClient { + protected final ClientOptions clientOptions; + + public AsyncRawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public CompletableFuture>> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawLinkTokenClient.java new file mode 100644 index 000000000..4930467d3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawLinkTokenClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.EndUserDetailsRequest; +import com.merge.api.knowledgebase.types.LinkToken; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkTokenClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture> create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public CompletableFuture> create( + EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawLinkedAccountsClient.java new file mode 100644 index 000000000..9ef99fe89 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawLinkedAccountsClient.java @@ -0,0 +1,182 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AccountDetailsAndActions; +import com.merge.api.knowledgebase.types.LinkedAccountsListRequest; +import com.merge.api.knowledgebase.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public AsyncRawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public CompletableFuture>> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = + new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawPassthroughClient.java new file mode 100644 index 000000000..401ffe2f1 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawPassthroughClient.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.DataPassthroughRequest; +import com.merge.api.knowledgebase.types.RemoteResponse; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawPassthroughClient { + protected final ClientOptions clientOptions; + + public AsyncRawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public CompletableFuture> create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawRegenerateKeyClient.java new file mode 100644 index 000000000..4dc806cfa --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawRegenerateKeyClient.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.RemoteKey; +import com.merge.api.knowledgebase.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public AsyncRawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture> create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawScopesClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawScopesClient.java new file mode 100644 index 000000000..a76403305 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawScopesClient.java @@ -0,0 +1,209 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CommonModelScopeApi; +import com.merge.api.knowledgebase.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawScopesClient { + protected final ClientOptions clientOptions; + + public AsyncRawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture> defaultScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture> linkedAccountScopesRetrieve( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * 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 + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * 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 + */ + public CompletableFuture> linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawSyncStatusClient.java new file mode 100644 index 000000000..0b7ed9030 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawSyncStatusClient.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.PaginatedSyncStatusList; +import com.merge.api.knowledgebase.types.SyncStatus; +import com.merge.api.knowledgebase.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawSyncStatusClient { + protected final ClientOptions clientOptions; + + public AsyncRawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public CompletableFuture>> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * 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. + */ + public CompletableFuture>> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * 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. + */ + public CompletableFuture>> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawUsersClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawUsersClient.java new file mode 100644 index 000000000..b2c480b65 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawUsersClient.java @@ -0,0 +1,235 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.PaginatedUserList; +import com.merge.api.knowledgebase.types.User; +import com.merge.api.knowledgebase.types.UsersListRequest; +import com.merge.api.knowledgebase.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawUsersClient { + protected final ClientOptions clientOptions; + + public AsyncRawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture>> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + future.complete(new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + try { + return list(nextRequest, requestOptions) + .get() + .body(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + }), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture> retrieve( + String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRawWebhookReceiversClient.java new file mode 100644 index 000000000..2379a5984 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRawWebhookReceiversClient.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.WebhookReceiver; +import com.merge.api.knowledgebase.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public AsyncRawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture>> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture>> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture> create( + WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncRegenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncRegenerateKeyClient.java new file mode 100644 index 000000000..054db01c5 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncRegenerateKeyClient.java @@ -0,0 +1,42 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.RemoteKey; +import com.merge.api.knowledgebase.types.RemoteKeyForRegenerationRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncRegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final AsyncRawRegenerateKeyClient rawClient; + + public AsyncRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Exchange remote keys. + */ + public CompletableFuture create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncScopesClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncScopesClient.java new file mode 100644 index 000000000..58b0d9aed --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncScopesClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CommonModelScopeApi; +import com.merge.api.knowledgebase.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncScopesClient { + protected final ClientOptions clientOptions; + + private final AsyncRawScopesClient rawClient; + + public AsyncScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CompletableFuture defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().thenApply(response -> response.body()); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CompletableFuture linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).thenApply(response -> response.body()); + } + + /** + * 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 + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).thenApply(response -> response.body()); + } + + /** + * 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 + */ + public CompletableFuture linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncSyncStatusClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncSyncStatusClient.java new file mode 100644 index 000000000..b8151f69b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncSyncStatusClient.java @@ -0,0 +1,51 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.SyncStatus; +import com.merge.api.knowledgebase.types.SyncStatusListRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncSyncStatusClient { + protected final ClientOptions clientOptions; + + private final AsyncRawSyncStatusClient rawClient; + + public AsyncSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture> list(SyncStatusListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * 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. + */ + public CompletableFuture> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncUsersClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncUsersClient.java new file mode 100644 index 000000000..9aed31af5 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncUsersClient.java @@ -0,0 +1,72 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.User; +import com.merge.api.knowledgebase.types.UsersListRequest; +import com.merge.api.knowledgebase.types.UsersRetrieveRequest; +import java.util.concurrent.CompletableFuture; + +public class AsyncUsersClient { + protected final ClientOptions clientOptions; + + private final AsyncRawUsersClient rawClient; + + public AsyncUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request) { + return this.rawClient.list(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of User objects. + */ + public CompletableFuture> list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id) { + return this.rawClient.retrieve(id).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns a User object with the given id. + */ + public CompletableFuture retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AsyncWebhookReceiversClient.java b/src/main/java/com/merge/api/knowledgebase/AsyncWebhookReceiversClient.java new file mode 100644 index 000000000..992e25e28 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AsyncWebhookReceiversClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.WebhookReceiver; +import com.merge.api.knowledgebase.types.WebhookReceiverRequest; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +public class AsyncWebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final AsyncRawWebhookReceiversClient rawClient; + + public AsyncWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public CompletableFuture create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AttachmentsClient.java b/src/main/java/com/merge/api/knowledgebase/AttachmentsClient.java new file mode 100644 index 000000000..213a10227 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AttachmentsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Attachment; +import com.merge.api.knowledgebase.types.AttachmentsListRequest; +import com.merge.api.knowledgebase.types.AttachmentsRetrieveRequest; + +public class AttachmentsClient { + protected final ClientOptions clientOptions; + + private final RawAttachmentsClient rawClient; + + public AttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAttachmentsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAttachmentsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list(AttachmentsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Attachment objects. + */ + public SyncPagingIterable list(AttachmentsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id, AttachmentsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an Attachment object with the given id. + */ + public Attachment retrieve(String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AuditTrailClient.java b/src/main/java/com/merge/api/knowledgebase/AuditTrailClient.java new file mode 100644 index 000000000..790cf118c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AuditTrailClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AuditLogEvent; +import com.merge.api.knowledgebase.types.AuditTrailListRequest; + +public class AuditTrailClient { + protected final ClientOptions clientOptions; + + private final RawAuditTrailClient rawClient; + + public AuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAuditTrailClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAuditTrailClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets a list of audit trail events. + */ + public SyncPagingIterable list(AuditTrailListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/AvailableActionsClient.java b/src/main/java/com/merge/api/knowledgebase/AvailableActionsClient.java new file mode 100644 index 000000000..ab42ad03f --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/AvailableActionsClient.java @@ -0,0 +1,40 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AvailableActions; + +public class AvailableActionsClient { + protected final ClientOptions clientOptions; + + private final RawAvailableActionsClient rawClient; + + public AvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawAvailableActionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawAvailableActionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve() { + return this.rawClient.retrieve().body(); + } + + /** + * Returns a list of models and actions available for an account. + */ + public AvailableActions retrieve(RequestOptions requestOptions) { + return this.rawClient.retrieve(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/ContainersClient.java b/src/main/java/com/merge/api/knowledgebase/ContainersClient.java new file mode 100644 index 000000000..5a06ea222 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/ContainersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Container; +import com.merge.api.knowledgebase.types.ContainersListRequest; +import com.merge.api.knowledgebase.types.ContainersRetrieveRequest; + +public class ContainersClient { + protected final ClientOptions clientOptions; + + private final RawContainersClient rawClient; + + public ContainersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawContainersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawContainersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Container objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Container objects. + */ + public SyncPagingIterable list(ContainersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Container objects. + */ + public SyncPagingIterable list(ContainersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Container object with the given id. + */ + public Container retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Container object with the given id. + */ + public Container retrieve(String id, ContainersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Container object with the given id. + */ + public Container retrieve(String id, ContainersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/DeleteAccountClient.java b/src/main/java/com/merge/api/knowledgebase/DeleteAccountClient.java new file mode 100644 index 000000000..7236e9934 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/DeleteAccountClient.java @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; + +public class DeleteAccountClient { + protected final ClientOptions clientOptions; + + private final RawDeleteAccountClient rawClient; + + public DeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawDeleteAccountClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawDeleteAccountClient withRawResponse() { + return this.rawClient; + } + + /** + * Delete a linked account. + */ + public void delete() { + this.rawClient.delete().body(); + } + + /** + * Delete a linked account. + */ + public void delete(RequestOptions requestOptions) { + this.rawClient.delete(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/FieldMappingClient.java b/src/main/java/com/merge/api/knowledgebase/FieldMappingClient.java new file mode 100644 index 000000000..594a6c48b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/FieldMappingClient.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CreateFieldMappingRequest; +import com.merge.api.knowledgebase.types.CreateTargetFieldRequest; +import com.merge.api.knowledgebase.types.ExternalTargetFieldApiResponse; +import com.merge.api.knowledgebase.types.FieldMappingApiInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingsRetrieveRequest; +import com.merge.api.knowledgebase.types.PatchedEditFieldMappingRequest; +import com.merge.api.knowledgebase.types.RemoteFieldApiResponse; +import com.merge.api.knowledgebase.types.RemoteFieldsRetrieveRequest; + +public class FieldMappingClient { + protected final ClientOptions clientOptions; + + private final RawFieldMappingClient rawClient; + + public FieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawFieldMappingClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawFieldMappingClient withRawResponse() { + return this.rawClient; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve() { + return this.rawClient.fieldMappingsRetrieve().body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve(FieldMappingsRetrieveRequest request) { + return this.rawClient.fieldMappingsRetrieve(request).body(); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public FieldMappingApiInstanceResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsRetrieve(request, requestOptions).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return this.rawClient.fieldMappingsCreate(request).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient.fieldMappingsCreate(request, requestOptions).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsDestroy(fieldMappingId, requestOptions) + .body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return this.rawClient.fieldMappingsPartialUpdate(fieldMappingId).body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request) + .body(); + } + + /** + * 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. + */ + public FieldMappingInstanceResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + return this.rawClient + .fieldMappingsPartialUpdate(fieldMappingId, request, requestOptions) + .body(); + } + + /** + * 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. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve() { + return this.rawClient.remoteFieldsRetrieve().body(); + } + + /** + * 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. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return this.rawClient.remoteFieldsRetrieve(request).body(); + } + + /** + * 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. + */ + public RemoteFieldApiResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.remoteFieldsRetrieve(request, requestOptions).body(); + } + + /** + * 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. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve() { + return this.rawClient.targetFieldsRetrieve().body(); + } + + /** + * 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. + */ + public ExternalTargetFieldApiResponse targetFieldsRetrieve(RequestOptions requestOptions) { + return this.rawClient.targetFieldsRetrieve(requestOptions).body(); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsCreate(CreateTargetFieldRequest request) { + return this.rawClient.targetFieldsCreate(request).body(); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public ExternalTargetFieldApiResponse targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + return this.rawClient.targetFieldsCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/ForceResyncClient.java b/src/main/java/com/merge/api/knowledgebase/ForceResyncClient.java new file mode 100644 index 000000000..77acfd409 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/ForceResyncClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.SyncStatus; +import java.util.List; + +public class ForceResyncClient { + protected final ClientOptions clientOptions; + + private final RawForceResyncClient rawClient; + + public ForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawForceResyncClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawForceResyncClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public List syncStatusResyncCreate() { + return this.rawClient.syncStatusResyncCreate().body(); + } + + /** + * 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. + */ + public List syncStatusResyncCreate(RequestOptions requestOptions) { + return this.rawClient.syncStatusResyncCreate(requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/GenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/GenerateKeyClient.java new file mode 100644 index 000000000..6a9383b79 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/GenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.GenerateRemoteKeyRequest; +import com.merge.api.knowledgebase.types.RemoteKey; + +public class GenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawGenerateKeyClient rawClient; + + public GenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Create a remote key. + */ + public RemoteKey create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/GroupsClient.java b/src/main/java/com/merge/api/knowledgebase/GroupsClient.java new file mode 100644 index 000000000..23398a9f9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/GroupsClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Group; +import com.merge.api.knowledgebase.types.GroupsListRequest; +import com.merge.api.knowledgebase.types.GroupsRetrieveRequest; + +public class GroupsClient { + protected final ClientOptions clientOptions; + + private final RawGroupsClient rawClient; + + public GroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawGroupsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawGroupsClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of Group objects. + */ + public SyncPagingIterable list(GroupsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a Group object with the given id. + */ + public Group retrieve(String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/IssuesClient.java b/src/main/java/com/merge/api/knowledgebase/IssuesClient.java new file mode 100644 index 000000000..c958094c6 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/IssuesClient.java @@ -0,0 +1,63 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Issue; +import com.merge.api.knowledgebase.types.IssuesListRequest; + +public class IssuesClient { + protected final ClientOptions clientOptions; + + private final RawIssuesClient rawClient; + + public IssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawIssuesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawIssuesClient withRawResponse() { + return this.rawClient; + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Gets all issues for Organization. + */ + public SyncPagingIterable list(IssuesListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/KnowledgebaseClient.java b/src/main/java/com/merge/api/knowledgebase/KnowledgebaseClient.java new file mode 100644 index 000000000..7b6e29267 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/KnowledgebaseClient.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.Suppliers; +import java.util.function.Supplier; + +public class KnowledgebaseClient { + protected final ClientOptions clientOptions; + + protected final Supplier accountDetailsClient; + + protected final Supplier accountTokenClient; + + protected final Supplier articlesClient; + + protected final Supplier asyncPassthroughClient; + + protected final Supplier attachmentsClient; + + protected final Supplier auditTrailClient; + + protected final Supplier availableActionsClient; + + protected final Supplier containersClient; + + protected final Supplier scopesClient; + + protected final Supplier deleteAccountClient; + + protected final Supplier fieldMappingClient; + + protected final Supplier generateKeyClient; + + protected final Supplier groupsClient; + + protected final Supplier issuesClient; + + protected final Supplier linkTokenClient; + + protected final Supplier linkedAccountsClient; + + protected final Supplier passthroughClient; + + protected final Supplier regenerateKeyClient; + + protected final Supplier syncStatusClient; + + protected final Supplier forceResyncClient; + + protected final Supplier usersClient; + + protected final Supplier webhookReceiversClient; + + public KnowledgebaseClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.accountDetailsClient = Suppliers.memoize(() -> new AccountDetailsClient(clientOptions)); + this.accountTokenClient = Suppliers.memoize(() -> new AccountTokenClient(clientOptions)); + this.articlesClient = Suppliers.memoize(() -> new ArticlesClient(clientOptions)); + this.asyncPassthroughClient = Suppliers.memoize(() -> new AsyncPassthroughClient(clientOptions)); + this.attachmentsClient = Suppliers.memoize(() -> new AttachmentsClient(clientOptions)); + this.auditTrailClient = Suppliers.memoize(() -> new AuditTrailClient(clientOptions)); + this.availableActionsClient = Suppliers.memoize(() -> new AvailableActionsClient(clientOptions)); + this.containersClient = Suppliers.memoize(() -> new ContainersClient(clientOptions)); + this.scopesClient = Suppliers.memoize(() -> new ScopesClient(clientOptions)); + this.deleteAccountClient = Suppliers.memoize(() -> new DeleteAccountClient(clientOptions)); + this.fieldMappingClient = Suppliers.memoize(() -> new FieldMappingClient(clientOptions)); + this.generateKeyClient = Suppliers.memoize(() -> new GenerateKeyClient(clientOptions)); + this.groupsClient = Suppliers.memoize(() -> new GroupsClient(clientOptions)); + this.issuesClient = Suppliers.memoize(() -> new IssuesClient(clientOptions)); + this.linkTokenClient = Suppliers.memoize(() -> new LinkTokenClient(clientOptions)); + this.linkedAccountsClient = Suppliers.memoize(() -> new LinkedAccountsClient(clientOptions)); + this.passthroughClient = Suppliers.memoize(() -> new PassthroughClient(clientOptions)); + this.regenerateKeyClient = Suppliers.memoize(() -> new RegenerateKeyClient(clientOptions)); + this.syncStatusClient = Suppliers.memoize(() -> new SyncStatusClient(clientOptions)); + this.forceResyncClient = Suppliers.memoize(() -> new ForceResyncClient(clientOptions)); + this.usersClient = Suppliers.memoize(() -> new UsersClient(clientOptions)); + this.webhookReceiversClient = Suppliers.memoize(() -> new WebhookReceiversClient(clientOptions)); + } + + public AccountDetailsClient accountDetails() { + return this.accountDetailsClient.get(); + } + + public AccountTokenClient accountToken() { + return this.accountTokenClient.get(); + } + + public ArticlesClient articles() { + return this.articlesClient.get(); + } + + public AsyncPassthroughClient asyncPassthrough() { + return this.asyncPassthroughClient.get(); + } + + public AttachmentsClient attachments() { + return this.attachmentsClient.get(); + } + + public AuditTrailClient auditTrail() { + return this.auditTrailClient.get(); + } + + public AvailableActionsClient availableActions() { + return this.availableActionsClient.get(); + } + + public ContainersClient containers() { + return this.containersClient.get(); + } + + public ScopesClient scopes() { + return this.scopesClient.get(); + } + + public DeleteAccountClient deleteAccount() { + return this.deleteAccountClient.get(); + } + + public FieldMappingClient fieldMapping() { + return this.fieldMappingClient.get(); + } + + public GenerateKeyClient generateKey() { + return this.generateKeyClient.get(); + } + + public GroupsClient groups() { + return this.groupsClient.get(); + } + + public IssuesClient issues() { + return this.issuesClient.get(); + } + + public LinkTokenClient linkToken() { + return this.linkTokenClient.get(); + } + + public LinkedAccountsClient linkedAccounts() { + return this.linkedAccountsClient.get(); + } + + public PassthroughClient passthrough() { + return this.passthroughClient.get(); + } + + public RegenerateKeyClient regenerateKey() { + return this.regenerateKeyClient.get(); + } + + public SyncStatusClient syncStatus() { + return this.syncStatusClient.get(); + } + + public ForceResyncClient forceResync() { + return this.forceResyncClient.get(); + } + + public UsersClient users() { + return this.usersClient.get(); + } + + public WebhookReceiversClient webhookReceivers() { + return this.webhookReceiversClient.get(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/LinkTokenClient.java b/src/main/java/com/merge/api/knowledgebase/LinkTokenClient.java new file mode 100644 index 000000000..cbd452a7f --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/LinkTokenClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.EndUserDetailsRequest; +import com.merge.api.knowledgebase.types.LinkToken; + +public class LinkTokenClient { + protected final ClientOptions clientOptions; + + private final RawLinkTokenClient rawClient; + + public LinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkTokenClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkTokenClient withRawResponse() { + return this.rawClient; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public LinkToken create(EndUserDetailsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/LinkedAccountsClient.java b/src/main/java/com/merge/api/knowledgebase/LinkedAccountsClient.java new file mode 100644 index 000000000..2a4a6d23b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/LinkedAccountsClient.java @@ -0,0 +1,50 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AccountDetailsAndActions; +import com.merge.api.knowledgebase.types.LinkedAccountsListRequest; + +public class LinkedAccountsClient { + protected final ClientOptions clientOptions; + + private final RawLinkedAccountsClient rawClient; + + public LinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawLinkedAccountsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawLinkedAccountsClient withRawResponse() { + return this.rawClient; + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list(LinkedAccountsListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * List linked accounts for your organization. + */ + public SyncPagingIterable list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/PassthroughClient.java b/src/main/java/com/merge/api/knowledgebase/PassthroughClient.java new file mode 100644 index 000000000..e224463b1 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/PassthroughClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.DataPassthroughRequest; +import com.merge.api.knowledgebase.types.RemoteResponse; + +public class PassthroughClient { + protected final ClientOptions clientOptions; + + private final RawPassthroughClient rawClient; + + public PassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawPassthroughClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawPassthroughClient withRawResponse() { + return this.rawClient; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public RemoteResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawAccountDetailsClient.java b/src/main/java/com/merge/api/knowledgebase/RawAccountDetailsClient.java new file mode 100644 index 000000000..40bfbd034 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawAccountDetailsClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountDetails; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountDetailsClient { + protected final ClientOptions clientOptions; + + public RawAccountDetailsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Get details for a linked account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/account-details") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawAccountTokenClient.java b/src/main/java/com/merge/api/knowledgebase/RawAccountTokenClient.java new file mode 100644 index 000000000..75060b3bb --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawAccountTokenClient.java @@ -0,0 +1,109 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AccountToken; +import com.merge.api.knowledgebase.types.RegenerateAccountToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAccountTokenClient { + protected final ClientOptions clientOptions; + + public RawAccountTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken) { + return retrieve(publicToken, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/account-token") + .addPathSegment(publicToken) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawArticlesClient.java b/src/main/java/com/merge/api/knowledgebase/RawArticlesClient.java new file mode 100644 index 000000000..972437283 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawArticlesClient.java @@ -0,0 +1,227 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Article; +import com.merge.api.knowledgebase.types.ArticlesListRequest; +import com.merge.api.knowledgebase.types.ArticlesRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedArticleList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawArticlesClient { + protected final ClientOptions clientOptions; + + public RawArticlesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Article objects. + */ + public MergeApiHttpResponse> list() { + return list(ArticlesListRequest.builder().build()); + } + + /** + * Returns a list of Article objects. + */ + public MergeApiHttpResponse> list(ArticlesListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Article objects. + */ + public MergeApiHttpResponse> list( + ArticlesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/articles"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getParentArticleId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_article_id", request.getParentArticleId().get(), false); + } + if (request.getParentContainerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "parent_container_id", + request.getParentContainerId().get(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getRootContainerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "root_container_id", request.getRootContainerId().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "type", request.getType().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedArticleList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedArticleList.class); + Optional startingAfter = parsedResponse.getNext(); + ArticlesListRequest nextRequest = ArticlesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List
            result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable
            (startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Article object with the given id. + */ + public MergeApiHttpResponse
            retrieve(String id) { + return retrieve(id, ArticlesRetrieveRequest.builder().build()); + } + + /** + * Returns an Article object with the given id. + */ + public MergeApiHttpResponse
            retrieve(String id, ArticlesRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Article object with the given id. + */ + public MergeApiHttpResponse
            retrieve( + String id, ArticlesRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/articles") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Article.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/knowledgebase/RawAsyncPassthroughClient.java new file mode 100644 index 000000000..4fa79661e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawAsyncPassthroughClient.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AsyncPassthroughReciept; +import com.merge.api.knowledgebase.types.AsyncPassthroughRetrieveResponse; +import com.merge.api.knowledgebase.types.DataPassthroughRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAsyncPassthroughClient { + protected final ClientOptions clientOptions; + + public RawAsyncPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Asynchronously pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create( + DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/async-passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { + return retrieve(asyncPassthroughReceiptId, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/async-passthrough") + .addPathSegment(asyncPassthroughReceiptId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawAttachmentsClient.java b/src/main/java/com/merge/api/knowledgebase/RawAttachmentsClient.java new file mode 100644 index 000000000..2a1c102ae --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawAttachmentsClient.java @@ -0,0 +1,197 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Attachment; +import com.merge.api.knowledgebase.types.AttachmentsListRequest; +import com.merge.api.knowledgebase.types.AttachmentsRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedAttachmentList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAttachmentsClient { + protected final ClientOptions clientOptions; + + public RawAttachmentsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list() { + return list(AttachmentsListRequest.builder().build()); + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list(AttachmentsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Attachment objects. + */ + public MergeApiHttpResponse> list( + AttachmentsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/attachments"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); + Optional startingAfter = parsedResponse.getNext(); + AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, AttachmentsRetrieveRequest.builder().build()); + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, AttachmentsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an Attachment object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AttachmentsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/attachments") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Attachment.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawAuditTrailClient.java b/src/main/java/com/merge/api/knowledgebase/RawAuditTrailClient.java new file mode 100644 index 000000000..d77301474 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawAuditTrailClient.java @@ -0,0 +1,116 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AuditLogEvent; +import com.merge.api.knowledgebase.types.AuditTrailListRequest; +import com.merge.api.knowledgebase.types.PaginatedAuditLogEventList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAuditTrailClient { + protected final ClientOptions clientOptions; + + public RawAuditTrailClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list() { + return list(AuditTrailListRequest.builder().build()); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list(AuditTrailListRequest request) { + return list(request, null); + } + + /** + * Gets a list of audit trail events. + */ + public MergeApiHttpResponse> list( + AuditTrailListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/audit-trail"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEventType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "event_type", request.getEventType().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getUserEmail().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "user_email", request.getUserEmail().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAuditLogEventList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + Optional startingAfter = parsedResponse.getNext(); + AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawAvailableActionsClient.java b/src/main/java/com/merge/api/knowledgebase/RawAvailableActionsClient.java new file mode 100644 index 000000000..b6e28f887 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawAvailableActionsClient.java @@ -0,0 +1,66 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.AvailableActions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawAvailableActionsClient { + protected final ClientOptions clientOptions; + + public RawAvailableActionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve() { + return retrieve(null); + } + + /** + * Returns a list of models and actions available for an account. + */ + public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/available-actions") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawContainersClient.java b/src/main/java/com/merge/api/knowledgebase/RawContainersClient.java new file mode 100644 index 000000000..eabffb19b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawContainersClient.java @@ -0,0 +1,219 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Container; +import com.merge.api.knowledgebase.types.ContainersListRequest; +import com.merge.api.knowledgebase.types.ContainersRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedContainerList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawContainersClient { + protected final ClientOptions clientOptions; + + public RawContainersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Container objects. + */ + public MergeApiHttpResponse> list() { + return list(ContainersListRequest.builder().build()); + } + + /** + * Returns a list of Container objects. + */ + public MergeApiHttpResponse> list(ContainersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Container objects. + */ + public MergeApiHttpResponse> list( + ContainersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/containers"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getParentArticleId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "parent_article_id", request.getParentArticleId().get(), false); + } + if (request.getParentContainerId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "parent_container_id", + request.getParentContainerId().get(), + false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getType().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "type", request.getType().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedContainerList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContainerList.class); + Optional startingAfter = parsedResponse.getNext(); + ContainersListRequest nextRequest = ContainersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Container object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, ContainersRetrieveRequest.builder().build()); + } + + /** + * Returns a Container object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, ContainersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Container object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, ContainersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/containers") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Container.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawDeleteAccountClient.java b/src/main/java/com/merge/api/knowledgebase/RawDeleteAccountClient.java new file mode 100644 index 000000000..b956ba956 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawDeleteAccountClient.java @@ -0,0 +1,64 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawDeleteAccountClient { + protected final ClientOptions clientOptions; + + public RawDeleteAccountClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete() { + return delete(null); + } + + /** + * Delete a linked account. + */ + public MergeApiHttpResponse delete(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/delete-account") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>(null, response); + } + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawFieldMappingClient.java b/src/main/java/com/merge/api/knowledgebase/RawFieldMappingClient.java new file mode 100644 index 000000000..eef1d30a3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawFieldMappingClient.java @@ -0,0 +1,410 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CreateFieldMappingRequest; +import com.merge.api.knowledgebase.types.CreateTargetFieldRequest; +import com.merge.api.knowledgebase.types.ExternalTargetFieldApiResponse; +import com.merge.api.knowledgebase.types.FieldMappingApiInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingInstanceResponse; +import com.merge.api.knowledgebase.types.FieldMappingsRetrieveRequest; +import com.merge.api.knowledgebase.types.PatchedEditFieldMappingRequest; +import com.merge.api.knowledgebase.types.RemoteFieldApiResponse; +import com.merge.api.knowledgebase.types.RemoteFieldsRetrieveRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawFieldMappingClient { + protected final ClientOptions clientOptions; + + public RawFieldMappingClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve() { + return fieldMappingsRetrieve(FieldMappingsRetrieveRequest.builder().build()); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request) { + return fieldMappingsRetrieve(request, null); + } + + /** + * Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. Learn more. + */ + public MergeApiHttpResponse fieldMappingsRetrieve( + FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsCreate(CreateFieldMappingRequest request) { + return fieldMappingsCreate(request, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsCreate( + CreateFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings"); + if (request.getExcludeRemoteFieldMetadata().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "exclude_remote_field_metadata", + request.getExcludeRemoteFieldMetadata().get(), + false); + } + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsDestroy(String fieldMappingId) { + return fieldMappingsDestroy(fieldMappingId, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsDestroy( + String fieldMappingId, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings") + .addPathSegment(fieldMappingId) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("DELETE", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate(String fieldMappingId) { + return fieldMappingsPartialUpdate( + fieldMappingId, PatchedEditFieldMappingRequest.builder().build()); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request) { + return fieldMappingsPartialUpdate(fieldMappingId, request, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse fieldMappingsPartialUpdate( + String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/field-mappings") + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (Exception e) { + throw new RuntimeException(e); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("PATCH", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse remoteFieldsRetrieve() { + return remoteFieldsRetrieve(RemoteFieldsRetrieveRequest.builder().build()); + } + + /** + * 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. + */ + public MergeApiHttpResponse remoteFieldsRetrieve(RemoteFieldsRetrieveRequest request) { + return remoteFieldsRetrieve(request, 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. + */ + public MergeApiHttpResponse remoteFieldsRetrieve( + RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/remote-fields"); + if (request.getCommonModels().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "common_models", request.getCommonModels().get(), false); + } + if (request.getIncludeExampleValues().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_example_values", + request.getIncludeExampleValues().get(), + false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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. + */ + public MergeApiHttpResponse targetFieldsRetrieve() { + return targetFieldsRetrieve(null); + } + + /** + * 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. + */ + public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/target-fields") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public MergeApiHttpResponse targetFieldsCreate(CreateTargetFieldRequest request) { + return targetFieldsCreate(request, null); + } + + /** + * Create a new organization-wide Target Field. Target Fields are custom fields that your organization defines to collect supplemental data from integrations. Learn more. + */ + public MergeApiHttpResponse targetFieldsCreate( + CreateTargetFieldRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/target-fields") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawForceResyncClient.java b/src/main/java/com/merge/api/knowledgebase/RawForceResyncClient.java new file mode 100644 index 000000000..07e91a5ef --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawForceResyncClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.SyncStatus; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawForceResyncClient { + protected final ClientOptions clientOptions; + + public RawForceResyncClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public MergeApiHttpResponse> syncStatusResyncCreate() { + return syncStatusResyncCreate(null); + } + + /** + * 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. + */ + public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/sync-status/resync") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawGenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/RawGenerateKeyClient.java new file mode 100644 index 000000000..3f269171b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawGenerateKeyClient.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.GenerateRemoteKeyRequest; +import com.merge.api.knowledgebase.types.RemoteKey; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawGenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) { + return create(request, null); + } + + /** + * Create a remote key. + */ + public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/generate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawGroupsClient.java b/src/main/java/com/merge/api/knowledgebase/RawGroupsClient.java new file mode 100644 index 000000000..2e5cb389c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawGroupsClient.java @@ -0,0 +1,204 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Group; +import com.merge.api.knowledgebase.types.GroupsListRequest; +import com.merge.api.knowledgebase.types.GroupsRetrieveRequest; +import com.merge.api.knowledgebase.types.PaginatedGroupList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawGroupsClient { + protected final ClientOptions clientOptions; + + public RawGroupsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list() { + return list(GroupsListRequest.builder().build()); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list(GroupsListRequest request) { + return list(request, null); + } + + /** + * Returns a list of Group objects. + */ + public MergeApiHttpResponse> list( + GroupsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/groups"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedGroupList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + Optional startingAfter = parsedResponse.getNext(); + GroupsListRequest nextRequest = GroupsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, GroupsRetrieveRequest.builder().build()); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, GroupsRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a Group object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/groups") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getExpand().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "expand", request.getExpand().get(), true); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Group.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawIssuesClient.java b/src/main/java/com/merge/api/knowledgebase/RawIssuesClient.java new file mode 100644 index 000000000..8a47c8735 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawIssuesClient.java @@ -0,0 +1,202 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.Issue; +import com.merge.api.knowledgebase.types.IssuesListRequest; +import com.merge.api.knowledgebase.types.PaginatedIssueList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawIssuesClient { + protected final ClientOptions clientOptions; + + public RawIssuesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list() { + return list(IssuesListRequest.builder().build()); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list(IssuesListRequest request) { + return list(request, null); + } + + /** + * Gets all issues for Organization. + */ + public MergeApiHttpResponse> list( + IssuesListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/issues"); + if (request.getAccountToken().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_token", request.getAccountToken().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_date", request.getEndDate().get(), false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getFirstIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_after", + request.getFirstIncidentTimeAfter().get(), + false); + } + if (request.getFirstIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "first_incident_time_before", + request.getFirstIncidentTimeBefore().get(), + false); + } + if (request.getIncludeMuted().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_muted", request.getIncludeMuted().get(), false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getLastIncidentTimeAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_after", + request.getLastIncidentTimeAfter().get(), + false); + } + if (request.getLastIncidentTimeBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "last_incident_time_before", + request.getLastIncidentTimeBefore().get(), + false); + } + if (request.getLinkedAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "linked_account_id", request.getLinkedAccountId().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStartDate().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "start_date", request.getStartDate().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedIssueList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + Optional startingAfter = parsedResponse.getNext(); + IssuesListRequest nextRequest = IssuesListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, null); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/issues") + .addPathSegment(id) + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawLinkTokenClient.java b/src/main/java/com/merge/api/knowledgebase/RawLinkTokenClient.java new file mode 100644 index 000000000..3c8177479 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawLinkTokenClient.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.EndUserDetailsRequest; +import com.merge.api.knowledgebase.types.LinkToken; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkTokenClient { + protected final ClientOptions clientOptions; + + public RawLinkTokenClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request) { + return create(request, null); + } + + /** + * Creates a link token to be used when linking a new end user. The link token expires after single use. + */ + public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/link-token") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/knowledgebase/RawLinkedAccountsClient.java new file mode 100644 index 000000000..a758122fe --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawLinkedAccountsClient.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.AccountDetailsAndActions; +import com.merge.api.knowledgebase.types.LinkedAccountsListRequest; +import com.merge.api.knowledgebase.types.PaginatedAccountDetailsAndActionsList; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawLinkedAccountsClient { + protected final ClientOptions clientOptions; + + public RawLinkedAccountsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list() { + return list(LinkedAccountsListRequest.builder().build()); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list(LinkedAccountsListRequest request) { + return list(request, null); + } + + /** + * List linked accounts for your organization. + */ + public MergeApiHttpResponse> list( + LinkedAccountsListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/linked-accounts"); + if (request.getCategory().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "category", request.getCategory().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getEndUserEmailAddress().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_email_address", + request.getEndUserEmailAddress().get(), + false); + } + if (request.getEndUserOrganizationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_organization_name", + request.getEndUserOrganizationName().get(), + false); + } + if (request.getEndUserOriginId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "end_user_origin_id", request.getEndUserOriginId().get(), false); + } + if (request.getEndUserOriginIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "end_user_origin_ids", + request.getEndUserOriginIds().get(), + false); + } + if (request.getId().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "id", request.getId().get(), false); + } + if (request.getIds().isPresent()) { + QueryStringMapper.addQueryParameter(httpUrl, "ids", request.getIds().get(), false); + } + if (request.getIncludeDuplicates().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_duplicates", + request.getIncludeDuplicates().get(), + false); + } + if (request.getIntegrationName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "integration_name", request.getIntegrationName().get(), false); + } + if (request.getIsTestAccount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "is_test_account", request.getIsTestAccount().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + Optional startingAfter = parsedResponse.getNext(); + LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = + parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawPassthroughClient.java b/src/main/java/com/merge/api/knowledgebase/RawPassthroughClient.java new file mode 100644 index 000000000..457f85319 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawPassthroughClient.java @@ -0,0 +1,78 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.DataPassthroughRequest; +import com.merge.api.knowledgebase.types.RemoteResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawPassthroughClient { + protected final ClientOptions clientOptions; + + public RawPassthroughClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request) { + return create(request, null); + } + + /** + * Pull data from an endpoint not currently supported by Merge. + */ + public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/passthrough") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/RawRegenerateKeyClient.java new file mode 100644 index 000000000..cd3a19b39 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawRegenerateKeyClient.java @@ -0,0 +1,79 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.RemoteKey; +import com.merge.api.knowledgebase.types.RemoteKeyForRegenerationRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawRegenerateKeyClient { + protected final ClientOptions clientOptions; + + public RawRegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create(RemoteKeyForRegenerationRequest request) { + return create(request, null); + } + + /** + * Exchange remote keys. + */ + public MergeApiHttpResponse create( + RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/regenerate-key") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawScopesClient.java b/src/main/java/com/merge/api/knowledgebase/RawScopesClient.java new file mode 100644 index 000000000..cf43d9a14 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawScopesClient.java @@ -0,0 +1,158 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CommonModelScopeApi; +import com.merge.api.knowledgebase.types.LinkedAccountCommonModelScopeDeserializerRequest; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawScopesClient { + protected final ClientOptions clientOptions; + + public RawScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve() { + return defaultScopesRetrieve(null); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/default-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve() { + return linkedAccountScopesRetrieve(null); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/linked-account-scopes") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * 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 + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request) { + return linkedAccountScopesCreate(request, null); + } + + /** + * 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 + */ + public MergeApiHttpResponse linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/linked-account-scopes") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawSyncStatusClient.java b/src/main/java/com/merge/api/knowledgebase/RawSyncStatusClient.java new file mode 100644 index 000000000..59af2e790 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawSyncStatusClient.java @@ -0,0 +1,100 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.PaginatedSyncStatusList; +import com.merge.api.knowledgebase.types.SyncStatus; +import com.merge.api.knowledgebase.types.SyncStatusListRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawSyncStatusClient { + protected final ClientOptions clientOptions; + + public RawSyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * 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. + */ + public MergeApiHttpResponse> list() { + return list(SyncStatusListRequest.builder().build()); + } + + /** + * 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. + */ + public MergeApiHttpResponse> list(SyncStatusListRequest request) { + return list(request, null); + } + + /** + * 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. + */ + public MergeApiHttpResponse> list( + SyncStatusListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/sync-status"); + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + Optional startingAfter = parsedResponse.getNext(); + SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable( + startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawUsersClient.java b/src/main/java/com/merge/api/knowledgebase/RawUsersClient.java new file mode 100644 index 000000000..aa424d9d3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawUsersClient.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.QueryStringMapper; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.PaginatedUserList; +import com.merge.api.knowledgebase.types.User; +import com.merge.api.knowledgebase.types.UsersListRequest; +import com.merge.api.knowledgebase.types.UsersRetrieveRequest; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawUsersClient { + protected final ClientOptions clientOptions; + + public RawUsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list() { + return list(UsersListRequest.builder().build()); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list(UsersListRequest request) { + return list(request, null); + } + + /** + * Returns a list of User objects. + */ + public MergeApiHttpResponse> list( + UsersListRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/users"); + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "cursor", request.getCursor().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getModifiedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_after", request.getModifiedAfter().get(), false); + } + if (request.getModifiedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "modified_before", request.getModifiedBefore().get(), false); + } + if (request.getPageSize().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "page_size", request.getPageSize().get(), false); + } + if (request.getRemoteId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_id", request.getRemoteId().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + PaginatedUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + Optional startingAfter = parsedResponse.getNext(); + UsersListRequest nextRequest = UsersListRequest.builder() + .from(request) + .cursor(startingAfter) + .build(); + List result = parsedResponse.getResults().orElse(Collections.emptyList()); + return new MergeApiHttpResponse<>( + new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + nextRequest, requestOptions) + .body()), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id) { + return retrieve(id, UsersRetrieveRequest.builder().build()); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns a User object with the given id. + */ + public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/users") + .addPathSegment(id); + if (request.getIncludeRemoteData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_data", + request.getIncludeRemoteData().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/knowledgebase/RawWebhookReceiversClient.java new file mode 100644 index 000000000..7bf80eba3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RawWebhookReceiversClient.java @@ -0,0 +1,121 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.merge.api.core.ApiError; +import com.merge.api.core.ClientOptions; +import com.merge.api.core.MediaTypes; +import com.merge.api.core.MergeApiHttpResponse; +import com.merge.api.core.MergeException; +import com.merge.api.core.ObjectMappers; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.WebhookReceiver; +import com.merge.api.knowledgebase.types.WebhookReceiverRequest; +import java.io.IOException; +import java.util.List; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawWebhookReceiversClient { + protected final ClientOptions clientOptions; + + public RawWebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list() { + return list(null); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public MergeApiHttpResponse> list(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/webhook-receivers") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue( + responseBodyString, new TypeReference>() {}), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request) { + return create(request, null); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("knowledgebase/v1/webhook-receivers") + .build(); + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new MergeException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/RegenerateKeyClient.java b/src/main/java/com/merge/api/knowledgebase/RegenerateKeyClient.java new file mode 100644 index 000000000..9049a83c9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/RegenerateKeyClient.java @@ -0,0 +1,41 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.RemoteKey; +import com.merge.api.knowledgebase.types.RemoteKeyForRegenerationRequest; + +public class RegenerateKeyClient { + protected final ClientOptions clientOptions; + + private final RawRegenerateKeyClient rawClient; + + public RegenerateKeyClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawRegenerateKeyClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawRegenerateKeyClient withRawResponse() { + return this.rawClient; + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Exchange remote keys. + */ + public RemoteKey create(RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/ScopesClient.java b/src/main/java/com/merge/api/knowledgebase/ScopesClient.java new file mode 100644 index 000000000..8ccb4de4c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/ScopesClient.java @@ -0,0 +1,70 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.CommonModelScopeApi; +import com.merge.api.knowledgebase.types.LinkedAccountCommonModelScopeDeserializerRequest; + +public class ScopesClient { + protected final ClientOptions clientOptions; + + private final RawScopesClient rawClient; + + public ScopesClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawScopesClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawScopesClient withRawResponse() { + return this.rawClient; + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve() { + return this.rawClient.defaultScopesRetrieve().body(); + } + + /** + * Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. Learn more. + */ + public CommonModelScopeApi defaultScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.defaultScopesRetrieve(requestOptions).body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve() { + return this.rawClient.linkedAccountScopesRetrieve().body(); + } + + /** + * Get all available permissions for Merge Common Models and fields for a single Linked Account. Learn more. + */ + public CommonModelScopeApi linkedAccountScopesRetrieve(RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesRetrieve(requestOptions).body(); + } + + /** + * 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 + */ + public CommonModelScopeApi linkedAccountScopesCreate(LinkedAccountCommonModelScopeDeserializerRequest request) { + return this.rawClient.linkedAccountScopesCreate(request).body(); + } + + /** + * 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 + */ + public CommonModelScopeApi linkedAccountScopesCreate( + LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { + return this.rawClient.linkedAccountScopesCreate(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/SyncStatusClient.java b/src/main/java/com/merge/api/knowledgebase/SyncStatusClient.java new file mode 100644 index 000000000..6fa4b82bd --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/SyncStatusClient.java @@ -0,0 +1,49 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.SyncStatus; +import com.merge.api.knowledgebase.types.SyncStatusListRequest; + +public class SyncStatusClient { + protected final ClientOptions clientOptions; + + private final RawSyncStatusClient rawClient; + + public SyncStatusClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawSyncStatusClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawSyncStatusClient withRawResponse() { + return this.rawClient; + } + + /** + * 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. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * 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. + */ + public SyncPagingIterable list(SyncStatusListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * 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. + */ + public SyncPagingIterable list(SyncStatusListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/UsersClient.java b/src/main/java/com/merge/api/knowledgebase/UsersClient.java new file mode 100644 index 000000000..2bef62eec --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/UsersClient.java @@ -0,0 +1,71 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.core.SyncPagingIterable; +import com.merge.api.knowledgebase.types.User; +import com.merge.api.knowledgebase.types.UsersListRequest; +import com.merge.api.knowledgebase.types.UsersRetrieveRequest; + +public class UsersClient { + protected final ClientOptions clientOptions; + + private final RawUsersClient rawClient; + + public UsersClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawUsersClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawUsersClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request) { + return this.rawClient.list(request).body(); + } + + /** + * Returns a list of User objects. + */ + public SyncPagingIterable list(UsersListRequest request, RequestOptions requestOptions) { + return this.rawClient.list(request, requestOptions).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id) { + return this.rawClient.retrieve(id).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns a User object with the given id. + */ + public User retrieve(String id, UsersRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/WebhookReceiversClient.java b/src/main/java/com/merge/api/knowledgebase/WebhookReceiversClient.java new file mode 100644 index 000000000..1dda4c024 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/WebhookReceiversClient.java @@ -0,0 +1,56 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase; + +import com.merge.api.core.ClientOptions; +import com.merge.api.core.RequestOptions; +import com.merge.api.knowledgebase.types.WebhookReceiver; +import com.merge.api.knowledgebase.types.WebhookReceiverRequest; +import java.util.List; + +public class WebhookReceiversClient { + protected final ClientOptions clientOptions; + + private final RawWebhookReceiversClient rawClient; + + public WebhookReceiversClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawWebhookReceiversClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawWebhookReceiversClient withRawResponse() { + return this.rawClient; + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list() { + return this.rawClient.list().body(); + } + + /** + * Returns a list of WebhookReceiver objects. + */ + public List list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Creates a WebhookReceiver object with the given values. + */ + public WebhookReceiver create(WebhookReceiverRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountDetails.java b/src/main/java/com/merge/api/knowledgebase/types/AccountDetails.java new file mode 100644 index 000000000..e694e8654 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountDetails.java @@ -0,0 +1,451 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetails.Builder.class) +public final class AccountDetails { + private final Optional id; + + private final Optional integration; + + private final Optional integrationSlug; + + private final Optional category; + + private final Optional endUserOriginId; + + private final Optional endUserOrganizationName; + + private final Optional endUserEmailAddress; + + private final Optional status; + + private final Optional webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional accountType; + + private final Optional completedAt; + + private final Optional instanceId; + + private final Optional instanceDisplayValue; + + private final Map additionalProperties; + + private AccountDetails( + Optional id, + Optional integration, + Optional integrationSlug, + Optional category, + Optional endUserOriginId, + Optional endUserOrganizationName, + Optional endUserEmailAddress, + Optional status, + Optional webhookListenerUrl, + Optional isDuplicate, + Optional accountType, + Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, + Map additionalProperties) { + this.id = id; + this.integration = integration; + this.integrationSlug = integrationSlug; + this.category = category; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.status = status; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.accountType = accountType; + this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("integration_slug") + public Optional getIntegrationSlug() { + return integrationSlug; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("webhook_listener_url") + public Optional getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return 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. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("account_type") + public Optional getAccountType() { + return accountType; + } + + /** + * @return The time at which account completes the linking flow. + */ + @JsonProperty("completed_at") + public Optional getCompletedAt() { + return completedAt; + } + + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetails && equalTo((AccountDetails) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetails other) { + return id.equals(other.id) + && integration.equals(other.integration) + && integrationSlug.equals(other.integrationSlug) + && category.equals(other.category) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && status.equals(other.status) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.integration, + this.integrationSlug, + this.category, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.status, + this.webhookListenerUrl, + this.isDuplicate, + this.accountType, + this.completedAt, + this.instanceId, + this.instanceDisplayValue); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional integrationSlug = Optional.empty(); + + private Optional category = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional webhookListenerUrl = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional accountType = Optional.empty(); + + private Optional completedAt = Optional.empty(); + + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountDetails other) { + id(other.getId()); + integration(other.getIntegration()); + integrationSlug(other.getIntegrationSlug()); + category(other.getCategory()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + status(other.getStatus()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public Builder integration(Optional integration) { + this.integration = integration; + return this; + } + + public Builder integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @JsonSetter(value = "integration_slug", nulls = Nulls.SKIP) + public Builder integrationSlug(Optional integrationSlug) { + this.integrationSlug = integrationSlug; + return this; + } + + public Builder integrationSlug(String integrationSlug) { + this.integrationSlug = Optional.ofNullable(integrationSlug); + return this; + } + + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(AccountDetailsCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + @JsonSetter(value = "webhook_listener_url", nulls = Nulls.SKIP) + public Builder webhookListenerUrl(Optional webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + public Builder webhookListenerUrl(String webhookListenerUrl) { + this.webhookListenerUrl = Optional.ofNullable(webhookListenerUrl); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public Builder isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + public Builder isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) + public Builder accountType(Optional accountType) { + this.accountType = accountType; + return this; + } + + public Builder accountType(String accountType) { + this.accountType = Optional.ofNullable(accountType); + return this; + } + + /** + *

            The time at which account completes the linking flow.

            + */ + @JsonSetter(value = "completed_at", nulls = Nulls.SKIP) + public Builder completedAt(Optional completedAt) { + this.completedAt = completedAt; + return this; + } + + public Builder completedAt(OffsetDateTime completedAt) { + this.completedAt = Optional.ofNullable(completedAt); + return this; + } + + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + + public AccountDetails build() { + return new AccountDetails( + id, + integration, + integrationSlug, + category, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + status, + webhookListenerUrl, + isDuplicate, + accountType, + completedAt, + instanceId, + instanceDisplayValue, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActions.java new file mode 100644 index 000000000..fcbc90682 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActions.java @@ -0,0 +1,525 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActions.Builder.class) +public final class AccountDetailsAndActions { + private final String id; + + private final Optional category; + + private final AccountDetailsAndActionsStatus status; + + private final Optional statusDetail; + + private final Optional endUserOriginId; + + private final String endUserOrganizationName; + + private final String endUserEmailAddress; + + private final Optional subdomain; + + private final String webhookListenerUrl; + + private final Optional isDuplicate; + + private final Optional integration; + + private final String accountType; + + private final OffsetDateTime completedAt; + + private final Optional> integrationSpecificFields; + + private final Map additionalProperties; + + private AccountDetailsAndActions( + String id, + Optional category, + AccountDetailsAndActionsStatus status, + Optional statusDetail, + Optional endUserOriginId, + String endUserOrganizationName, + String endUserEmailAddress, + Optional subdomain, + String webhookListenerUrl, + Optional isDuplicate, + Optional integration, + String accountType, + OffsetDateTime completedAt, + Optional> integrationSpecificFields, + Map additionalProperties) { + this.id = id; + this.category = category; + this.status = status; + this.statusDetail = statusDetail; + this.endUserOriginId = endUserOriginId; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserEmailAddress = endUserEmailAddress; + this.subdomain = subdomain; + this.webhookListenerUrl = webhookListenerUrl; + this.isDuplicate = isDuplicate; + this.integration = integration; + this.accountType = accountType; + this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + @JsonProperty("status") + public AccountDetailsAndActionsStatus getStatus() { + return status; + } + + @JsonProperty("status_detail") + public Optional getStatusDetail() { + return statusDetail; + } + + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return The tenant or domain the customer has provided access to. + */ + @JsonProperty("subdomain") + public Optional getSubdomain() { + return subdomain; + } + + @JsonProperty("webhook_listener_url") + public String getWebhookListenerUrl() { + return webhookListenerUrl; + } + + /** + * @return 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. + */ + @JsonProperty("is_duplicate") + public Optional getIsDuplicate() { + return isDuplicate; + } + + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + @JsonProperty("account_type") + public String getAccountType() { + return accountType; + } + + @JsonProperty("completed_at") + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActions && equalTo((AccountDetailsAndActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActions other) { + return id.equals(other.id) + && category.equals(other.category) + && status.equals(other.status) + && statusDetail.equals(other.statusDetail) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && subdomain.equals(other.subdomain) + && webhookListenerUrl.equals(other.webhookListenerUrl) + && isDuplicate.equals(other.isDuplicate) + && integration.equals(other.integration) + && accountType.equals(other.accountType) + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.category, + this.status, + this.statusDetail, + this.endUserOriginId, + this.endUserOrganizationName, + this.endUserEmailAddress, + this.subdomain, + this.webhookListenerUrl, + this.isDuplicate, + this.integration, + this.accountType, + this.completedAt, + this.integrationSpecificFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + StatusStage id(@NotNull String id); + + Builder from(AccountDetailsAndActions other); + } + + public interface StatusStage { + EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatus status); + } + + public interface EndUserOrganizationNameStage { + EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserEmailAddressStage { + WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress); + } + + public interface WebhookListenerUrlStage { + AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl); + } + + public interface AccountTypeStage { + CompletedAtStage accountType(@NotNull String accountType); + } + + public interface CompletedAtStage { + _FinalStage completedAt(@NotNull OffsetDateTime completedAt); + } + + public interface _FinalStage { + AccountDetailsAndActions build(); + + _FinalStage category(Optional category); + + _FinalStage category(AccountDetailsAndActionsCategory category); + + _FinalStage statusDetail(Optional statusDetail); + + _FinalStage statusDetail(String statusDetail); + + _FinalStage endUserOriginId(Optional endUserOriginId); + + _FinalStage endUserOriginId(String endUserOriginId); + + /** + *

            The tenant or domain the customer has provided access to.

            + */ + _FinalStage subdomain(Optional subdomain); + + _FinalStage subdomain(String subdomain); + + /** + *

            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.

            + */ + _FinalStage isDuplicate(Optional isDuplicate); + + _FinalStage isDuplicate(Boolean isDuplicate); + + _FinalStage integration(Optional integration); + + _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + StatusStage, + EndUserOrganizationNameStage, + EndUserEmailAddressStage, + WebhookListenerUrlStage, + AccountTypeStage, + CompletedAtStage, + _FinalStage { + private String id; + + private AccountDetailsAndActionsStatus status; + + private String endUserOrganizationName; + + private String endUserEmailAddress; + + private String webhookListenerUrl; + + private String accountType; + + private OffsetDateTime completedAt; + + private Optional> integrationSpecificFields = Optional.empty(); + + private Optional integration = Optional.empty(); + + private Optional isDuplicate = Optional.empty(); + + private Optional subdomain = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional statusDetail = Optional.empty(); + + private Optional category = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActions other) { + id(other.getId()); + category(other.getCategory()); + status(other.getStatus()); + statusDetail(other.getStatusDetail()); + endUserOriginId(other.getEndUserOriginId()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserEmailAddress(other.getEndUserEmailAddress()); + subdomain(other.getSubdomain()); + webhookListenerUrl(other.getWebhookListenerUrl()); + isDuplicate(other.getIsDuplicate()); + integration(other.getIntegration()); + accountType(other.getAccountType()); + completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public EndUserOrganizationNameStage status(@NotNull AccountDetailsAndActionsStatus status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserEmailAddressStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + @java.lang.Override + @JsonSetter("end_user_email_address") + public WebhookListenerUrlStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + @java.lang.Override + @JsonSetter("webhook_listener_url") + public AccountTypeStage webhookListenerUrl(@NotNull String webhookListenerUrl) { + this.webhookListenerUrl = webhookListenerUrl; + return this; + } + + @java.lang.Override + @JsonSetter("account_type") + public CompletedAtStage accountType(@NotNull String accountType) { + this.accountType = accountType; + return this; + } + + @java.lang.Override + @JsonSetter("completed_at") + public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + + @java.lang.Override + public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isDuplicate(Boolean isDuplicate) { + this.isDuplicate = Optional.ofNullable(isDuplicate); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "is_duplicate", nulls = Nulls.SKIP) + public _FinalStage isDuplicate(Optional isDuplicate) { + this.isDuplicate = isDuplicate; + return this; + } + + /** + *

            The tenant or domain the customer has provided access to.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage subdomain(String subdomain) { + this.subdomain = Optional.ofNullable(subdomain); + return this; + } + + /** + *

            The tenant or domain the customer has provided access to.

            + */ + @java.lang.Override + @JsonSetter(value = "subdomain", nulls = Nulls.SKIP) + public _FinalStage subdomain(Optional subdomain) { + this.subdomain = subdomain; + return this; + } + + @java.lang.Override + public _FinalStage endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public _FinalStage endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + @java.lang.Override + public _FinalStage statusDetail(String statusDetail) { + this.statusDetail = Optional.ofNullable(statusDetail); + return this; + } + + @java.lang.Override + @JsonSetter(value = "status_detail", nulls = Nulls.SKIP) + public _FinalStage statusDetail(Optional statusDetail) { + this.statusDetail = statusDetail; + return this; + } + + @java.lang.Override + public _FinalStage category(AccountDetailsAndActionsCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + @java.lang.Override + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public _FinalStage category(Optional category) { + this.category = category; + return this; + } + + @java.lang.Override + public AccountDetailsAndActions build() { + return new AccountDetailsAndActions( + id, + category, + status, + statusDetail, + endUserOriginId, + endUserOrganizationName, + endUserEmailAddress, + subdomain, + webhookListenerUrl, + isDuplicate, + integration, + accountType, + completedAt, + integrationSpecificFields, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsCategory.java b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsCategory.java new file mode 100644 index 000000000..1f8130d43 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsCategory.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountDetailsAndActionsCategory.Deserializer.class) +public final class AccountDetailsAndActionsCategory { + private final Object value; + + private final int type; + + private AccountDetailsAndActionsCategory(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CategoryEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsCategory && equalTo((AccountDetailsAndActionsCategory) other); + } + + private boolean equalTo(AccountDetailsAndActionsCategory other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountDetailsAndActionsCategory of(CategoryEnum value) { + return new AccountDetailsAndActionsCategory(value, 0); + } + + public static AccountDetailsAndActionsCategory of(String value) { + return new AccountDetailsAndActionsCategory(value, 1); + } + + public interface Visitor { + T visit(CategoryEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountDetailsAndActionsCategory.class); + } + + @java.lang.Override + public AccountDetailsAndActionsCategory deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CategoryEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsIntegration.java b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsIntegration.java new file mode 100644 index 000000000..9bc2c99ce --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsIntegration.java @@ -0,0 +1,332 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountDetailsAndActionsIntegration.Builder.class) +public final class AccountDetailsAndActionsIntegration { + private final String name; + + private final List categories; + + private final Optional image; + + private final Optional squareImage; + + private final String color; + + private final String slug; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AccountDetailsAndActionsIntegration( + String name, + List categories, + Optional image, + Optional squareImage, + String color, + String slug, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.name = name; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + @JsonProperty("image") + public Optional getImage() { + return image; + } + + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + @JsonProperty("color") + public String getColor() { + return color; + } + + @JsonProperty("slug") + public String getSlug() { + return slug; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsIntegration + && equalTo((AccountDetailsAndActionsIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountDetailsAndActionsIntegration other) { + return name.equals(other.name) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.passthroughAvailable, + this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + ColorStage name(@NotNull String name); + + Builder from(AccountDetailsAndActionsIntegration other); + } + + public interface ColorStage { + SlugStage color(@NotNull String color); + } + + public interface SlugStage { + PassthroughAvailableStage slug(@NotNull String slug); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AccountDetailsAndActionsIntegration build(); + + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + _FinalStage image(Optional image); + + _FinalStage image(String image); + + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements NameStage, ColorStage, SlugStage, PassthroughAvailableStage, _FinalStage { + private String name; + + private String color; + + private String slug; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountDetailsAndActionsIntegration other) { + name(other.getName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public ColorStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("color") + public SlugStage color(@NotNull String color) { + this.color = color; + return this; + } + + @java.lang.Override + @JsonSetter("slug") + public PassthroughAvailableStage slug(@NotNull String slug) { + this.slug = slug; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + @java.lang.Override + public AccountDetailsAndActionsIntegration build() { + return new AccountDetailsAndActionsIntegration( + name, + categories, + image, + squareImage, + color, + slug, + passthroughAvailable, + availableModelOperations, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsStatus.java b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsStatus.java new file mode 100644 index 000000000..1076db9aa --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsStatus.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountDetailsAndActionsStatus.Deserializer.class) +public final class AccountDetailsAndActionsStatus { + private final Object value; + + private final int type; + + private AccountDetailsAndActionsStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AccountDetailsAndActionsStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsAndActionsStatus && equalTo((AccountDetailsAndActionsStatus) other); + } + + private boolean equalTo(AccountDetailsAndActionsStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountDetailsAndActionsStatus of(AccountDetailsAndActionsStatusEnum value) { + return new AccountDetailsAndActionsStatus(value, 0); + } + + public static AccountDetailsAndActionsStatus of(String value) { + return new AccountDetailsAndActionsStatus(value, 1); + } + + public interface Visitor { + T visit(AccountDetailsAndActionsStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountDetailsAndActionsStatus.class); + } + + @java.lang.Override + public AccountDetailsAndActionsStatus deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AccountDetailsAndActionsStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsStatusEnum.java b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsStatusEnum.java new file mode 100644 index 000000000..f8387d494 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsAndActionsStatusEnum.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AccountDetailsAndActionsStatusEnum { + public static final AccountDetailsAndActionsStatusEnum RELINK_NEEDED = + new AccountDetailsAndActionsStatusEnum(Value.RELINK_NEEDED, "RELINK_NEEDED"); + + public static final AccountDetailsAndActionsStatusEnum INCOMPLETE = + new AccountDetailsAndActionsStatusEnum(Value.INCOMPLETE, "INCOMPLETE"); + + public static final AccountDetailsAndActionsStatusEnum IDLE = + new AccountDetailsAndActionsStatusEnum(Value.IDLE, "IDLE"); + + public static final AccountDetailsAndActionsStatusEnum COMPLETE = + new AccountDetailsAndActionsStatusEnum(Value.COMPLETE, "COMPLETE"); + + private final Value value; + + private final String string; + + AccountDetailsAndActionsStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AccountDetailsAndActionsStatusEnum + && this.string.equals(((AccountDetailsAndActionsStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RELINK_NEEDED: + return visitor.visitRelinkNeeded(); + case INCOMPLETE: + return visitor.visitIncomplete(); + case IDLE: + return visitor.visitIdle(); + case COMPLETE: + return visitor.visitComplete(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AccountDetailsAndActionsStatusEnum valueOf(String value) { + switch (value) { + case "RELINK_NEEDED": + return RELINK_NEEDED; + case "INCOMPLETE": + return INCOMPLETE; + case "IDLE": + return IDLE; + case "COMPLETE": + return COMPLETE; + default: + return new AccountDetailsAndActionsStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPLETE, + + INCOMPLETE, + + RELINK_NEEDED, + + IDLE, + + UNKNOWN + } + + public interface Visitor { + T visitComplete(); + + T visitIncomplete(); + + T visitRelinkNeeded(); + + T visitIdle(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsCategory.java b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsCategory.java new file mode 100644 index 000000000..f1a50b46a --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountDetailsCategory.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AccountDetailsCategory.Deserializer.class) +public final class AccountDetailsCategory { + private final Object value; + + private final int type; + + private AccountDetailsCategory(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((CategoryEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountDetailsCategory && equalTo((AccountDetailsCategory) other); + } + + private boolean equalTo(AccountDetailsCategory other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AccountDetailsCategory of(CategoryEnum value) { + return new AccountDetailsCategory(value, 0); + } + + public static AccountDetailsCategory of(String value) { + return new AccountDetailsCategory(value, 1); + } + + public interface Visitor { + T visit(CategoryEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AccountDetailsCategory.class); + } + + @java.lang.Override + public AccountDetailsCategory deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, CategoryEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountIntegration.java b/src/main/java/com/merge/api/knowledgebase/types/AccountIntegration.java new file mode 100644 index 000000000..a5d3ac4c0 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountIntegration.java @@ -0,0 +1,515 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountIntegration.Builder.class) +public final class AccountIntegration { + private final String name; + + private final Optional abbreviatedName; + + private final Optional> categories; + + private final Optional image; + + private final Optional squareImage; + + private final Optional color; + + private final Optional slug; + + private final Optional> apiEndpointsToDocumentationUrls; + + private final Optional webhookSetupGuideUrl; + + private final Optional> categoryBetaStatus; + + private final Map additionalProperties; + + private AccountIntegration( + String name, + Optional abbreviatedName, + Optional> categories, + Optional image, + Optional squareImage, + Optional color, + Optional slug, + Optional> apiEndpointsToDocumentationUrls, + Optional webhookSetupGuideUrl, + Optional> categoryBetaStatus, + Map additionalProperties) { + this.name = name; + this.abbreviatedName = abbreviatedName; + this.categories = categories; + this.image = image; + this.squareImage = squareImage; + this.color = color; + this.slug = slug; + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + this.categoryBetaStatus = categoryBetaStatus; + this.additionalProperties = additionalProperties; + } + + /** + * @return Company name. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i> + */ + @JsonProperty("abbreviated_name") + public Optional getAbbreviatedName() { + return abbreviatedName; + } + + /** + * @return Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + */ + @JsonProperty("categories") + public Optional> getCategories() { + return categories; + } + + /** + * @return Company logo in rectangular shape. + */ + @JsonProperty("image") + public Optional getImage() { + return image; + } + + /** + * @return Company logo in square shape. + */ + @JsonProperty("square_image") + public Optional getSquareImage() { + return squareImage; + } + + /** + * @return The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b> + */ + @JsonProperty("color") + public Optional getColor() { + return color; + } + + @JsonProperty("slug") + public Optional getSlug() { + return slug; + } + + /** + * @return 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': []} + */ + @JsonProperty("api_endpoints_to_documentation_urls") + public Optional> getApiEndpointsToDocumentationUrls() { + return apiEndpointsToDocumentationUrls; + } + + /** + * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. + */ + @JsonProperty("webhook_setup_guide_url") + public Optional getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + + /** + * @return Category or categories this integration is in beta status for. + */ + @JsonProperty("category_beta_status") + public Optional> getCategoryBetaStatus() { + return categoryBetaStatus; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountIntegration && equalTo((AccountIntegration) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountIntegration other) { + return name.equals(other.name) + && abbreviatedName.equals(other.abbreviatedName) + && categories.equals(other.categories) + && image.equals(other.image) + && squareImage.equals(other.squareImage) + && color.equals(other.color) + && slug.equals(other.slug) + && apiEndpointsToDocumentationUrls.equals(other.apiEndpointsToDocumentationUrls) + && webhookSetupGuideUrl.equals(other.webhookSetupGuideUrl) + && categoryBetaStatus.equals(other.categoryBetaStatus); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.name, + this.abbreviatedName, + this.categories, + this.image, + this.squareImage, + this.color, + this.slug, + this.apiEndpointsToDocumentationUrls, + this.webhookSetupGuideUrl, + this.categoryBetaStatus); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

            Company name.

            + */ + _FinalStage name(@NotNull String name); + + Builder from(AccountIntegration other); + } + + public interface _FinalStage { + AccountIntegration build(); + + /** + *

            Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

            + */ + _FinalStage abbreviatedName(Optional abbreviatedName); + + _FinalStage abbreviatedName(String abbreviatedName); + + /** + *

            Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

            + */ + _FinalStage categories(Optional> categories); + + _FinalStage categories(List categories); + + /** + *

            Company logo in rectangular shape.

            + */ + _FinalStage image(Optional image); + + _FinalStage image(String image); + + /** + *

            Company logo in square shape.

            + */ + _FinalStage squareImage(Optional squareImage); + + _FinalStage squareImage(String squareImage); + + /** + *

            The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

            + */ + _FinalStage color(Optional color); + + _FinalStage color(String color); + + _FinalStage slug(Optional slug); + + _FinalStage slug(String slug); + + /** + *

            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': []}

            + */ + _FinalStage apiEndpointsToDocumentationUrls(Optional> apiEndpointsToDocumentationUrls); + + _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls); + + /** + *

            Setup guide URL for third party webhook creation. Exposed in Merge Docs.

            + */ + _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl); + + _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + + /** + *

            Category or categories this integration is in beta status for.

            + */ + _FinalStage categoryBetaStatus(Optional> categoryBetaStatus); + + _FinalStage categoryBetaStatus(Map categoryBetaStatus); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + private Optional> categoryBetaStatus = Optional.empty(); + + private Optional webhookSetupGuideUrl = Optional.empty(); + + private Optional> apiEndpointsToDocumentationUrls = Optional.empty(); + + private Optional slug = Optional.empty(); + + private Optional color = Optional.empty(); + + private Optional squareImage = Optional.empty(); + + private Optional image = Optional.empty(); + + private Optional> categories = Optional.empty(); + + private Optional abbreviatedName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountIntegration other) { + name(other.getName()); + abbreviatedName(other.getAbbreviatedName()); + categories(other.getCategories()); + image(other.getImage()); + squareImage(other.getSquareImage()); + color(other.getColor()); + slug(other.getSlug()); + apiEndpointsToDocumentationUrls(other.getApiEndpointsToDocumentationUrls()); + webhookSetupGuideUrl(other.getWebhookSetupGuideUrl()); + categoryBetaStatus(other.getCategoryBetaStatus()); + return this; + } + + /** + *

            Company name.

            + *

            Company name.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

            Category or categories this integration is in beta status for.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryBetaStatus(Map categoryBetaStatus) { + this.categoryBetaStatus = Optional.ofNullable(categoryBetaStatus); + return this; + } + + /** + *

            Category or categories this integration is in beta status for.

            + */ + @java.lang.Override + @JsonSetter(value = "category_beta_status", nulls = Nulls.SKIP) + public _FinalStage categoryBetaStatus(Optional> categoryBetaStatus) { + this.categoryBetaStatus = categoryBetaStatus; + return this; + } + + /** + *

            Setup guide URL for third party webhook creation. Exposed in Merge Docs.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = Optional.ofNullable(webhookSetupGuideUrl); + return this; + } + + /** + *

            Setup guide URL for third party webhook creation. Exposed in Merge Docs.

            + */ + @java.lang.Override + @JsonSetter(value = "webhook_setup_guide_url", nulls = Nulls.SKIP) + public _FinalStage webhookSetupGuideUrl(Optional webhookSetupGuideUrl) { + this.webhookSetupGuideUrl = webhookSetupGuideUrl; + return this; + } + + /** + *

            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': []}

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage apiEndpointsToDocumentationUrls(Map apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = Optional.ofNullable(apiEndpointsToDocumentationUrls); + return this; + } + + /** + *

            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': []}

            + */ + @java.lang.Override + @JsonSetter(value = "api_endpoints_to_documentation_urls", nulls = Nulls.SKIP) + public _FinalStage apiEndpointsToDocumentationUrls( + Optional> apiEndpointsToDocumentationUrls) { + this.apiEndpointsToDocumentationUrls = apiEndpointsToDocumentationUrls; + return this; + } + + @java.lang.Override + public _FinalStage slug(String slug) { + this.slug = Optional.ofNullable(slug); + return this; + } + + @java.lang.Override + @JsonSetter(value = "slug", nulls = Nulls.SKIP) + public _FinalStage slug(Optional slug) { + this.slug = slug; + return this; + } + + /** + *

            The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage color(String color) { + this.color = Optional.ofNullable(color); + return this; + } + + /** + *

            The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

            + */ + @java.lang.Override + @JsonSetter(value = "color", nulls = Nulls.SKIP) + public _FinalStage color(Optional color) { + this.color = color; + return this; + } + + /** + *

            Company logo in square shape.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage squareImage(String squareImage) { + this.squareImage = Optional.ofNullable(squareImage); + return this; + } + + /** + *

            Company logo in square shape.

            + */ + @java.lang.Override + @JsonSetter(value = "square_image", nulls = Nulls.SKIP) + public _FinalStage squareImage(Optional squareImage) { + this.squareImage = squareImage; + return this; + } + + /** + *

            Company logo in rectangular shape.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage image(String image) { + this.image = Optional.ofNullable(image); + return this; + } + + /** + *

            Company logo in rectangular shape.

            + */ + @java.lang.Override + @JsonSetter(value = "image", nulls = Nulls.SKIP) + public _FinalStage image(Optional image) { + this.image = image; + return this; + } + + /** + *

            Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categories(List categories) { + this.categories = Optional.ofNullable(categories); + return this; + } + + /** + *

            Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

            + */ + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(Optional> categories) { + this.categories = categories; + return this; + } + + /** + *

            Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage abbreviatedName(String abbreviatedName) { + this.abbreviatedName = Optional.ofNullable(abbreviatedName); + return this; + } + + /** + *

            Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).<br><br>Example: <i>Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors)</i>

            + */ + @java.lang.Override + @JsonSetter(value = "abbreviated_name", nulls = Nulls.SKIP) + public _FinalStage abbreviatedName(Optional abbreviatedName) { + this.abbreviatedName = abbreviatedName; + return this; + } + + @java.lang.Override + public AccountIntegration build() { + return new AccountIntegration( + name, + abbreviatedName, + categories, + image, + squareImage, + color, + slug, + apiEndpointsToDocumentationUrls, + webhookSetupGuideUrl, + categoryBetaStatus, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AccountToken.java b/src/main/java/com/merge/api/knowledgebase/types/AccountToken.java new file mode 100644 index 000000000..4e0458b44 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AccountToken.java @@ -0,0 +1,147 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountToken.Builder.class) +public final class AccountToken { + private final String accountToken; + + private final AccountIntegration integration; + + private final String id; + + private final Map additionalProperties; + + private AccountToken( + String accountToken, AccountIntegration integration, String id, Map additionalProperties) { + this.accountToken = accountToken; + this.integration = integration; + this.id = id; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountToken && equalTo((AccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AccountToken other) { + return accountToken.equals(other.accountToken) && integration.equals(other.integration) && id.equals(other.id); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.accountToken, this.integration, this.id); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AccountTokenStage builder() { + return new Builder(); + } + + public interface AccountTokenStage { + IntegrationStage accountToken(@NotNull String accountToken); + + Builder from(AccountToken other); + } + + public interface IntegrationStage { + IdStage integration(@NotNull AccountIntegration integration); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + } + + public interface _FinalStage { + AccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AccountTokenStage, IntegrationStage, IdStage, _FinalStage { + private String accountToken; + + private AccountIntegration integration; + + private String id; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AccountToken other) { + accountToken(other.getAccountToken()); + integration(other.getIntegration()); + id(other.getId()); + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public IntegrationStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public IdStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public AccountToken build() { + return new AccountToken(accountToken, integration, id, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AdvancedMetadata.java b/src/main/java/com/merge/api/knowledgebase/types/AdvancedMetadata.java new file mode 100644 index 000000000..3a2507405 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AdvancedMetadata.java @@ -0,0 +1,260 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AdvancedMetadata.Builder.class) +public final class AdvancedMetadata { + private final String id; + + private final Optional displayName; + + private final Optional description; + + private final Optional isRequired; + + private final Optional isCustom; + + private final Optional> fieldChoices; + + private final Map additionalProperties; + + private AdvancedMetadata( + String id, + Optional displayName, + Optional description, + Optional isRequired, + Optional isCustom, + Optional> fieldChoices, + Map additionalProperties) { + this.id = id; + this.displayName = displayName; + this.description = description; + this.isRequired = isRequired; + this.isCustom = isCustom; + this.fieldChoices = fieldChoices; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("display_name") + public Optional getDisplayName() { + return displayName; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_required") + public Optional getIsRequired() { + return isRequired; + } + + @JsonProperty("is_custom") + public Optional getIsCustom() { + return isCustom; + } + + @JsonProperty("field_choices") + public Optional> getFieldChoices() { + return fieldChoices; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AdvancedMetadata && equalTo((AdvancedMetadata) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AdvancedMetadata other) { + return id.equals(other.id) + && displayName.equals(other.displayName) + && description.equals(other.description) + && isRequired.equals(other.isRequired) + && isCustom.equals(other.isCustom) + && fieldChoices.equals(other.fieldChoices); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, this.displayName, this.description, this.isRequired, this.isCustom, this.fieldChoices); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + _FinalStage id(@NotNull String id); + + Builder from(AdvancedMetadata other); + } + + public interface _FinalStage { + AdvancedMetadata build(); + + _FinalStage displayName(Optional displayName); + + _FinalStage displayName(String displayName); + + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage isRequired(Optional isRequired); + + _FinalStage isRequired(Boolean isRequired); + + _FinalStage isCustom(Optional isCustom); + + _FinalStage isCustom(Boolean isCustom); + + _FinalStage fieldChoices(Optional> fieldChoices); + + _FinalStage fieldChoices(List fieldChoices); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, _FinalStage { + private String id; + + private Optional> fieldChoices = Optional.empty(); + + private Optional isCustom = Optional.empty(); + + private Optional isRequired = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional displayName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AdvancedMetadata other) { + id(other.getId()); + displayName(other.getDisplayName()); + description(other.getDescription()); + isRequired(other.getIsRequired()); + isCustom(other.getIsCustom()); + fieldChoices(other.getFieldChoices()); + return this; + } + + @java.lang.Override + @JsonSetter("id") + public _FinalStage id(@NotNull String id) { + this.id = id; + return this; + } + + @java.lang.Override + public _FinalStage fieldChoices(List fieldChoices) { + this.fieldChoices = Optional.ofNullable(fieldChoices); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_choices", nulls = Nulls.SKIP) + public _FinalStage fieldChoices(Optional> fieldChoices) { + this.fieldChoices = fieldChoices; + return this; + } + + @java.lang.Override + public _FinalStage isCustom(Boolean isCustom) { + this.isCustom = Optional.ofNullable(isCustom); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_custom", nulls = Nulls.SKIP) + public _FinalStage isCustom(Optional isCustom) { + this.isCustom = isCustom; + return this; + } + + @java.lang.Override + public _FinalStage isRequired(Boolean isRequired) { + this.isRequired = Optional.ofNullable(isRequired); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) + public _FinalStage isRequired(Optional isRequired) { + this.isRequired = isRequired; + return this; + } + + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public _FinalStage displayName(String displayName) { + this.displayName = Optional.ofNullable(displayName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) + public _FinalStage displayName(Optional displayName) { + this.displayName = displayName; + return this; + } + + @java.lang.Override + public AdvancedMetadata build() { + return new AdvancedMetadata( + id, displayName, description, isRequired, isCustom, fieldChoices, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/Article.java b/src/main/java/com/merge/api/knowledgebase/types/Article.java new file mode 100644 index 000000000..dd7fe3113 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/Article.java @@ -0,0 +1,814 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Article.Builder.class) +public final class Article { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional title; + + private final Optional description; + + private final Optional author; + + private final Optional lastEditedBy; + + private final Optional visibility; + + private final Optional articleContentDownloadUrl; + + private final Optional checksum; + + private final Optional articleUrl; + + private final Optional status; + + private final Optional type; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional parentArticle; + + private final Optional parentContainer; + + private final Optional rootContainer; + + private final Optional> permissions; + + private final Optional>> attachments; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Article( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional title, + Optional description, + Optional author, + Optional lastEditedBy, + Optional visibility, + Optional articleContentDownloadUrl, + Optional checksum, + Optional articleUrl, + Optional status, + Optional type, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional parentArticle, + Optional parentContainer, + Optional rootContainer, + Optional> permissions, + Optional>> attachments, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.title = title; + this.description = description; + this.author = author; + this.lastEditedBy = lastEditedBy; + this.visibility = visibility; + this.articleContentDownloadUrl = articleContentDownloadUrl; + this.checksum = checksum; + this.articleUrl = articleUrl; + this.status = status; + this.type = type; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.parentArticle = parentArticle; + this.parentContainer = parentContainer; + this.rootContainer = rootContainer; + this.permissions = permissions; + this.attachments = attachments; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The title of the article. + */ + @JsonProperty("title") + public Optional getTitle() { + return title; + } + + /** + * @return Description of the article. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The user who created the article. + */ + @JsonProperty("author") + public Optional getAuthor() { + return author; + } + + /** + * @return The user to last update the article. + */ + @JsonProperty("last_edited_by") + public Optional getLastEditedBy() { + return lastEditedBy; + } + + /** + * @return The visibility of the article. + */ + @JsonProperty("visibility") + public Optional getVisibility() { + return visibility; + } + + /** + * @return The presigned S3 URL to fetch article content. + */ + @JsonProperty("article_content_download_url") + public Optional getArticleContentDownloadUrl() { + return articleContentDownloadUrl; + } + + /** + * @return The SHA256 checksum of the article content. + */ + @JsonProperty("checksum") + public Optional getChecksum() { + return checksum; + } + + /** + * @return The URL to the webpage of the article. + */ + @JsonProperty("article_url") + public Optional getArticleUrl() { + return articleUrl; + } + + /** + * @return The status of the article. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The type of the article. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return When the third party's article was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's article was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return The parent article an article is nested within. + */ + @JsonProperty("parent_article") + public Optional getParentArticle() { + return parentArticle; + } + + /** + * @return The parent container an article is nested within. + */ + @JsonProperty("parent_container") + public Optional getParentContainer() { + return parentContainer; + } + + /** + * @return 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. + */ + @JsonProperty("root_container") + public Optional getRootContainer() { + return rootContainer; + } + + @JsonProperty("permissions") + public Optional> getPermissions() { + return permissions; + } + + @JsonProperty("attachments") + public Optional>> getAttachments() { + return attachments; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Article && equalTo((Article) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Article other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && title.equals(other.title) + && description.equals(other.description) + && author.equals(other.author) + && lastEditedBy.equals(other.lastEditedBy) + && visibility.equals(other.visibility) + && articleContentDownloadUrl.equals(other.articleContentDownloadUrl) + && checksum.equals(other.checksum) + && articleUrl.equals(other.articleUrl) + && status.equals(other.status) + && type.equals(other.type) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && parentArticle.equals(other.parentArticle) + && parentContainer.equals(other.parentContainer) + && rootContainer.equals(other.rootContainer) + && permissions.equals(other.permissions) + && attachments.equals(other.attachments) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.title, + this.description, + this.author, + this.lastEditedBy, + this.visibility, + this.articleContentDownloadUrl, + this.checksum, + this.articleUrl, + this.status, + this.type, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.parentArticle, + this.parentContainer, + this.rootContainer, + this.permissions, + this.attachments, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional title = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional author = Optional.empty(); + + private Optional lastEditedBy = Optional.empty(); + + private Optional visibility = Optional.empty(); + + private Optional articleContentDownloadUrl = Optional.empty(); + + private Optional checksum = Optional.empty(); + + private Optional articleUrl = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional parentArticle = Optional.empty(); + + private Optional parentContainer = Optional.empty(); + + private Optional rootContainer = Optional.empty(); + + private Optional> permissions = Optional.empty(); + + private Optional>> attachments = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Article other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + title(other.getTitle()); + description(other.getDescription()); + author(other.getAuthor()); + lastEditedBy(other.getLastEditedBy()); + visibility(other.getVisibility()); + articleContentDownloadUrl(other.getArticleContentDownloadUrl()); + checksum(other.getChecksum()); + articleUrl(other.getArticleUrl()); + status(other.getStatus()); + type(other.getType()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + parentArticle(other.getParentArticle()); + parentContainer(other.getParentContainer()); + rootContainer(other.getRootContainer()); + permissions(other.getPermissions()); + attachments(other.getAttachments()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

            The third-party API ID of the matching object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            The datetime that this object was created by Merge.

            + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

            The datetime that this object was modified by Merge.

            + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

            The title of the article.

            + */ + @JsonSetter(value = "title", nulls = Nulls.SKIP) + public Builder title(Optional title) { + this.title = title; + return this; + } + + public Builder title(String title) { + this.title = Optional.ofNullable(title); + return this; + } + + /** + *

            Description of the article.

            + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

            The user who created the article.

            + */ + @JsonSetter(value = "author", nulls = Nulls.SKIP) + public Builder author(Optional author) { + this.author = author; + return this; + } + + public Builder author(ArticleAuthor author) { + this.author = Optional.ofNullable(author); + return this; + } + + /** + *

            The user to last update the article.

            + */ + @JsonSetter(value = "last_edited_by", nulls = Nulls.SKIP) + public Builder lastEditedBy(Optional lastEditedBy) { + this.lastEditedBy = lastEditedBy; + return this; + } + + public Builder lastEditedBy(ArticleLastEditedBy lastEditedBy) { + this.lastEditedBy = Optional.ofNullable(lastEditedBy); + return this; + } + + /** + *

            The visibility of the article.

            + */ + @JsonSetter(value = "visibility", nulls = Nulls.SKIP) + public Builder visibility(Optional visibility) { + this.visibility = visibility; + return this; + } + + public Builder visibility(ArticleVisibility visibility) { + this.visibility = Optional.ofNullable(visibility); + return this; + } + + /** + *

            The presigned S3 URL to fetch article content.

            + */ + @JsonSetter(value = "article_content_download_url", nulls = Nulls.SKIP) + public Builder articleContentDownloadUrl(Optional articleContentDownloadUrl) { + this.articleContentDownloadUrl = articleContentDownloadUrl; + return this; + } + + public Builder articleContentDownloadUrl(String articleContentDownloadUrl) { + this.articleContentDownloadUrl = Optional.ofNullable(articleContentDownloadUrl); + return this; + } + + /** + *

            The SHA256 checksum of the article content.

            + */ + @JsonSetter(value = "checksum", nulls = Nulls.SKIP) + public Builder checksum(Optional checksum) { + this.checksum = checksum; + return this; + } + + public Builder checksum(String checksum) { + this.checksum = Optional.ofNullable(checksum); + return this; + } + + /** + *

            The URL to the webpage of the article.

            + */ + @JsonSetter(value = "article_url", nulls = Nulls.SKIP) + public Builder articleUrl(Optional articleUrl) { + this.articleUrl = articleUrl; + return this; + } + + public Builder articleUrl(String articleUrl) { + this.articleUrl = Optional.ofNullable(articleUrl); + return this; + } + + /** + *

            The status of the article.

            + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ArticleStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

            The type of the article.

            + */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(ArticleType type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

            When the third party's article was created.

            + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

            When the third party's article was updated.

            + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

            The parent article an article is nested within.

            + */ + @JsonSetter(value = "parent_article", nulls = Nulls.SKIP) + public Builder parentArticle(Optional parentArticle) { + this.parentArticle = parentArticle; + return this; + } + + public Builder parentArticle(ArticleParentArticle parentArticle) { + this.parentArticle = Optional.ofNullable(parentArticle); + return this; + } + + /** + *

            The parent container an article is nested within.

            + */ + @JsonSetter(value = "parent_container", nulls = Nulls.SKIP) + public Builder parentContainer(Optional parentContainer) { + this.parentContainer = parentContainer; + return this; + } + + public Builder parentContainer(ArticleParentContainer parentContainer) { + this.parentContainer = Optional.ofNullable(parentContainer); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "root_container", nulls = Nulls.SKIP) + public Builder rootContainer(Optional rootContainer) { + this.rootContainer = rootContainer; + return this; + } + + public Builder rootContainer(ArticleRootContainer rootContainer) { + this.rootContainer = Optional.ofNullable(rootContainer); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional> permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(List permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) + public Builder attachments(Optional>> attachments) { + this.attachments = attachments; + return this; + } + + public Builder attachments(List> attachments) { + this.attachments = Optional.ofNullable(attachments); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(ArticleFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Article build() { + return new Article( + id, + remoteId, + createdAt, + modifiedAt, + title, + description, + author, + lastEditedBy, + visibility, + articleContentDownloadUrl, + checksum, + articleUrl, + status, + type, + remoteCreatedAt, + remoteUpdatedAt, + parentArticle, + parentContainer, + rootContainer, + permissions, + attachments, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleAttachmentsItem.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleAttachmentsItem.java new file mode 100644 index 000000000..895baadc5 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleAttachmentsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleAttachmentsItem.Deserializer.class) +public final class ArticleAttachmentsItem { + private final Object value; + + private final int type; + + private ArticleAttachmentsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Attachment) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleAttachmentsItem && equalTo((ArticleAttachmentsItem) other); + } + + private boolean equalTo(ArticleAttachmentsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleAttachmentsItem of(String value) { + return new ArticleAttachmentsItem(value, 0); + } + + public static ArticleAttachmentsItem of(Attachment value) { + return new ArticleAttachmentsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Attachment value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleAttachmentsItem.class); + } + + @java.lang.Override + public ArticleAttachmentsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Attachment.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleAuthor.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleAuthor.java new file mode 100644 index 000000000..30300e79b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleAuthor.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleAuthor.Deserializer.class) +public final class ArticleAuthor { + private final Object value; + + private final int type; + + private ArticleAuthor(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleAuthor && equalTo((ArticleAuthor) other); + } + + private boolean equalTo(ArticleAuthor other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleAuthor of(String value) { + return new ArticleAuthor(value, 0); + } + + public static ArticleAuthor of(User value) { + return new ArticleAuthor(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleAuthor.class); + } + + @java.lang.Override + public ArticleAuthor deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, User.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleFieldMappings.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleFieldMappings.java new file mode 100644 index 000000000..5cb55e62e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ArticleFieldMappings.Builder.class) +public final class ArticleFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private ArticleFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleFieldMappings && equalTo((ArticleFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ArticleFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ArticleFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public ArticleFieldMappings build() { + return new ArticleFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleLastEditedBy.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleLastEditedBy.java new file mode 100644 index 000000000..8c402c7d4 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleLastEditedBy.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleLastEditedBy.Deserializer.class) +public final class ArticleLastEditedBy { + private final Object value; + + private final int type; + + private ArticleLastEditedBy(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleLastEditedBy && equalTo((ArticleLastEditedBy) other); + } + + private boolean equalTo(ArticleLastEditedBy other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleLastEditedBy of(String value) { + return new ArticleLastEditedBy(value, 0); + } + + public static ArticleLastEditedBy of(User value) { + return new ArticleLastEditedBy(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleLastEditedBy.class); + } + + @java.lang.Override + public ArticleLastEditedBy deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, User.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleParentArticle.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleParentArticle.java new file mode 100644 index 000000000..d93f8c471 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleParentArticle.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleParentArticle.Deserializer.class) +public final class ArticleParentArticle { + private final Object value; + + private final int type; + + private ArticleParentArticle(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Article) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleParentArticle && equalTo((ArticleParentArticle) other); + } + + private boolean equalTo(ArticleParentArticle other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleParentArticle of(String value) { + return new ArticleParentArticle(value, 0); + } + + public static ArticleParentArticle of(Article value) { + return new ArticleParentArticle(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Article value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleParentArticle.class); + } + + @java.lang.Override + public ArticleParentArticle deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Article.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleParentContainer.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleParentContainer.java new file mode 100644 index 000000000..979442ccc --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleParentContainer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleParentContainer.Deserializer.class) +public final class ArticleParentContainer { + private final Object value; + + private final int type; + + private ArticleParentContainer(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Container) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleParentContainer && equalTo((ArticleParentContainer) other); + } + + private boolean equalTo(ArticleParentContainer other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleParentContainer of(String value) { + return new ArticleParentContainer(value, 0); + } + + public static ArticleParentContainer of(Container value) { + return new ArticleParentContainer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Container value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleParentContainer.class); + } + + @java.lang.Override + public ArticleParentContainer deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Container.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticlePermissionsItem.java b/src/main/java/com/merge/api/knowledgebase/types/ArticlePermissionsItem.java new file mode 100644 index 000000000..919dc7c85 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticlePermissionsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticlePermissionsItem.Deserializer.class) +public final class ArticlePermissionsItem { + private final Object value; + + private final int type; + + private ArticlePermissionsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Permission) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticlePermissionsItem && equalTo((ArticlePermissionsItem) other); + } + + private boolean equalTo(ArticlePermissionsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticlePermissionsItem of(String value) { + return new ArticlePermissionsItem(value, 0); + } + + public static ArticlePermissionsItem of(Permission value) { + return new ArticlePermissionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Permission value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticlePermissionsItem.class); + } + + @java.lang.Override + public ArticlePermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Permission.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleRootContainer.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleRootContainer.java new file mode 100644 index 000000000..ab68f7c63 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleRootContainer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleRootContainer.Deserializer.class) +public final class ArticleRootContainer { + private final Object value; + + private final int type; + + private ArticleRootContainer(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Container) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleRootContainer && equalTo((ArticleRootContainer) other); + } + + private boolean equalTo(ArticleRootContainer other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleRootContainer of(String value) { + return new ArticleRootContainer(value, 0); + } + + public static ArticleRootContainer of(Container value) { + return new ArticleRootContainer(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Container value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleRootContainer.class); + } + + @java.lang.Override + public ArticleRootContainer deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Container.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleStatus.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleStatus.java new file mode 100644 index 000000000..f07ae27ef --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleStatus.Deserializer.class) +public final class ArticleStatus { + private final Object value; + + private final int type; + + private ArticleStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((Status3C6Enum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleStatus && equalTo((ArticleStatus) other); + } + + private boolean equalTo(ArticleStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleStatus of(Status3C6Enum value) { + return new ArticleStatus(value, 0); + } + + public static ArticleStatus of(String value) { + return new ArticleStatus(value, 1); + } + + public interface Visitor { + T visit(Status3C6Enum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleStatus.class); + } + + @java.lang.Override + public ArticleStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status3C6Enum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleType.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleType.java new file mode 100644 index 000000000..8de8452d6 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleType.Deserializer.class) +public final class ArticleType { + private final Object value; + + private final int type; + + private ArticleType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ArticleTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleType && equalTo((ArticleType) other); + } + + private boolean equalTo(ArticleType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleType of(ArticleTypeEnum value) { + return new ArticleType(value, 0); + } + + public static ArticleType of(String value) { + return new ArticleType(value, 1); + } + + public interface Visitor { + T visit(ArticleTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleType.class); + } + + @java.lang.Override + public ArticleType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ArticleTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleTypeEnum.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleTypeEnum.java new file mode 100644 index 000000000..3eba54f13 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleTypeEnum.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ArticleTypeEnum { + public static final ArticleTypeEnum SMART_LINK = new ArticleTypeEnum(Value.SMART_LINK, "SMART_LINK"); + + public static final ArticleTypeEnum PAGE = new ArticleTypeEnum(Value.PAGE, "PAGE"); + + public static final ArticleTypeEnum BLOG_POST = new ArticleTypeEnum(Value.BLOG_POST, "BLOG_POST"); + + private final Value value; + + private final String string; + + ArticleTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ArticleTypeEnum && this.string.equals(((ArticleTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SMART_LINK: + return visitor.visitSmartLink(); + case PAGE: + return visitor.visitPage(); + case BLOG_POST: + return visitor.visitBlogPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ArticleTypeEnum valueOf(String value) { + switch (value) { + case "SMART_LINK": + return SMART_LINK; + case "PAGE": + return PAGE; + case "BLOG_POST": + return BLOG_POST; + default: + return new ArticleTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PAGE, + + BLOG_POST, + + SMART_LINK, + + UNKNOWN + } + + public interface Visitor { + T visitPage(); + + T visitBlogPost(); + + T visitSmartLink(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticleVisibility.java b/src/main/java/com/merge/api/knowledgebase/types/ArticleVisibility.java new file mode 100644 index 000000000..50a93713e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticleVisibility.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ArticleVisibility.Deserializer.class) +public final class ArticleVisibility { + private final Object value; + + private final int type; + + private ArticleVisibility(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((VisibilityEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticleVisibility && equalTo((ArticleVisibility) other); + } + + private boolean equalTo(ArticleVisibility other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ArticleVisibility of(VisibilityEnum value) { + return new ArticleVisibility(value, 0); + } + + public static ArticleVisibility of(String value) { + return new ArticleVisibility(value, 1); + } + + public interface Visitor { + T visit(VisibilityEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ArticleVisibility.class); + } + + @java.lang.Override + public ArticleVisibility deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, VisibilityEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequest.java new file mode 100644 index 000000000..c09384350 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequest.java @@ -0,0 +1,594 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ArticlesListRequest.Builder.class) +public final class ArticlesListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional parentArticleId; + + private final Optional parentContainerId; + + private final Optional remoteId; + + private final Optional rootContainerId; + + private final Optional status; + + private final Optional type; + + private final Map additionalProperties; + + private ArticlesListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional parentArticleId, + Optional parentContainerId, + Optional remoteId, + Optional rootContainerId, + Optional status, + Optional type, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.parentArticleId = parentArticleId; + this.parentContainerId = parentContainerId; + this.remoteId = remoteId; + this.rootContainerId = rootContainerId; + this.status = status; + this.type = type; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If provided, will only return sub articles of the parent_article_id. + */ + @JsonProperty("parent_article_id") + public Optional getParentArticleId() { + return parentArticleId; + } + + /** + * @return If provided, will only return sub articles of the parent_container_id. + */ + @JsonProperty("parent_container_id") + public Optional getParentContainerId() { + return parentContainerId; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return sub articles of the root_container_id. + */ + @JsonProperty("root_container_id") + public Optional getRootContainerId() { + return rootContainerId; + } + + /** + * @return If provided, will only return articles of the given status; multiple statuses can be separated by commas. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return If provided, will only return articles of the given type. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticlesListRequest && equalTo((ArticlesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ArticlesListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && parentArticleId.equals(other.parentArticleId) + && parentContainerId.equals(other.parentContainerId) + && remoteId.equals(other.remoteId) + && rootContainerId.equals(other.rootContainerId) + && status.equals(other.status) + && type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.parentArticleId, + this.parentContainerId, + this.remoteId, + this.rootContainerId, + this.status, + this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional parentArticleId = Optional.empty(); + + private Optional parentContainerId = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional rootContainerId = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional type = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ArticlesListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + parentArticleId(other.getParentArticleId()); + parentContainerId(other.getParentContainerId()); + remoteId(other.getRemoteId()); + rootContainerId(other.getRootContainerId()); + status(other.getStatus()); + type(other.getType()); + return this; + } + + /** + *

            Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

            + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ArticlesListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

            If provided, will only return objects created after this datetime.

            + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

            If provided, will only return objects created before this datetime.

            + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

            If provided, only objects synced by Merge after this date time will be returned.

            + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

            If provided, only objects synced by Merge before this date time will be returned.

            + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            If provided, will only return sub articles of the parent_article_id.

            + */ + @JsonSetter(value = "parent_article_id", nulls = Nulls.SKIP) + public Builder parentArticleId(Optional parentArticleId) { + this.parentArticleId = parentArticleId; + return this; + } + + public Builder parentArticleId(String parentArticleId) { + this.parentArticleId = Optional.ofNullable(parentArticleId); + return this; + } + + /** + *

            If provided, will only return sub articles of the parent_container_id.

            + */ + @JsonSetter(value = "parent_container_id", nulls = Nulls.SKIP) + public Builder parentContainerId(Optional parentContainerId) { + this.parentContainerId = parentContainerId; + return this; + } + + public Builder parentContainerId(String parentContainerId) { + this.parentContainerId = Optional.ofNullable(parentContainerId); + return this; + } + + /** + *

            The API provider's ID for the given object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            If provided, will only return sub articles of the root_container_id.

            + */ + @JsonSetter(value = "root_container_id", nulls = Nulls.SKIP) + public Builder rootContainerId(Optional rootContainerId) { + this.rootContainerId = rootContainerId; + return this; + } + + public Builder rootContainerId(String rootContainerId) { + this.rootContainerId = Optional.ofNullable(rootContainerId); + return this; + } + + /** + *

            If provided, will only return articles of the given status; multiple statuses can be separated by commas.

            + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

            If provided, will only return articles of the given type.

            + */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(ArticlesListRequestType type) { + this.type = Optional.ofNullable(type); + return this; + } + + public ArticlesListRequest build() { + return new ArticlesListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + parentArticleId, + parentContainerId, + remoteId, + rootContainerId, + status, + type, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequestExpandItem.java b/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequestExpandItem.java new file mode 100644 index 000000000..9b21b9c9c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequestExpandItem.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ArticlesListRequestExpandItem { + public static final ArticlesListRequestExpandItem ROOT_CONTAINER = + new ArticlesListRequestExpandItem(Value.ROOT_CONTAINER, "root_container"); + + public static final ArticlesListRequestExpandItem ATTACHMENTS = + new ArticlesListRequestExpandItem(Value.ATTACHMENTS, "attachments"); + + public static final ArticlesListRequestExpandItem LAST_EDITED_BY = + new ArticlesListRequestExpandItem(Value.LAST_EDITED_BY, "last_edited_by"); + + public static final ArticlesListRequestExpandItem PERMISSIONS = + new ArticlesListRequestExpandItem(Value.PERMISSIONS, "permissions"); + + public static final ArticlesListRequestExpandItem AUTHOR = + new ArticlesListRequestExpandItem(Value.AUTHOR, "author"); + + public static final ArticlesListRequestExpandItem PARENT_ARTICLE = + new ArticlesListRequestExpandItem(Value.PARENT_ARTICLE, "parent_article"); + + public static final ArticlesListRequestExpandItem PARENT_CONTAINER = + new ArticlesListRequestExpandItem(Value.PARENT_CONTAINER, "parent_container"); + + private final Value value; + + private final String string; + + ArticlesListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ArticlesListRequestExpandItem + && this.string.equals(((ArticlesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ROOT_CONTAINER: + return visitor.visitRootContainer(); + case ATTACHMENTS: + return visitor.visitAttachments(); + case LAST_EDITED_BY: + return visitor.visitLastEditedBy(); + case PERMISSIONS: + return visitor.visitPermissions(); + case AUTHOR: + return visitor.visitAuthor(); + case PARENT_ARTICLE: + return visitor.visitParentArticle(); + case PARENT_CONTAINER: + return visitor.visitParentContainer(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ArticlesListRequestExpandItem valueOf(String value) { + switch (value) { + case "root_container": + return ROOT_CONTAINER; + case "attachments": + return ATTACHMENTS; + case "last_edited_by": + return LAST_EDITED_BY; + case "permissions": + return PERMISSIONS; + case "author": + return AUTHOR; + case "parent_article": + return PARENT_ARTICLE; + case "parent_container": + return PARENT_CONTAINER; + default: + return new ArticlesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ATTACHMENTS, + + AUTHOR, + + LAST_EDITED_BY, + + PARENT_ARTICLE, + + PARENT_CONTAINER, + + PERMISSIONS, + + ROOT_CONTAINER, + + UNKNOWN + } + + public interface Visitor { + T visitAttachments(); + + T visitAuthor(); + + T visitLastEditedBy(); + + T visitParentArticle(); + + T visitParentContainer(); + + T visitPermissions(); + + T visitRootContainer(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequestType.java b/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequestType.java new file mode 100644 index 000000000..2d8e90946 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticlesListRequestType.java @@ -0,0 +1,105 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ArticlesListRequestType { + public static final ArticlesListRequestType SMART_LINK = + new ArticlesListRequestType(Value.SMART_LINK, "SMART_LINK"); + + public static final ArticlesListRequestType PAGE = new ArticlesListRequestType(Value.PAGE, "PAGE"); + + public static final ArticlesListRequestType EMPTY = new ArticlesListRequestType(Value.EMPTY, ""); + + public static final ArticlesListRequestType BLOG_POST = new ArticlesListRequestType(Value.BLOG_POST, "BLOG_POST"); + + private final Value value; + + private final String string; + + ArticlesListRequestType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ArticlesListRequestType + && this.string.equals(((ArticlesListRequestType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SMART_LINK: + return visitor.visitSmartLink(); + case PAGE: + return visitor.visitPage(); + case EMPTY: + return visitor.visitEmpty(); + case BLOG_POST: + return visitor.visitBlogPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ArticlesListRequestType valueOf(String value) { + switch (value) { + case "SMART_LINK": + return SMART_LINK; + case "PAGE": + return PAGE; + case "": + return EMPTY; + case "BLOG_POST": + return BLOG_POST; + default: + return new ArticlesListRequestType(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPTY, + + BLOG_POST, + + PAGE, + + SMART_LINK, + + UNKNOWN + } + + public interface Visitor { + T visitEmpty(); + + T visitBlogPost(); + + T visitPage(); + + T visitSmartLink(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticlesRetrieveRequest.java b/src/main/java/com/merge/api/knowledgebase/types/ArticlesRetrieveRequest.java new file mode 100644 index 000000000..960348db6 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticlesRetrieveRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ArticlesRetrieveRequest.Builder.class) +public final class ArticlesRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ArticlesRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ArticlesRetrieveRequest && equalTo((ArticlesRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ArticlesRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ArticlesRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

            Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

            + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ArticlesRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ArticlesRetrieveRequest build() { + return new ArticlesRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ArticlesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/knowledgebase/types/ArticlesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..c244e26c9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ArticlesRetrieveRequestExpandItem.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ArticlesRetrieveRequestExpandItem { + public static final ArticlesRetrieveRequestExpandItem ROOT_CONTAINER = + new ArticlesRetrieveRequestExpandItem(Value.ROOT_CONTAINER, "root_container"); + + public static final ArticlesRetrieveRequestExpandItem ATTACHMENTS = + new ArticlesRetrieveRequestExpandItem(Value.ATTACHMENTS, "attachments"); + + public static final ArticlesRetrieveRequestExpandItem LAST_EDITED_BY = + new ArticlesRetrieveRequestExpandItem(Value.LAST_EDITED_BY, "last_edited_by"); + + public static final ArticlesRetrieveRequestExpandItem PERMISSIONS = + new ArticlesRetrieveRequestExpandItem(Value.PERMISSIONS, "permissions"); + + public static final ArticlesRetrieveRequestExpandItem AUTHOR = + new ArticlesRetrieveRequestExpandItem(Value.AUTHOR, "author"); + + public static final ArticlesRetrieveRequestExpandItem PARENT_ARTICLE = + new ArticlesRetrieveRequestExpandItem(Value.PARENT_ARTICLE, "parent_article"); + + public static final ArticlesRetrieveRequestExpandItem PARENT_CONTAINER = + new ArticlesRetrieveRequestExpandItem(Value.PARENT_CONTAINER, "parent_container"); + + private final Value value; + + private final String string; + + ArticlesRetrieveRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ArticlesRetrieveRequestExpandItem + && this.string.equals(((ArticlesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ROOT_CONTAINER: + return visitor.visitRootContainer(); + case ATTACHMENTS: + return visitor.visitAttachments(); + case LAST_EDITED_BY: + return visitor.visitLastEditedBy(); + case PERMISSIONS: + return visitor.visitPermissions(); + case AUTHOR: + return visitor.visitAuthor(); + case PARENT_ARTICLE: + return visitor.visitParentArticle(); + case PARENT_CONTAINER: + return visitor.visitParentContainer(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ArticlesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "root_container": + return ROOT_CONTAINER; + case "attachments": + return ATTACHMENTS; + case "last_edited_by": + return LAST_EDITED_BY; + case "permissions": + return PERMISSIONS; + case "author": + return AUTHOR; + case "parent_article": + return PARENT_ARTICLE; + case "parent_container": + return PARENT_CONTAINER; + default: + return new ArticlesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ATTACHMENTS, + + AUTHOR, + + LAST_EDITED_BY, + + PARENT_ARTICLE, + + PARENT_CONTAINER, + + PERMISSIONS, + + ROOT_CONTAINER, + + UNKNOWN + } + + public interface Visitor { + T visitAttachments(); + + T visitAuthor(); + + T visitLastEditedBy(); + + T visitParentArticle(); + + T visitParentContainer(); + + T visitPermissions(); + + T visitRootContainer(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AsyncPassthroughReciept.java b/src/main/java/com/merge/api/knowledgebase/types/AsyncPassthroughReciept.java new file mode 100644 index 000000000..85ae8ebc2 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AsyncPassthroughReciept.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughReciept.Builder.class) +public final class AsyncPassthroughReciept { + private final String asyncPassthroughReceiptId; + + private final Map additionalProperties; + + private AsyncPassthroughReciept(String asyncPassthroughReceiptId, Map additionalProperties) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("async_passthrough_receipt_id") + public String getAsyncPassthroughReceiptId() { + return asyncPassthroughReceiptId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughReciept && equalTo((AsyncPassthroughReciept) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AsyncPassthroughReciept other) { + return asyncPassthroughReceiptId.equals(other.asyncPassthroughReceiptId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.asyncPassthroughReceiptId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AsyncPassthroughReceiptIdStage builder() { + return new Builder(); + } + + public interface AsyncPassthroughReceiptIdStage { + _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId); + + Builder from(AsyncPassthroughReciept other); + } + + public interface _FinalStage { + AsyncPassthroughReciept build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AsyncPassthroughReceiptIdStage, _FinalStage { + private String asyncPassthroughReceiptId; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AsyncPassthroughReciept other) { + asyncPassthroughReceiptId(other.getAsyncPassthroughReceiptId()); + return this; + } + + @java.lang.Override + @JsonSetter("async_passthrough_receipt_id") + public _FinalStage asyncPassthroughReceiptId(@NotNull String asyncPassthroughReceiptId) { + this.asyncPassthroughReceiptId = asyncPassthroughReceiptId; + return this; + } + + @java.lang.Override + public AsyncPassthroughReciept build() { + return new AsyncPassthroughReciept(asyncPassthroughReceiptId, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AsyncPassthroughRetrieveResponse.java b/src/main/java/com/merge/api/knowledgebase/types/AsyncPassthroughRetrieveResponse.java new file mode 100644 index 000000000..3d40d7f07 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AsyncPassthroughRetrieveResponse.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AsyncPassthroughRetrieveResponse.Deserializer.class) +public final class AsyncPassthroughRetrieveResponse { + private final Object value; + + private final int type; + + private AsyncPassthroughRetrieveResponse(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RemoteResponse) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveResponse && equalTo((AsyncPassthroughRetrieveResponse) other); + } + + private boolean equalTo(AsyncPassthroughRetrieveResponse other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AsyncPassthroughRetrieveResponse of(RemoteResponse value) { + return new AsyncPassthroughRetrieveResponse(value, 0); + } + + public static AsyncPassthroughRetrieveResponse of(String value) { + return new AsyncPassthroughRetrieveResponse(value, 1); + } + + public interface Visitor { + T visit(RemoteResponse value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AsyncPassthroughRetrieveResponse.class); + } + + @java.lang.Override + public AsyncPassthroughRetrieveResponse deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RemoteResponse.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/Attachment.java b/src/main/java/com/merge/api/knowledgebase/types/Attachment.java new file mode 100644 index 000000000..ba868d824 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/Attachment.java @@ -0,0 +1,378 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Attachment.Builder.class) +public final class Attachment { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional description; + + private final Optional attachmentUrl; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Attachment( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional attachmentUrl, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.description = description; + this.attachmentUrl = attachmentUrl; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The attachment's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The attachment's description. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The attachment's url. + */ + @JsonProperty("attachment_url") + public Optional getAttachmentUrl() { + return attachmentUrl; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Attachment && equalTo((Attachment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Attachment other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && description.equals(other.description) + && attachmentUrl.equals(other.attachmentUrl) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.attachmentUrl, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional attachmentUrl = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Attachment other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + attachmentUrl(other.getAttachmentUrl()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

            The third-party API ID of the matching object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            The datetime that this object was created by Merge.

            + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

            The datetime that this object was modified by Merge.

            + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

            The attachment's name.

            + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

            The attachment's description.

            + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

            The attachment's url.

            + */ + @JsonSetter(value = "attachment_url", nulls = Nulls.SKIP) + public Builder attachmentUrl(Optional attachmentUrl) { + this.attachmentUrl = attachmentUrl; + return this; + } + + public Builder attachmentUrl(String attachmentUrl) { + this.attachmentUrl = Optional.ofNullable(attachmentUrl); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(AttachmentFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Attachment build() { + return new Attachment( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + attachmentUrl, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AttachmentFieldMappings.java b/src/main/java/com/merge/api/knowledgebase/types/AttachmentFieldMappings.java new file mode 100644 index 000000000..030459e82 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AttachmentFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentFieldMappings.Builder.class) +public final class AttachmentFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private AttachmentFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentFieldMappings && equalTo((AttachmentFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public AttachmentFieldMappings build() { + return new AttachmentFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AttachmentsListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/AttachmentsListRequest.java new file mode 100644 index 000000000..7de43a394 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AttachmentsListRequest.java @@ -0,0 +1,395 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsListRequest.Builder.class) +public final class AttachmentsListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private AttachmentsListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsListRequest && equalTo((AttachmentsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + /** + *

            If provided, will only return objects created after this datetime.

            + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

            If provided, will only return objects created before this datetime.

            + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

            If provided, only objects synced by Merge after this date time will be returned.

            + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

            If provided, only objects synced by Merge before this date time will be returned.

            + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            The API provider's ID for the given object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public AttachmentsListRequest build() { + return new AttachmentsListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/knowledgebase/types/AttachmentsRetrieveRequest.java new file mode 100644 index 000000000..63fb475c0 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AttachmentsRetrieveRequest.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) +public final class AttachmentsRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private AttachmentsRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AttachmentsRetrieveRequest && equalTo((AttachmentsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AttachmentsRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AttachmentsRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public AttachmentsRetrieveRequest build() { + return new AttachmentsRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AuditLogEvent.java b/src/main/java/com/merge/api/knowledgebase/types/AuditLogEvent.java new file mode 100644 index 000000000..1b60c2016 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AuditLogEvent.java @@ -0,0 +1,365 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditLogEvent.Builder.class) +public final class AuditLogEvent { + private final Optional id; + + private final Optional userName; + + private final Optional userEmail; + + private final AuditLogEventRole role; + + private final String ipAddress; + + private final AuditLogEventEventType eventType; + + private final String eventDescription; + + private final Optional createdAt; + + private final Map additionalProperties; + + private AuditLogEvent( + Optional id, + Optional userName, + Optional userEmail, + AuditLogEventRole role, + String ipAddress, + AuditLogEventEventType eventType, + String eventDescription, + Optional createdAt, + Map additionalProperties) { + this.id = id; + this.userName = userName; + this.userEmail = userEmail; + this.role = role; + this.ipAddress = ipAddress; + this.eventType = eventType; + this.eventDescription = eventDescription; + this.createdAt = createdAt; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The User's full name at the time of this Event occurring. + */ + @JsonProperty("user_name") + public Optional getUserName() { + return userName; + } + + /** + * @return The User's email at the time of this Event occurring. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + /** + * @return Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + */ + @JsonProperty("role") + public AuditLogEventRole getRole() { + return role; + } + + @JsonProperty("ip_address") + public String getIpAddress() { + return ipAddress; + } + + /** + * @return Designates the type of event that occurred. + */ + @JsonProperty("event_type") + public AuditLogEventEventType getEventType() { + return eventType; + } + + @JsonProperty("event_description") + public String getEventDescription() { + return eventDescription; + } + + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEvent && equalTo((AuditLogEvent) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditLogEvent other) { + return id.equals(other.id) + && userName.equals(other.userName) + && userEmail.equals(other.userEmail) + && role.equals(other.role) + && ipAddress.equals(other.ipAddress) + && eventType.equals(other.eventType) + && eventDescription.equals(other.eventDescription) + && createdAt.equals(other.createdAt); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.userName, + this.userEmail, + this.role, + this.ipAddress, + this.eventType, + this.eventDescription, + this.createdAt); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RoleStage builder() { + return new Builder(); + } + + public interface RoleStage { + /** + *

            Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

            + */ + IpAddressStage role(@NotNull AuditLogEventRole role); + + Builder from(AuditLogEvent other); + } + + public interface IpAddressStage { + EventTypeStage ipAddress(@NotNull String ipAddress); + } + + public interface EventTypeStage { + /** + *

            Designates the type of event that occurred.

            + */ + EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType); + } + + public interface EventDescriptionStage { + _FinalStage eventDescription(@NotNull String eventDescription); + } + + public interface _FinalStage { + AuditLogEvent build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

            The User's full name at the time of this Event occurring.

            + */ + _FinalStage userName(Optional userName); + + _FinalStage userName(String userName); + + /** + *

            The User's email at the time of this Event occurring.

            + */ + _FinalStage userEmail(Optional userEmail); + + _FinalStage userEmail(String userEmail); + + _FinalStage createdAt(Optional createdAt); + + _FinalStage createdAt(OffsetDateTime createdAt); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RoleStage, IpAddressStage, EventTypeStage, EventDescriptionStage, _FinalStage { + private AuditLogEventRole role; + + private String ipAddress; + + private AuditLogEventEventType eventType; + + private String eventDescription; + + private Optional createdAt = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + private Optional userName = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AuditLogEvent other) { + id(other.getId()); + userName(other.getUserName()); + userEmail(other.getUserEmail()); + role(other.getRole()); + ipAddress(other.getIpAddress()); + eventType(other.getEventType()); + eventDescription(other.getEventDescription()); + createdAt(other.getCreatedAt()); + return this; + } + + /** + *

            Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

            + *

            Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("role") + public IpAddressStage role(@NotNull AuditLogEventRole role) { + this.role = role; + return this; + } + + @java.lang.Override + @JsonSetter("ip_address") + public EventTypeStage ipAddress(@NotNull String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + *

            Designates the type of event that occurred.

            + *

            Designates the type of event that occurred.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("event_type") + public EventDescriptionStage eventType(@NotNull AuditLogEventEventType eventType) { + this.eventType = eventType; + return this; + } + + @java.lang.Override + @JsonSetter("event_description") + public _FinalStage eventDescription(@NotNull String eventDescription) { + this.eventDescription = eventDescription; + return this; + } + + @java.lang.Override + public _FinalStage createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + @java.lang.Override + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public _FinalStage createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + *

            The User's email at the time of this Event occurring.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + /** + *

            The User's email at the time of this Event occurring.

            + */ + @java.lang.Override + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public _FinalStage userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + /** + *

            The User's full name at the time of this Event occurring.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage userName(String userName) { + this.userName = Optional.ofNullable(userName); + return this; + } + + /** + *

            The User's full name at the time of this Event occurring.

            + */ + @java.lang.Override + @JsonSetter(value = "user_name", nulls = Nulls.SKIP) + public _FinalStage userName(Optional userName) { + this.userName = userName; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public AuditLogEvent build() { + return new AuditLogEvent( + id, + userName, + userEmail, + role, + ipAddress, + eventType, + eventDescription, + createdAt, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AuditLogEventEventType.java b/src/main/java/com/merge/api/knowledgebase/types/AuditLogEventEventType.java new file mode 100644 index 000000000..f1a45d151 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AuditLogEventEventType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AuditLogEventEventType.Deserializer.class) +public final class AuditLogEventEventType { + private final Object value; + + private final int type; + + private AuditLogEventEventType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EventTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEventEventType && equalTo((AuditLogEventEventType) other); + } + + private boolean equalTo(AuditLogEventEventType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AuditLogEventEventType of(EventTypeEnum value) { + return new AuditLogEventEventType(value, 0); + } + + public static AuditLogEventEventType of(String value) { + return new AuditLogEventEventType(value, 1); + } + + public interface Visitor { + T visit(EventTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AuditLogEventEventType.class); + } + + @java.lang.Override + public AuditLogEventEventType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EventTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AuditLogEventRole.java b/src/main/java/com/merge/api/knowledgebase/types/AuditLogEventRole.java new file mode 100644 index 000000000..88baff60c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AuditLogEventRole.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = AuditLogEventRole.Deserializer.class) +public final class AuditLogEventRole { + private final Object value; + + private final int type; + + private AuditLogEventRole(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RoleEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditLogEventRole && equalTo((AuditLogEventRole) other); + } + + private boolean equalTo(AuditLogEventRole other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static AuditLogEventRole of(RoleEnum value) { + return new AuditLogEventRole(value, 0); + } + + public static AuditLogEventRole of(String value) { + return new AuditLogEventRole(value, 1); + } + + public interface Visitor { + T visit(RoleEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(AuditLogEventRole.class); + } + + @java.lang.Override + public AuditLogEventRole deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RoleEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/AuditTrailListRequest.java new file mode 100644 index 000000000..973c53a75 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AuditTrailListRequest.java @@ -0,0 +1,254 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AuditTrailListRequest.Builder.class) +public final class AuditTrailListRequest { + private final Optional cursor; + + private final Optional endDate; + + private final Optional eventType; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional userEmail; + + private final Map additionalProperties; + + private AuditTrailListRequest( + Optional cursor, + Optional endDate, + Optional eventType, + Optional pageSize, + Optional startDate, + Optional userEmail, + Map additionalProperties) { + this.cursor = cursor; + this.endDate = endDate; + this.eventType = eventType; + this.pageSize = pageSize; + this.startDate = startDate; + this.userEmail = userEmail; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include audit trail events that occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + /** + * @return 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 + */ + @JsonProperty("event_type") + public Optional getEventType() { + return eventType; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include audit trail events that occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return 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. + */ + @JsonProperty("user_email") + public Optional getUserEmail() { + return userEmail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuditTrailListRequest && equalTo((AuditTrailListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AuditTrailListRequest other) { + return cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && eventType.equals(other.eventType) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && userEmail.equals(other.userEmail); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.endDate, this.eventType, this.pageSize, this.startDate, this.userEmail); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional eventType = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional userEmail = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AuditTrailListRequest other) { + cursor(other.getCursor()); + endDate(other.getEndDate()); + eventType(other.getEventType()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + userEmail(other.getUserEmail()); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            If included, will only include audit trail events that occurred before this time

            + */ + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + /** + *

            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

            + */ + @JsonSetter(value = "event_type", nulls = Nulls.SKIP) + public Builder eventType(Optional eventType) { + this.eventType = eventType; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = Optional.ofNullable(eventType); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            If included, will only include audit trail events that occurred after this time

            + */ + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "user_email", nulls = Nulls.SKIP) + public Builder userEmail(Optional userEmail) { + this.userEmail = userEmail; + return this; + } + + public Builder userEmail(String userEmail) { + this.userEmail = Optional.ofNullable(userEmail); + return this; + } + + public AuditTrailListRequest build() { + return new AuditTrailListRequest( + cursor, endDate, eventType, pageSize, startDate, userEmail, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/AvailableActions.java b/src/main/java/com/merge/api/knowledgebase/types/AvailableActions.java new file mode 100644 index 000000000..809403ab9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/AvailableActions.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AvailableActions.Builder.class) +public final class AvailableActions { + private final AccountIntegration integration; + + private final boolean passthroughAvailable; + + private final Optional> availableModelOperations; + + private final Map additionalProperties; + + private AvailableActions( + AccountIntegration integration, + boolean passthroughAvailable, + Optional> availableModelOperations, + Map additionalProperties) { + this.integration = integration; + this.passthroughAvailable = passthroughAvailable; + this.availableModelOperations = availableModelOperations; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("integration") + public AccountIntegration getIntegration() { + return integration; + } + + @JsonProperty("passthrough_available") + public boolean getPassthroughAvailable() { + return passthroughAvailable; + } + + @JsonProperty("available_model_operations") + public Optional> getAvailableModelOperations() { + return availableModelOperations; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AvailableActions && equalTo((AvailableActions) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(AvailableActions other) { + return integration.equals(other.integration) + && passthroughAvailable == other.passthroughAvailable + && availableModelOperations.equals(other.availableModelOperations); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.integration, this.passthroughAvailable, this.availableModelOperations); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IntegrationStage builder() { + return new Builder(); + } + + public interface IntegrationStage { + PassthroughAvailableStage integration(@NotNull AccountIntegration integration); + + Builder from(AvailableActions other); + } + + public interface PassthroughAvailableStage { + _FinalStage passthroughAvailable(boolean passthroughAvailable); + } + + public interface _FinalStage { + AvailableActions build(); + + _FinalStage availableModelOperations(Optional> availableModelOperations); + + _FinalStage availableModelOperations(List availableModelOperations); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IntegrationStage, PassthroughAvailableStage, _FinalStage { + private AccountIntegration integration; + + private boolean passthroughAvailable; + + private Optional> availableModelOperations = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(AvailableActions other) { + integration(other.getIntegration()); + passthroughAvailable(other.getPassthroughAvailable()); + availableModelOperations(other.getAvailableModelOperations()); + return this; + } + + @java.lang.Override + @JsonSetter("integration") + public PassthroughAvailableStage integration(@NotNull AccountIntegration integration) { + this.integration = integration; + return this; + } + + @java.lang.Override + @JsonSetter("passthrough_available") + public _FinalStage passthroughAvailable(boolean passthroughAvailable) { + this.passthroughAvailable = passthroughAvailable; + return this; + } + + @java.lang.Override + public _FinalStage availableModelOperations(List availableModelOperations) { + this.availableModelOperations = Optional.ofNullable(availableModelOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_model_operations", nulls = Nulls.SKIP) + public _FinalStage availableModelOperations(Optional> availableModelOperations) { + this.availableModelOperations = availableModelOperations; + return this; + } + + @java.lang.Override + public AvailableActions build() { + return new AvailableActions( + integration, passthroughAvailable, availableModelOperations, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/CategoriesEnum.java b/src/main/java/com/merge/api/knowledgebase/types/CategoriesEnum.java new file mode 100644 index 000000000..37e5921d6 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/CategoriesEnum.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CategoriesEnum { + public static final CategoriesEnum HRIS = new CategoriesEnum(Value.HRIS, "hris"); + + public static final CategoriesEnum TICKETING = new CategoriesEnum(Value.TICKETING, "ticketing"); + + public static final CategoriesEnum KNOWLEDGEBASE = new CategoriesEnum(Value.KNOWLEDGEBASE, "knowledgebase"); + + public static final CategoriesEnum CRM = new CategoriesEnum(Value.CRM, "crm"); + + public static final CategoriesEnum FILESTORAGE = new CategoriesEnum(Value.FILESTORAGE, "filestorage"); + + public static final CategoriesEnum ACCOUNTING = new CategoriesEnum(Value.ACCOUNTING, "accounting"); + + public static final CategoriesEnum MKTG = new CategoriesEnum(Value.MKTG, "mktg"); + + public static final CategoriesEnum ATS = new CategoriesEnum(Value.ATS, "ats"); + + private final Value value; + + private final String string; + + CategoriesEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CategoriesEnum && this.string.equals(((CategoriesEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HRIS: + return visitor.visitHris(); + case TICKETING: + return visitor.visitTicketing(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); + case CRM: + return visitor.visitCrm(); + case FILESTORAGE: + return visitor.visitFilestorage(); + case ACCOUNTING: + return visitor.visitAccounting(); + case MKTG: + return visitor.visitMktg(); + case ATS: + return visitor.visitAts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CategoriesEnum valueOf(String value) { + switch (value) { + case "hris": + return HRIS; + case "ticketing": + return TICKETING; + case "knowledgebase": + return KNOWLEDGEBASE; + case "crm": + return CRM; + case "filestorage": + return FILESTORAGE; + case "accounting": + return ACCOUNTING; + case "mktg": + return MKTG; + case "ats": + return ATS; + default: + return new CategoriesEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + HRIS, + + ATS, + + ACCOUNTING, + + TICKETING, + + CRM, + + MKTG, + + FILESTORAGE, + + KNOWLEDGEBASE, + + UNKNOWN + } + + public interface Visitor { + T visitHris(); + + T visitAts(); + + T visitAccounting(); + + T visitTicketing(); + + T visitCrm(); + + T visitMktg(); + + T visitFilestorage(); + + T visitKnowledgebase(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/CategoryEnum.java b/src/main/java/com/merge/api/knowledgebase/types/CategoryEnum.java new file mode 100644 index 000000000..6fe2f8f6b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/CategoryEnum.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CategoryEnum { + public static final CategoryEnum HRIS = new CategoryEnum(Value.HRIS, "hris"); + + public static final CategoryEnum TICKETING = new CategoryEnum(Value.TICKETING, "ticketing"); + + public static final CategoryEnum KNOWLEDGEBASE = new CategoryEnum(Value.KNOWLEDGEBASE, "knowledgebase"); + + public static final CategoryEnum CRM = new CategoryEnum(Value.CRM, "crm"); + + public static final CategoryEnum FILESTORAGE = new CategoryEnum(Value.FILESTORAGE, "filestorage"); + + public static final CategoryEnum ACCOUNTING = new CategoryEnum(Value.ACCOUNTING, "accounting"); + + public static final CategoryEnum MKTG = new CategoryEnum(Value.MKTG, "mktg"); + + public static final CategoryEnum ATS = new CategoryEnum(Value.ATS, "ats"); + + private final Value value; + + private final String string; + + CategoryEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof CategoryEnum && this.string.equals(((CategoryEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HRIS: + return visitor.visitHris(); + case TICKETING: + return visitor.visitTicketing(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); + case CRM: + return visitor.visitCrm(); + case FILESTORAGE: + return visitor.visitFilestorage(); + case ACCOUNTING: + return visitor.visitAccounting(); + case MKTG: + return visitor.visitMktg(); + case ATS: + return visitor.visitAts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CategoryEnum valueOf(String value) { + switch (value) { + case "hris": + return HRIS; + case "ticketing": + return TICKETING; + case "knowledgebase": + return KNOWLEDGEBASE; + case "crm": + return CRM; + case "filestorage": + return FILESTORAGE; + case "accounting": + return ACCOUNTING; + case "mktg": + return MKTG; + case "ats": + return ATS; + default: + return new CategoryEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + HRIS, + + ATS, + + ACCOUNTING, + + TICKETING, + + CRM, + + MKTG, + + FILESTORAGE, + + KNOWLEDGEBASE, + + UNKNOWN + } + + public interface Visitor { + T visitHris(); + + T visitAts(); + + T visitAccounting(); + + T visitTicketing(); + + T visitCrm(); + + T visitMktg(); + + T visitFilestorage(); + + T visitKnowledgebase(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/CommonModelScopeApi.java b/src/main/java/com/merge/api/knowledgebase/types/CommonModelScopeApi.java new file mode 100644 index 000000000..0cd61844f --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/CommonModelScopeApi.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopeApi.Builder.class) +public final class CommonModelScopeApi { + private final List commonModels; + + private final Map additionalProperties; + + private CommonModelScopeApi( + List commonModels, Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopeApi && equalTo((CommonModelScopeApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopeApi other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CommonModelScopeApi other) { + commonModels(other.getCommonModels()); + return this; + } + + /** + *

            The common models you want to update the scopes for

            + */ + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializer commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public CommonModelScopeApi build() { + return new CommonModelScopeApi(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/CommonModelScopesBodyRequest.java b/src/main/java/com/merge/api/knowledgebase/types/CommonModelScopesBodyRequest.java new file mode 100644 index 000000000..ab95f1ea5 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/CommonModelScopesBodyRequest.java @@ -0,0 +1,193 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CommonModelScopesBodyRequest.Builder.class) +public final class CommonModelScopesBodyRequest { + private final String modelId; + + private final List enabledActions; + + private final List disabledFields; + + private final Map additionalProperties; + + private CommonModelScopesBodyRequest( + String modelId, + List enabledActions, + List disabledFields, + Map additionalProperties) { + this.modelId = modelId; + this.enabledActions = enabledActions; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("enabled_actions") + public List getEnabledActions() { + return enabledActions; + } + + @JsonProperty("disabled_fields") + public List getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CommonModelScopesBodyRequest && equalTo((CommonModelScopesBodyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CommonModelScopesBodyRequest other) { + return modelId.equals(other.modelId) + && enabledActions.equals(other.enabledActions) + && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelId, this.enabledActions, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelIdStage builder() { + return new Builder(); + } + + public interface ModelIdStage { + _FinalStage modelId(@NotNull String modelId); + + Builder from(CommonModelScopesBodyRequest other); + } + + public interface _FinalStage { + CommonModelScopesBodyRequest build(); + + _FinalStage enabledActions(List enabledActions); + + _FinalStage addEnabledActions(EnabledActionsEnum enabledActions); + + _FinalStage addAllEnabledActions(List enabledActions); + + _FinalStage disabledFields(List disabledFields); + + _FinalStage addDisabledFields(String disabledFields); + + _FinalStage addAllDisabledFields(List disabledFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelIdStage, _FinalStage { + private String modelId; + + private List disabledFields = new ArrayList<>(); + + private List enabledActions = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CommonModelScopesBodyRequest other) { + modelId(other.getModelId()); + enabledActions(other.getEnabledActions()); + disabledFields(other.getDisabledFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public _FinalStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + public _FinalStage addAllDisabledFields(List disabledFields) { + if (disabledFields != null) { + this.disabledFields.addAll(disabledFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addDisabledFields(String disabledFields) { + this.disabledFields.add(disabledFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public _FinalStage disabledFields(List disabledFields) { + this.disabledFields.clear(); + if (disabledFields != null) { + this.disabledFields.addAll(disabledFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllEnabledActions(List enabledActions) { + if (enabledActions != null) { + this.enabledActions.addAll(enabledActions); + } + return this; + } + + @java.lang.Override + public _FinalStage addEnabledActions(EnabledActionsEnum enabledActions) { + this.enabledActions.add(enabledActions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "enabled_actions", nulls = Nulls.SKIP) + public _FinalStage enabledActions(List enabledActions) { + this.enabledActions.clear(); + if (enabledActions != null) { + this.enabledActions.addAll(enabledActions); + } + return this; + } + + @java.lang.Override + public CommonModelScopesBodyRequest build() { + return new CommonModelScopesBodyRequest(modelId, enabledActions, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/Container.java b/src/main/java/com/merge/api/knowledgebase/types/Container.java new file mode 100644 index 000000000..1cd35e745 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/Container.java @@ -0,0 +1,628 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Container.Builder.class) +public final class Container { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional description; + + private final Optional status; + + private final Optional containerUrl; + + private final Optional type; + + private final Optional visibility; + + private final Optional remoteCreatedAt; + + private final Optional remoteUpdatedAt; + + private final Optional parentArticle; + + private final Optional parentContainer; + + private final Optional> permissions; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Container( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional description, + Optional status, + Optional containerUrl, + Optional type, + Optional visibility, + Optional remoteCreatedAt, + Optional remoteUpdatedAt, + Optional parentArticle, + Optional parentContainer, + Optional> permissions, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.description = description; + this.status = status; + this.containerUrl = containerUrl; + this.type = type; + this.visibility = visibility; + this.remoteCreatedAt = remoteCreatedAt; + this.remoteUpdatedAt = remoteUpdatedAt; + this.parentArticle = parentArticle; + this.parentContainer = parentContainer; + this.permissions = permissions; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return Name of the container. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Description of the container. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The container's status. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The URL to the webpage of the container. + */ + @JsonProperty("container_url") + public Optional getContainerUrl() { + return containerUrl; + } + + /** + * @return The container's type. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return The container's visibility. + */ + @JsonProperty("visibility") + public Optional getVisibility() { + return visibility; + } + + /** + * @return When the third party's container was created. + */ + @JsonProperty("remote_created_at") + public Optional getRemoteCreatedAt() { + return remoteCreatedAt; + } + + /** + * @return When the third party's container was updated. + */ + @JsonProperty("remote_updated_at") + public Optional getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + /** + * @return The parent article a container is nested within. + */ + @JsonProperty("parent_article") + public Optional getParentArticle() { + return parentArticle; + } + + /** + * @return The parent container a container is nested within. + */ + @JsonProperty("parent_container") + public Optional getParentContainer() { + return parentContainer; + } + + @JsonProperty("permissions") + public Optional> getPermissions() { + return permissions; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Container && equalTo((Container) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Container other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && description.equals(other.description) + && status.equals(other.status) + && containerUrl.equals(other.containerUrl) + && type.equals(other.type) + && visibility.equals(other.visibility) + && remoteCreatedAt.equals(other.remoteCreatedAt) + && remoteUpdatedAt.equals(other.remoteUpdatedAt) + && parentArticle.equals(other.parentArticle) + && parentContainer.equals(other.parentContainer) + && permissions.equals(other.permissions) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.description, + this.status, + this.containerUrl, + this.type, + this.visibility, + this.remoteCreatedAt, + this.remoteUpdatedAt, + this.parentArticle, + this.parentContainer, + this.permissions, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional containerUrl = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional visibility = Optional.empty(); + + private Optional remoteCreatedAt = Optional.empty(); + + private Optional remoteUpdatedAt = Optional.empty(); + + private Optional parentArticle = Optional.empty(); + + private Optional parentContainer = Optional.empty(); + + private Optional> permissions = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Container other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + description(other.getDescription()); + status(other.getStatus()); + containerUrl(other.getContainerUrl()); + type(other.getType()); + visibility(other.getVisibility()); + remoteCreatedAt(other.getRemoteCreatedAt()); + remoteUpdatedAt(other.getRemoteUpdatedAt()); + parentArticle(other.getParentArticle()); + parentContainer(other.getParentContainer()); + permissions(other.getPermissions()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

            The third-party API ID of the matching object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            The datetime that this object was created by Merge.

            + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

            The datetime that this object was modified by Merge.

            + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

            Name of the container.

            + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

            Description of the container.

            + */ + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

            The container's status.

            + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(ContainerStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

            The URL to the webpage of the container.

            + */ + @JsonSetter(value = "container_url", nulls = Nulls.SKIP) + public Builder containerUrl(Optional containerUrl) { + this.containerUrl = containerUrl; + return this; + } + + public Builder containerUrl(String containerUrl) { + this.containerUrl = Optional.ofNullable(containerUrl); + return this; + } + + /** + *

            The container's type.

            + */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(ContainerType type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

            The container's visibility.

            + */ + @JsonSetter(value = "visibility", nulls = Nulls.SKIP) + public Builder visibility(Optional visibility) { + this.visibility = visibility; + return this; + } + + public Builder visibility(ContainerVisibility visibility) { + this.visibility = Optional.ofNullable(visibility); + return this; + } + + /** + *

            When the third party's container was created.

            + */ + @JsonSetter(value = "remote_created_at", nulls = Nulls.SKIP) + public Builder remoteCreatedAt(Optional remoteCreatedAt) { + this.remoteCreatedAt = remoteCreatedAt; + return this; + } + + public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { + this.remoteCreatedAt = Optional.ofNullable(remoteCreatedAt); + return this; + } + + /** + *

            When the third party's container was updated.

            + */ + @JsonSetter(value = "remote_updated_at", nulls = Nulls.SKIP) + public Builder remoteUpdatedAt(Optional remoteUpdatedAt) { + this.remoteUpdatedAt = remoteUpdatedAt; + return this; + } + + public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { + this.remoteUpdatedAt = Optional.ofNullable(remoteUpdatedAt); + return this; + } + + /** + *

            The parent article a container is nested within.

            + */ + @JsonSetter(value = "parent_article", nulls = Nulls.SKIP) + public Builder parentArticle(Optional parentArticle) { + this.parentArticle = parentArticle; + return this; + } + + public Builder parentArticle(String parentArticle) { + this.parentArticle = Optional.ofNullable(parentArticle); + return this; + } + + /** + *

            The parent container a container is nested within.

            + */ + @JsonSetter(value = "parent_container", nulls = Nulls.SKIP) + public Builder parentContainer(Optional parentContainer) { + this.parentContainer = parentContainer; + return this; + } + + public Builder parentContainer(String parentContainer) { + this.parentContainer = Optional.ofNullable(parentContainer); + return this; + } + + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional> permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(List permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(ContainerFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Container build() { + return new Container( + id, + remoteId, + createdAt, + modifiedAt, + name, + description, + status, + containerUrl, + type, + visibility, + remoteCreatedAt, + remoteUpdatedAt, + parentArticle, + parentContainer, + permissions, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainerFieldMappings.java b/src/main/java/com/merge/api/knowledgebase/types/ContainerFieldMappings.java new file mode 100644 index 000000000..b4530b6ea --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainerFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContainerFieldMappings.Builder.class) +public final class ContainerFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private ContainerFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContainerFieldMappings && equalTo((ContainerFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContainerFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContainerFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public ContainerFieldMappings build() { + return new ContainerFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainerPermissionsItem.java b/src/main/java/com/merge/api/knowledgebase/types/ContainerPermissionsItem.java new file mode 100644 index 000000000..025a252ca --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainerPermissionsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContainerPermissionsItem.Deserializer.class) +public final class ContainerPermissionsItem { + private final Object value; + + private final int type; + + private ContainerPermissionsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Permission) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContainerPermissionsItem && equalTo((ContainerPermissionsItem) other); + } + + private boolean equalTo(ContainerPermissionsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContainerPermissionsItem of(String value) { + return new ContainerPermissionsItem(value, 0); + } + + public static ContainerPermissionsItem of(Permission value) { + return new ContainerPermissionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Permission value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContainerPermissionsItem.class); + } + + @java.lang.Override + public ContainerPermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Permission.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainerStatus.java b/src/main/java/com/merge/api/knowledgebase/types/ContainerStatus.java new file mode 100644 index 000000000..2ffbcb9ed --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainerStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContainerStatus.Deserializer.class) +public final class ContainerStatus { + private final Object value; + + private final int type; + + private ContainerStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((Status3C6Enum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContainerStatus && equalTo((ContainerStatus) other); + } + + private boolean equalTo(ContainerStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContainerStatus of(Status3C6Enum value) { + return new ContainerStatus(value, 0); + } + + public static ContainerStatus of(String value) { + return new ContainerStatus(value, 1); + } + + public interface Visitor { + T visit(Status3C6Enum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContainerStatus.class); + } + + @java.lang.Override + public ContainerStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Status3C6Enum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainerType.java b/src/main/java/com/merge/api/knowledgebase/types/ContainerType.java new file mode 100644 index 000000000..5c163016d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainerType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContainerType.Deserializer.class) +public final class ContainerType { + private final Object value; + + private final int type; + + private ContainerType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ContainerTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContainerType && equalTo((ContainerType) other); + } + + private boolean equalTo(ContainerType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContainerType of(ContainerTypeEnum value) { + return new ContainerType(value, 0); + } + + public static ContainerType of(String value) { + return new ContainerType(value, 1); + } + + public interface Visitor { + T visit(ContainerTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContainerType.class); + } + + @java.lang.Override + public ContainerType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ContainerTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainerTypeEnum.java b/src/main/java/com/merge/api/knowledgebase/types/ContainerTypeEnum.java new file mode 100644 index 000000000..14d98bd91 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainerTypeEnum.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ContainerTypeEnum { + public static final ContainerTypeEnum SPACE = new ContainerTypeEnum(Value.SPACE, "SPACE"); + + public static final ContainerTypeEnum CATEGORY = new ContainerTypeEnum(Value.CATEGORY, "CATEGORY"); + + public static final ContainerTypeEnum SECTION = new ContainerTypeEnum(Value.SECTION, "SECTION"); + + public static final ContainerTypeEnum FOLDER = new ContainerTypeEnum(Value.FOLDER, "FOLDER"); + + public static final ContainerTypeEnum COLLECTION = new ContainerTypeEnum(Value.COLLECTION, "COLLECTION"); + + public static final ContainerTypeEnum DATABASE = new ContainerTypeEnum(Value.DATABASE, "DATABASE"); + + private final Value value; + + private final String string; + + ContainerTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ContainerTypeEnum && this.string.equals(((ContainerTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SPACE: + return visitor.visitSpace(); + case CATEGORY: + return visitor.visitCategory(); + case SECTION: + return visitor.visitSection(); + case FOLDER: + return visitor.visitFolder(); + case COLLECTION: + return visitor.visitCollection(); + case DATABASE: + return visitor.visitDatabase(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContainerTypeEnum valueOf(String value) { + switch (value) { + case "SPACE": + return SPACE; + case "CATEGORY": + return CATEGORY; + case "SECTION": + return SECTION; + case "FOLDER": + return FOLDER; + case "COLLECTION": + return COLLECTION; + case "DATABASE": + return DATABASE; + default: + return new ContainerTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + FOLDER, + + SPACE, + + COLLECTION, + + SECTION, + + CATEGORY, + + DATABASE, + + UNKNOWN + } + + public interface Visitor { + T visitFolder(); + + T visitSpace(); + + T visitCollection(); + + T visitSection(); + + T visitCategory(); + + T visitDatabase(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainerVisibility.java b/src/main/java/com/merge/api/knowledgebase/types/ContainerVisibility.java new file mode 100644 index 000000000..83708b9b5 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainerVisibility.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = ContainerVisibility.Deserializer.class) +public final class ContainerVisibility { + private final Object value; + + private final int type; + + private ContainerVisibility(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((VisibilityEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContainerVisibility && equalTo((ContainerVisibility) other); + } + + private boolean equalTo(ContainerVisibility other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static ContainerVisibility of(VisibilityEnum value) { + return new ContainerVisibility(value, 0); + } + + public static ContainerVisibility of(String value) { + return new ContainerVisibility(value, 1); + } + + public interface Visitor { + T visit(VisibilityEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(ContainerVisibility.class); + } + + @java.lang.Override + public ContainerVisibility deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, VisibilityEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequest.java new file mode 100644 index 000000000..59153a68a --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequest.java @@ -0,0 +1,530 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContainersListRequest.Builder.class) +public final class ContainersListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional parentArticleId; + + private final Optional parentContainerId; + + private final Optional remoteId; + + private final Optional type; + + private final Map additionalProperties; + + private ContainersListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional parentArticleId, + Optional parentContainerId, + Optional remoteId, + Optional type, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.parentArticleId = parentArticleId; + this.parentContainerId = parentContainerId; + this.remoteId = remoteId; + this.type = type; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If provided, will only return sub containers of the parent_article_id. + */ + @JsonProperty("parent_article_id") + public Optional getParentArticleId() { + return parentArticleId; + } + + /** + * @return If provided, will only return sub containers of the parent_container_id. + */ + @JsonProperty("parent_container_id") + public Optional getParentContainerId() { + return parentContainerId; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return If provided, will only return containers of the given type. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContainersListRequest && equalTo((ContainersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContainersListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && parentArticleId.equals(other.parentArticleId) + && parentContainerId.equals(other.parentContainerId) + && remoteId.equals(other.remoteId) + && type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.parentArticleId, + this.parentContainerId, + this.remoteId, + this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional parentArticleId = Optional.empty(); + + private Optional parentContainerId = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional type = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContainersListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + parentArticleId(other.getParentArticleId()); + parentContainerId(other.getParentContainerId()); + remoteId(other.getRemoteId()); + type(other.getType()); + return this; + } + + /** + *

            Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

            + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ContainersListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

            If provided, will only return objects created after this datetime.

            + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

            If provided, will only return objects created before this datetime.

            + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

            If provided, only objects synced by Merge after this date time will be returned.

            + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

            If provided, only objects synced by Merge before this date time will be returned.

            + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            If provided, will only return sub containers of the parent_article_id.

            + */ + @JsonSetter(value = "parent_article_id", nulls = Nulls.SKIP) + public Builder parentArticleId(Optional parentArticleId) { + this.parentArticleId = parentArticleId; + return this; + } + + public Builder parentArticleId(String parentArticleId) { + this.parentArticleId = Optional.ofNullable(parentArticleId); + return this; + } + + /** + *

            If provided, will only return sub containers of the parent_container_id.

            + */ + @JsonSetter(value = "parent_container_id", nulls = Nulls.SKIP) + public Builder parentContainerId(Optional parentContainerId) { + this.parentContainerId = parentContainerId; + return this; + } + + public Builder parentContainerId(String parentContainerId) { + this.parentContainerId = Optional.ofNullable(parentContainerId); + return this; + } + + /** + *

            The API provider's ID for the given object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            If provided, will only return containers of the given type.

            + */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(ContainersListRequestType type) { + this.type = Optional.ofNullable(type); + return this; + } + + public ContainersListRequest build() { + return new ContainersListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + parentArticleId, + parentContainerId, + remoteId, + type, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequestExpandItem.java b/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequestExpandItem.java new file mode 100644 index 000000000..1684b4fa3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequestExpandItem.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ContainersListRequestExpandItem { + public static final ContainersListRequestExpandItem PERMISSIONS = + new ContainersListRequestExpandItem(Value.PERMISSIONS, "permissions"); + + public static final ContainersListRequestExpandItem PARENT_ARTICLE = + new ContainersListRequestExpandItem(Value.PARENT_ARTICLE, "parent_article"); + + public static final ContainersListRequestExpandItem PARENT_CONTAINER = + new ContainersListRequestExpandItem(Value.PARENT_CONTAINER, "parent_container"); + + private final Value value; + + private final String string; + + ContainersListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ContainersListRequestExpandItem + && this.string.equals(((ContainersListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PERMISSIONS: + return visitor.visitPermissions(); + case PARENT_ARTICLE: + return visitor.visitParentArticle(); + case PARENT_CONTAINER: + return visitor.visitParentContainer(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContainersListRequestExpandItem valueOf(String value) { + switch (value) { + case "permissions": + return PERMISSIONS; + case "parent_article": + return PARENT_ARTICLE; + case "parent_container": + return PARENT_CONTAINER; + default: + return new ContainersListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_ARTICLE, + + PARENT_CONTAINER, + + PERMISSIONS, + + UNKNOWN + } + + public interface Visitor { + T visitParentArticle(); + + T visitParentContainer(); + + T visitPermissions(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequestType.java b/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequestType.java new file mode 100644 index 000000000..246776117 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainersListRequestType.java @@ -0,0 +1,135 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ContainersListRequestType { + public static final ContainersListRequestType SPACE = new ContainersListRequestType(Value.SPACE, "SPACE"); + + public static final ContainersListRequestType CATEGORY = new ContainersListRequestType(Value.CATEGORY, "CATEGORY"); + + public static final ContainersListRequestType EMPTY = new ContainersListRequestType(Value.EMPTY, ""); + + public static final ContainersListRequestType SECTION = new ContainersListRequestType(Value.SECTION, "SECTION"); + + public static final ContainersListRequestType FOLDER = new ContainersListRequestType(Value.FOLDER, "FOLDER"); + + public static final ContainersListRequestType COLLECTION = + new ContainersListRequestType(Value.COLLECTION, "COLLECTION"); + + public static final ContainersListRequestType DATABASE = new ContainersListRequestType(Value.DATABASE, "DATABASE"); + + private final Value value; + + private final String string; + + ContainersListRequestType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ContainersListRequestType + && this.string.equals(((ContainersListRequestType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SPACE: + return visitor.visitSpace(); + case CATEGORY: + return visitor.visitCategory(); + case EMPTY: + return visitor.visitEmpty(); + case SECTION: + return visitor.visitSection(); + case FOLDER: + return visitor.visitFolder(); + case COLLECTION: + return visitor.visitCollection(); + case DATABASE: + return visitor.visitDatabase(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContainersListRequestType valueOf(String value) { + switch (value) { + case "SPACE": + return SPACE; + case "CATEGORY": + return CATEGORY; + case "": + return EMPTY; + case "SECTION": + return SECTION; + case "FOLDER": + return FOLDER; + case "COLLECTION": + return COLLECTION; + case "DATABASE": + return DATABASE; + default: + return new ContainersListRequestType(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPTY, + + CATEGORY, + + COLLECTION, + + DATABASE, + + FOLDER, + + SECTION, + + SPACE, + + UNKNOWN + } + + public interface Visitor { + T visitEmpty(); + + T visitCategory(); + + T visitCollection(); + + T visitDatabase(); + + T visitFolder(); + + T visitSection(); + + T visitSpace(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainersRetrieveRequest.java b/src/main/java/com/merge/api/knowledgebase/types/ContainersRetrieveRequest.java new file mode 100644 index 000000000..671404de3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainersRetrieveRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContainersRetrieveRequest.Builder.class) +public final class ContainersRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private ContainersRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContainersRetrieveRequest && equalTo((ContainersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContainersRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContainersRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

            Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

            + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(ContainersRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public ContainersRetrieveRequest build() { + return new ContainersRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ContainersRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/knowledgebase/types/ContainersRetrieveRequestExpandItem.java new file mode 100644 index 000000000..bdbfb7eec --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ContainersRetrieveRequestExpandItem.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ContainersRetrieveRequestExpandItem { + public static final ContainersRetrieveRequestExpandItem PERMISSIONS = + new ContainersRetrieveRequestExpandItem(Value.PERMISSIONS, "permissions"); + + public static final ContainersRetrieveRequestExpandItem PARENT_ARTICLE = + new ContainersRetrieveRequestExpandItem(Value.PARENT_ARTICLE, "parent_article"); + + public static final ContainersRetrieveRequestExpandItem PARENT_CONTAINER = + new ContainersRetrieveRequestExpandItem(Value.PARENT_CONTAINER, "parent_container"); + + private final Value value; + + private final String string; + + ContainersRetrieveRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ContainersRetrieveRequestExpandItem + && this.string.equals(((ContainersRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PERMISSIONS: + return visitor.visitPermissions(); + case PARENT_ARTICLE: + return visitor.visitParentArticle(); + case PARENT_CONTAINER: + return visitor.visitParentContainer(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContainersRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "permissions": + return PERMISSIONS; + case "parent_article": + return PARENT_ARTICLE; + case "parent_container": + return PARENT_CONTAINER; + default: + return new ContainersRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_ARTICLE, + + PARENT_CONTAINER, + + PERMISSIONS, + + UNKNOWN + } + + public interface Visitor { + T visitParentArticle(); + + T visitParentContainer(); + + T visitPermissions(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/knowledgebase/types/CreateFieldMappingRequest.java new file mode 100644 index 000000000..35b568180 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/CreateFieldMappingRequest.java @@ -0,0 +1,620 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateFieldMappingRequest.Builder.class) +public final class CreateFieldMappingRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Optional remoteDataIterationCount; + + private final Optional targetFieldName; + + private final Optional targetFieldDescription; + + private final Optional organizationWideTargetField; + + private final Optional isIntegrationWide; + + private final List remoteFieldTraversalPath; + + private final String remoteMethod; + + private final String remoteUrlPath; + + private final String commonModelName; + + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + + private final Map additionalProperties; + + private CreateFieldMappingRequest( + Optional excludeRemoteFieldMetadata, + Optional remoteDataIterationCount, + Optional targetFieldName, + Optional targetFieldDescription, + Optional organizationWideTargetField, + Optional isIntegrationWide, + List remoteFieldTraversalPath, + String remoteMethod, + String remoteUrlPath, + String commonModelName, + Optional jmesPath, + Optional advancedMappingExpression, + Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.remoteDataIterationCount = remoteDataIterationCount; + this.targetFieldName = targetFieldName; + this.targetFieldDescription = targetFieldDescription; + this.organizationWideTargetField = organizationWideTargetField; + this.isIntegrationWide = isIntegrationWide; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.commonModelName = commonModelName; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; + this.additionalProperties = additionalProperties; + } + + /** + * @return 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. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + + /** + * @return The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided. + */ + @JsonProperty("target_field_name") + public Optional getTargetFieldName() { + return targetFieldName; + } + + /** + * @return The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided. + */ + @JsonProperty("target_field_description") + public Optional getTargetFieldDescription() { + return targetFieldDescription; + } + + /** + * @return The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional. + */ + @JsonProperty("organization_wide_target_field") + public Optional getOrganizationWideTargetField() { + return organizationWideTargetField; + } + + /** + * @return If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field. + */ + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public List getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public String getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public String getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return The name of the Common Model that the remote field corresponds to in a given category. + */ + @JsonProperty("common_model_name") + public String getCommonModelName() { + return commonModelName; + } + + /** + * @return DEPRECATED: Use 'advanced_mapping_expression' instead. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + /** + * @return A JSONata expression used to transform the remote field data. + */ + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateFieldMappingRequest && equalTo((CreateFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateFieldMappingRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && remoteDataIterationCount.equals(other.remoteDataIterationCount) + && targetFieldName.equals(other.targetFieldName) + && targetFieldDescription.equals(other.targetFieldDescription) + && organizationWideTargetField.equals(other.organizationWideTargetField) + && isIntegrationWide.equals(other.isIntegrationWide) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.excludeRemoteFieldMetadata, + this.remoteDataIterationCount, + this.targetFieldName, + this.targetFieldDescription, + this.organizationWideTargetField, + this.isIntegrationWide, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.commonModelName, + this.jmesPath, + this.advancedMappingExpression); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteMethodStage builder() { + return new Builder(); + } + + public interface RemoteMethodStage { + /** + *

            The method of the remote endpoint where the remote field is coming from.

            + */ + RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod); + + Builder from(CreateFieldMappingRequest other); + } + + public interface RemoteUrlPathStage { + /** + *

            The path of the remote endpoint where the remote field is coming from.

            + */ + CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath); + } + + public interface CommonModelNameStage { + /** + *

            The name of the Common Model that the remote field corresponds to in a given category.

            + */ + _FinalStage commonModelName(@NotNull String commonModelName); + } + + public interface _FinalStage { + CreateFieldMappingRequest build(); + + /** + *

            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.

            + */ + _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata); + + _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + + /** + *

            Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

            + */ + _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount); + + _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount); + + /** + *

            The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

            + */ + _FinalStage targetFieldName(Optional targetFieldName); + + _FinalStage targetFieldName(String targetFieldName); + + /** + *

            The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

            + */ + _FinalStage targetFieldDescription(Optional targetFieldDescription); + + _FinalStage targetFieldDescription(String targetFieldDescription); + + /** + *

            The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional.

            + */ + _FinalStage organizationWideTargetField(Optional organizationWideTargetField); + + _FinalStage organizationWideTargetField(String organizationWideTargetField); + + /** + *

            If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field.

            + */ + _FinalStage isIntegrationWide(Optional isIntegrationWide); + + _FinalStage isIntegrationWide(Boolean isIntegrationWide); + + /** + *

            The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

            + */ + _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath); + + _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); + + _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

            DEPRECATED: Use 'advanced_mapping_expression' instead.

            + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); + + /** + *

            A JSONata expression used to transform the remote field data.

            + */ + _FinalStage advancedMappingExpression(Optional advancedMappingExpression); + + _FinalStage advancedMappingExpression(String advancedMappingExpression); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements RemoteMethodStage, RemoteUrlPathStage, CommonModelNameStage, _FinalStage { + private String remoteMethod; + + private String remoteUrlPath; + + private String commonModelName; + + private Optional advancedMappingExpression = Optional.empty(); + + private Optional jmesPath = Optional.empty(); + + private List remoteFieldTraversalPath = new ArrayList<>(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional organizationWideTargetField = Optional.empty(); + + private Optional targetFieldDescription = Optional.empty(); + + private Optional targetFieldName = Optional.empty(); + + private Optional remoteDataIterationCount = Optional.empty(); + + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateFieldMappingRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + remoteDataIterationCount(other.getRemoteDataIterationCount()); + targetFieldName(other.getTargetFieldName()); + targetFieldDescription(other.getTargetFieldDescription()); + organizationWideTargetField(other.getOrganizationWideTargetField()); + isIntegrationWide(other.getIsIntegrationWide()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); + return this; + } + + /** + *

            The method of the remote endpoint where the remote field is coming from.

            + *

            The method of the remote endpoint where the remote field is coming from.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_method") + public RemoteUrlPathStage remoteMethod(@NotNull String remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + /** + *

            The path of the remote endpoint where the remote field is coming from.

            + *

            The path of the remote endpoint where the remote field is coming from.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remote_url_path") + public CommonModelNameStage remoteUrlPath(@NotNull String remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + /** + *

            The name of the Common Model that the remote field corresponds to in a given category.

            + *

            The name of the Common Model that the remote field corresponds to in a given category.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model_name") + public _FinalStage commonModelName(@NotNull String commonModelName) { + this.commonModelName = commonModelName; + return this; + } + + /** + *

            A JSONata expression used to transform the remote field data.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + + /** + *

            A JSONata expression used to transform the remote field data.

            + */ + @java.lang.Override + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public _FinalStage advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + /** + *

            DEPRECATED: Use 'advanced_mapping_expression' instead.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

            DEPRECATED: Use 'advanced_mapping_expression' instead.

            + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + /** + *

            The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath) { + if (remoteFieldTraversalPath != null) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + } + return this; + } + + /** + *

            The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.add(remoteFieldTraversalPath); + return this; + } + + /** + *

            The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

            + */ + @java.lang.Override + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath.clear(); + if (remoteFieldTraversalPath != null) { + this.remoteFieldTraversalPath.addAll(remoteFieldTraversalPath); + } + return this; + } + + /** + *

            If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + /** + *

            If true, creates an integration-wide field mapping that applies to all Linked Accounts for the integration. Requires organization_wide_target_field.

            + */ + @java.lang.Override + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public _FinalStage isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + /** + *

            The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage organizationWideTargetField(String organizationWideTargetField) { + this.organizationWideTargetField = Optional.ofNullable(organizationWideTargetField); + return this; + } + + /** + *

            The name or key of an existing Organization-wide target field to map to. When provided, target_field_name and target_field_description are optional.

            + */ + @java.lang.Override + @JsonSetter(value = "organization_wide_target_field", nulls = Nulls.SKIP) + public _FinalStage organizationWideTargetField(Optional organizationWideTargetField) { + this.organizationWideTargetField = organizationWideTargetField; + return this; + } + + /** + *

            The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage targetFieldDescription(String targetFieldDescription) { + this.targetFieldDescription = Optional.ofNullable(targetFieldDescription); + return this; + } + + /** + *

            The description of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

            + */ + @java.lang.Override + @JsonSetter(value = "target_field_description", nulls = Nulls.SKIP) + public _FinalStage targetFieldDescription(Optional targetFieldDescription) { + this.targetFieldDescription = targetFieldDescription; + return this; + } + + /** + *

            The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage targetFieldName(String targetFieldName) { + this.targetFieldName = Optional.ofNullable(targetFieldName); + return this; + } + + /** + *

            The name of the target field you want this remote field to map to. Required if organization_wide_target_field is not provided.

            + */ + @java.lang.Override + @JsonSetter(value = "target_field_name", nulls = Nulls.SKIP) + public _FinalStage targetFieldName(Optional targetFieldName) { + this.targetFieldName = targetFieldName; + return this; + } + + /** + *

            Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

            Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

            + */ + @java.lang.Override + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + @java.lang.Override + public CreateFieldMappingRequest build() { + return new CreateFieldMappingRequest( + excludeRemoteFieldMetadata, + remoteDataIterationCount, + targetFieldName, + targetFieldDescription, + organizationWideTargetField, + isIntegrationWide, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + commonModelName, + jmesPath, + advancedMappingExpression, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/CreateTargetFieldRequest.java b/src/main/java/com/merge/api/knowledgebase/types/CreateTargetFieldRequest.java new file mode 100644 index 000000000..fbfe4f22c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/CreateTargetFieldRequest.java @@ -0,0 +1,192 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateTargetFieldRequest.Builder.class) +public final class CreateTargetFieldRequest { + private final String name; + + private final Optional description; + + private final String commonModel; + + private final Map additionalProperties; + + private CreateTargetFieldRequest( + String name, Optional description, String commonModel, Map additionalProperties) { + this.name = name; + this.description = description; + this.commonModel = commonModel; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the target field. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The description of the target field. + */ + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + /** + * @return The name of the Common Model to associate the target field with. + */ + @JsonProperty("common_model") + public String getCommonModel() { + return commonModel; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateTargetFieldRequest && equalTo((CreateTargetFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateTargetFieldRequest other) { + return name.equals(other.name) + && description.equals(other.description) + && commonModel.equals(other.commonModel); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.commonModel); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

            The name of the target field.

            + */ + CommonModelStage name(@NotNull String name); + + Builder from(CreateTargetFieldRequest other); + } + + public interface CommonModelStage { + /** + *

            The name of the Common Model to associate the target field with.

            + */ + _FinalStage commonModel(@NotNull String commonModel); + } + + public interface _FinalStage { + CreateTargetFieldRequest build(); + + /** + *

            The description of the target field.

            + */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, CommonModelStage, _FinalStage { + private String name; + + private String commonModel; + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateTargetFieldRequest other) { + name(other.getName()); + description(other.getDescription()); + commonModel(other.getCommonModel()); + return this; + } + + /** + *

            The name of the target field.

            + *

            The name of the target field.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public CommonModelStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

            The name of the Common Model to associate the target field with.

            + *

            The name of the Common Model to associate the target field with.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("common_model") + public _FinalStage commonModel(@NotNull String commonModel) { + this.commonModel = commonModel; + return this; + } + + /** + *

            The description of the target field.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

            The description of the target field.

            + */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public CreateTargetFieldRequest build() { + return new CreateTargetFieldRequest(name, description, commonModel, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequest.java new file mode 100644 index 000000000..d453b2f1f --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequest.java @@ -0,0 +1,405 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DataPassthroughRequest.Builder.class) +public final class DataPassthroughRequest { + private final DataPassthroughRequestMethod method; + + private final String path; + + private final Optional baseUrlOverride; + + private final Optional data; + + private final Optional> multipartFormData; + + private final Optional> headers; + + private final Optional requestFormat; + + private final Optional normalizeResponse; + + private final Map additionalProperties; + + private DataPassthroughRequest( + DataPassthroughRequestMethod method, + String path, + Optional baseUrlOverride, + Optional data, + Optional> multipartFormData, + Optional> headers, + Optional requestFormat, + Optional normalizeResponse, + Map additionalProperties) { + this.method = method; + this.path = path; + this.baseUrlOverride = baseUrlOverride; + this.data = data; + this.multipartFormData = multipartFormData; + this.headers = headers; + this.requestFormat = requestFormat; + this.normalizeResponse = normalizeResponse; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public DataPassthroughRequestMethod getMethod() { + return method; + } + + /** + * @return The path of the request in the third party's platform. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return An optional override of the third party's base url for the request. + */ + @JsonProperty("base_url_override") + public Optional getBaseUrlOverride() { + return baseUrlOverride; + } + + /** + * @return The data with the request. You must include a request_format parameter matching the data's format + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + /** + * @return Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART. + */ + @JsonProperty("multipart_form_data") + public Optional> getMultipartFormData() { + return multipartFormData; + } + + /** + * @return 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. + */ + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @JsonProperty("request_format") + public Optional getRequestFormat() { + return requestFormat; + } + + /** + * @return 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. + */ + @JsonProperty("normalize_response") + public Optional getNormalizeResponse() { + return normalizeResponse; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequest && equalTo((DataPassthroughRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DataPassthroughRequest other) { + return method.equals(other.method) + && path.equals(other.path) + && baseUrlOverride.equals(other.baseUrlOverride) + && data.equals(other.data) + && multipartFormData.equals(other.multipartFormData) + && headers.equals(other.headers) + && requestFormat.equals(other.requestFormat) + && normalizeResponse.equals(other.normalizeResponse); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.baseUrlOverride, + this.data, + this.multipartFormData, + this.headers, + this.requestFormat, + this.normalizeResponse); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull DataPassthroughRequestMethod method); + + Builder from(DataPassthroughRequest other); + } + + public interface PathStage { + /** + *

            The path of the request in the third party's platform.

            + */ + _FinalStage path(@NotNull String path); + } + + public interface _FinalStage { + DataPassthroughRequest build(); + + /** + *

            An optional override of the third party's base url for the request.

            + */ + _FinalStage baseUrlOverride(Optional baseUrlOverride); + + _FinalStage baseUrlOverride(String baseUrlOverride); + + /** + *

            The data with the request. You must include a request_format parameter matching the data's format

            + */ + _FinalStage data(Optional data); + + _FinalStage data(String data); + + /** + *

            Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

            + */ + _FinalStage multipartFormData(Optional> multipartFormData); + + _FinalStage multipartFormData(List multipartFormData); + + /** + *

            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.

            + */ + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + + _FinalStage requestFormat(Optional requestFormat); + + _FinalStage requestFormat(DataPassthroughRequestRequestFormat requestFormat); + + /** + *

            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.

            + */ + _FinalStage normalizeResponse(Optional normalizeResponse); + + _FinalStage normalizeResponse(Boolean normalizeResponse); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, _FinalStage { + private DataPassthroughRequestMethod method; + + private String path; + + private Optional normalizeResponse = Optional.empty(); + + private Optional requestFormat = Optional.empty(); + + private Optional> headers = Optional.empty(); + + private Optional> multipartFormData = Optional.empty(); + + private Optional data = Optional.empty(); + + private Optional baseUrlOverride = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DataPassthroughRequest other) { + method(other.getMethod()); + path(other.getPath()); + baseUrlOverride(other.getBaseUrlOverride()); + data(other.getData()); + multipartFormData(other.getMultipartFormData()); + headers(other.getHeaders()); + requestFormat(other.getRequestFormat()); + normalizeResponse(other.getNormalizeResponse()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull DataPassthroughRequestMethod method) { + this.method = method; + return this; + } + + /** + *

            The path of the request in the third party's platform.

            + *

            The path of the request in the third party's platform.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage normalizeResponse(Boolean normalizeResponse) { + this.normalizeResponse = Optional.ofNullable(normalizeResponse); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "normalize_response", nulls = Nulls.SKIP) + public _FinalStage normalizeResponse(Optional normalizeResponse) { + this.normalizeResponse = normalizeResponse; + return this; + } + + @java.lang.Override + public _FinalStage requestFormat(DataPassthroughRequestRequestFormat requestFormat) { + this.requestFormat = Optional.ofNullable(requestFormat); + return this; + } + + @java.lang.Override + @JsonSetter(value = "request_format", nulls = Nulls.SKIP) + public _FinalStage requestFormat(Optional requestFormat) { + this.requestFormat = requestFormat; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + /** + *

            Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartFormData(List multipartFormData) { + this.multipartFormData = Optional.ofNullable(multipartFormData); + return this; + } + + /** + *

            Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

            + */ + @java.lang.Override + @JsonSetter(value = "multipart_form_data", nulls = Nulls.SKIP) + public _FinalStage multipartFormData(Optional> multipartFormData) { + this.multipartFormData = multipartFormData; + return this; + } + + /** + *

            The data with the request. You must include a request_format parameter matching the data's format

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(String data) { + this.data = Optional.ofNullable(data); + return this; + } + + /** + *

            The data with the request. You must include a request_format parameter matching the data's format

            + */ + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + /** + *

            An optional override of the third party's base url for the request.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseUrlOverride(String baseUrlOverride) { + this.baseUrlOverride = Optional.ofNullable(baseUrlOverride); + return this; + } + + /** + *

            An optional override of the third party's base url for the request.

            + */ + @java.lang.Override + @JsonSetter(value = "base_url_override", nulls = Nulls.SKIP) + public _FinalStage baseUrlOverride(Optional baseUrlOverride) { + this.baseUrlOverride = baseUrlOverride; + return this; + } + + @java.lang.Override + public DataPassthroughRequest build() { + return new DataPassthroughRequest( + method, + path, + baseUrlOverride, + data, + multipartFormData, + headers, + requestFormat, + normalizeResponse, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequestMethod.java b/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequestMethod.java new file mode 100644 index 000000000..b386dd719 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequestMethod.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DataPassthroughRequestMethod.Deserializer.class) +public final class DataPassthroughRequestMethod { + private final Object value; + + private final int type; + + private DataPassthroughRequestMethod(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((MethodEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequestMethod && equalTo((DataPassthroughRequestMethod) other); + } + + private boolean equalTo(DataPassthroughRequestMethod other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DataPassthroughRequestMethod of(MethodEnum value) { + return new DataPassthroughRequestMethod(value, 0); + } + + public static DataPassthroughRequestMethod of(String value) { + return new DataPassthroughRequestMethod(value, 1); + } + + public interface Visitor { + T visit(MethodEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DataPassthroughRequestMethod.class); + } + + @java.lang.Override + public DataPassthroughRequestMethod deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, MethodEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequestRequestFormat.java b/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequestRequestFormat.java new file mode 100644 index 000000000..b9ece0e84 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/DataPassthroughRequestRequestFormat.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = DataPassthroughRequestRequestFormat.Deserializer.class) +public final class DataPassthroughRequestRequestFormat { + private final Object value; + + private final int type; + + private DataPassthroughRequestRequestFormat(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((RequestFormatEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DataPassthroughRequestRequestFormat + && equalTo((DataPassthroughRequestRequestFormat) other); + } + + private boolean equalTo(DataPassthroughRequestRequestFormat other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static DataPassthroughRequestRequestFormat of(RequestFormatEnum value) { + return new DataPassthroughRequestRequestFormat(value, 0); + } + + public static DataPassthroughRequestRequestFormat of(String value) { + return new DataPassthroughRequestRequestFormat(value, 1); + } + + public interface Visitor { + T visit(RequestFormatEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(DataPassthroughRequestRequestFormat.class); + } + + @java.lang.Override + public DataPassthroughRequestRequestFormat deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, RequestFormatEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/DebugModeLog.java b/src/main/java/com/merge/api/knowledgebase/types/DebugModeLog.java new file mode 100644 index 000000000..a0916313e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/DebugModeLog.java @@ -0,0 +1,152 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModeLog.Builder.class) +public final class DebugModeLog { + private final String logId; + + private final String dashboardView; + + private final DebugModelLogSummary logSummary; + + private final Map additionalProperties; + + private DebugModeLog( + String logId, + String dashboardView, + DebugModelLogSummary logSummary, + Map additionalProperties) { + this.logId = logId; + this.dashboardView = dashboardView; + this.logSummary = logSummary; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("log_id") + public String getLogId() { + return logId; + } + + @JsonProperty("dashboard_view") + public String getDashboardView() { + return dashboardView; + } + + @JsonProperty("log_summary") + public DebugModelLogSummary getLogSummary() { + return logSummary; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModeLog && equalTo((DebugModeLog) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModeLog other) { + return logId.equals(other.logId) + && dashboardView.equals(other.dashboardView) + && logSummary.equals(other.logSummary); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.logId, this.dashboardView, this.logSummary); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LogIdStage builder() { + return new Builder(); + } + + public interface LogIdStage { + DashboardViewStage logId(@NotNull String logId); + + Builder from(DebugModeLog other); + } + + public interface DashboardViewStage { + LogSummaryStage dashboardView(@NotNull String dashboardView); + } + + public interface LogSummaryStage { + _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary); + } + + public interface _FinalStage { + DebugModeLog build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LogIdStage, DashboardViewStage, LogSummaryStage, _FinalStage { + private String logId; + + private String dashboardView; + + private DebugModelLogSummary logSummary; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModeLog other) { + logId(other.getLogId()); + dashboardView(other.getDashboardView()); + logSummary(other.getLogSummary()); + return this; + } + + @java.lang.Override + @JsonSetter("log_id") + public DashboardViewStage logId(@NotNull String logId) { + this.logId = logId; + return this; + } + + @java.lang.Override + @JsonSetter("dashboard_view") + public LogSummaryStage dashboardView(@NotNull String dashboardView) { + this.dashboardView = dashboardView; + return this; + } + + @java.lang.Override + @JsonSetter("log_summary") + public _FinalStage logSummary(@NotNull DebugModelLogSummary logSummary) { + this.logSummary = logSummary; + return this; + } + + @java.lang.Override + public DebugModeLog build() { + return new DebugModeLog(logId, dashboardView, logSummary, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/DebugModelLogSummary.java b/src/main/java/com/merge/api/knowledgebase/types/DebugModelLogSummary.java new file mode 100644 index 000000000..59a8b075d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/DebugModelLogSummary.java @@ -0,0 +1,146 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = DebugModelLogSummary.Builder.class) +public final class DebugModelLogSummary { + private final String url; + + private final String method; + + private final int statusCode; + + private final Map additionalProperties; + + private DebugModelLogSummary(String url, String method, int statusCode, Map additionalProperties) { + this.url = url; + this.method = method; + this.statusCode = statusCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("url") + public String getUrl() { + return url; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("status_code") + public int getStatusCode() { + return statusCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof DebugModelLogSummary && equalTo((DebugModelLogSummary) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(DebugModelLogSummary other) { + return url.equals(other.url) && method.equals(other.method) && statusCode == other.statusCode; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.url, this.method, this.statusCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static UrlStage builder() { + return new Builder(); + } + + public interface UrlStage { + MethodStage url(@NotNull String url); + + Builder from(DebugModelLogSummary other); + } + + public interface MethodStage { + StatusCodeStage method(@NotNull String method); + } + + public interface StatusCodeStage { + _FinalStage statusCode(int statusCode); + } + + public interface _FinalStage { + DebugModelLogSummary build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements UrlStage, MethodStage, StatusCodeStage, _FinalStage { + private String url; + + private String method; + + private int statusCode; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(DebugModelLogSummary other) { + url(other.getUrl()); + method(other.getMethod()); + statusCode(other.getStatusCode()); + return this; + } + + @java.lang.Override + @JsonSetter("url") + public MethodStage url(@NotNull String url) { + this.url = url; + return this; + } + + @java.lang.Override + @JsonSetter("method") + public StatusCodeStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("status_code") + public _FinalStage statusCode(int statusCode) { + this.statusCode = statusCode; + return this; + } + + @java.lang.Override + public DebugModelLogSummary build() { + return new DebugModelLogSummary(url, method, statusCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/EnabledActionsEnum.java b/src/main/java/com/merge/api/knowledgebase/types/EnabledActionsEnum.java new file mode 100644 index 000000000..d46312d74 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/EnabledActionsEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EnabledActionsEnum { + public static final EnabledActionsEnum READ = new EnabledActionsEnum(Value.READ, "READ"); + + public static final EnabledActionsEnum WRITE = new EnabledActionsEnum(Value.WRITE, "WRITE"); + + private final Value value; + + private final String string; + + EnabledActionsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EnabledActionsEnum && this.string.equals(((EnabledActionsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case READ: + return visitor.visitRead(); + case WRITE: + return visitor.visitWrite(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EnabledActionsEnum valueOf(String value) { + switch (value) { + case "READ": + return READ; + case "WRITE": + return WRITE; + default: + return new EnabledActionsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + READ, + + WRITE, + + UNKNOWN + } + + public interface Visitor { + T visitRead(); + + T visitWrite(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/EncodingEnum.java b/src/main/java/com/merge/api/knowledgebase/types/EncodingEnum.java new file mode 100644 index 000000000..99749dc0d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/EncodingEnum.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EncodingEnum { + public static final EncodingEnum RAW = new EncodingEnum(Value.RAW, "RAW"); + + public static final EncodingEnum GZIP_BASE_64 = new EncodingEnum(Value.GZIP_BASE_64, "GZIP_BASE64"); + + public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + + private final Value value; + + private final String string; + + EncodingEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof EncodingEnum && this.string.equals(((EncodingEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RAW: + return visitor.visitRaw(); + case GZIP_BASE_64: + return visitor.visitGzipBase64(); + case BASE_64: + return visitor.visitBase64(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EncodingEnum valueOf(String value) { + switch (value) { + case "RAW": + return RAW; + case "GZIP_BASE64": + return GZIP_BASE_64; + case "BASE64": + return BASE_64; + default: + return new EncodingEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + RAW, + + BASE_64, + + GZIP_BASE_64, + + UNKNOWN + } + + public interface Visitor { + T visitRaw(); + + T visitBase64(); + + T visitGzipBase64(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequest.java new file mode 100644 index 000000000..6f90c7b41 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequest.java @@ -0,0 +1,815 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EndUserDetailsRequest.Builder.class) +public final class EndUserDetailsRequest { + private final String endUserEmailAddress; + + private final String endUserOrganizationName; + + private final String endUserOriginId; + + private final List categories; + + private final Optional integration; + + private final Optional linkExpiryMins; + + private final Optional shouldCreateMagicLinkUrl; + + private final Optional hideAdminMagicLink; + + private final Optional> commonModels; + + private final Optional>>> + categoryCommonModelScopes; + + private final Optional language; + + private final Optional areSyncsDisabled; + + private final Optional> integrationSpecificConfig; + + private final Optional completedAccountInitialScreen; + + private final Optional linkedDestinationId; + + private final Optional credentialId; + + private final Map additionalProperties; + + private EndUserDetailsRequest( + String endUserEmailAddress, + String endUserOrganizationName, + String endUserOriginId, + List categories, + Optional integration, + Optional linkExpiryMins, + Optional shouldCreateMagicLinkUrl, + Optional hideAdminMagicLink, + Optional> commonModels, + Optional>>> + categoryCommonModelScopes, + Optional language, + Optional areSyncsDisabled, + Optional> integrationSpecificConfig, + Optional completedAccountInitialScreen, + Optional linkedDestinationId, + Optional credentialId, + Map additionalProperties) { + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.categories = categories; + this.integration = integration; + this.linkExpiryMins = linkExpiryMins; + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + this.hideAdminMagicLink = hideAdminMagicLink; + this.commonModels = commonModels; + this.categoryCommonModelScopes = categoryCommonModelScopes; + this.language = language; + this.areSyncsDisabled = areSyncsDisabled; + this.integrationSpecificConfig = integrationSpecificConfig; + this.completedAccountInitialScreen = completedAccountInitialScreen; + this.linkedDestinationId = linkedDestinationId; + this.credentialId = credentialId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + */ + @JsonProperty("end_user_email_address") + public String getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return Your end user's organization. + */ + @JsonProperty("end_user_organization_name") + public String getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return 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. + */ + @JsonProperty("end_user_origin_id") + public String getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return The integration categories to show in Merge Link. + */ + @JsonProperty("categories") + public List getCategories() { + return categories; + } + + /** + * @return 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/. + */ + @JsonProperty("integration") + public Optional getIntegration() { + return integration; + } + + /** + * @return 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. + */ + @JsonProperty("link_expiry_mins") + public Optional getLinkExpiryMins() { + return linkExpiryMins; + } + + /** + * @return 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. + */ + @JsonProperty("should_create_magic_link_url") + public Optional getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + /** + * @return 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. + */ + @JsonProperty("hide_admin_magic_link") + public Optional getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + /** + * @return 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. + */ + @JsonProperty("common_models") + public Optional> getCommonModels() { + return commonModels; + } + + /** + * @return 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. + */ + @JsonProperty("category_common_model_scopes") + public Optional>>> + getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + /** + * @return The following subset of IETF language tags can be used to configure localization. + */ + @JsonProperty("language") + public Optional getLanguage() { + return language; + } + + /** + * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. + */ + @JsonProperty("are_syncs_disabled") + public Optional getAreSyncsDisabled() { + return areSyncsDisabled; + } + + /** + * @return A JSON object containing integration-specific configuration options. + */ + @JsonProperty("integration_specific_config") + public Optional> getIntegrationSpecificConfig() { + return integrationSpecificConfig; + } + + /** + * @return When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account. + */ + @JsonProperty("completed_account_initial_screen") + public Optional getCompletedAccountInitialScreen() { + return completedAccountInitialScreen; + } + + /** + * @return The UUID of the linked destination that you want this Linked Account to be tied to. + */ + @JsonProperty("linked_destination_id") + public Optional getLinkedDestinationId() { + return linkedDestinationId; + } + + /** + * @return The id of the credential that you want this Linked Account to be tied to. + */ + @JsonProperty("credential_id") + public Optional getCredentialId() { + return credentialId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequest && equalTo((EndUserDetailsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EndUserDetailsRequest other) { + return endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && categories.equals(other.categories) + && integration.equals(other.integration) + && linkExpiryMins.equals(other.linkExpiryMins) + && shouldCreateMagicLinkUrl.equals(other.shouldCreateMagicLinkUrl) + && hideAdminMagicLink.equals(other.hideAdminMagicLink) + && commonModels.equals(other.commonModels) + && categoryCommonModelScopes.equals(other.categoryCommonModelScopes) + && language.equals(other.language) + && areSyncsDisabled.equals(other.areSyncsDisabled) + && integrationSpecificConfig.equals(other.integrationSpecificConfig) + && completedAccountInitialScreen.equals(other.completedAccountInitialScreen) + && linkedDestinationId.equals(other.linkedDestinationId) + && credentialId.equals(other.credentialId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.categories, + this.integration, + this.linkExpiryMins, + this.shouldCreateMagicLinkUrl, + this.hideAdminMagicLink, + this.commonModels, + this.categoryCommonModelScopes, + this.language, + this.areSyncsDisabled, + this.integrationSpecificConfig, + this.completedAccountInitialScreen, + this.linkedDestinationId, + this.credentialId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EndUserEmailAddressStage builder() { + return new Builder(); + } + + public interface EndUserEmailAddressStage { + /** + *

            Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

            + */ + EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress); + + Builder from(EndUserDetailsRequest other); + } + + public interface EndUserOrganizationNameStage { + /** + *

            Your end user's organization.

            + */ + EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName); + } + + public interface EndUserOriginIdStage { + /** + *

            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.

            + */ + _FinalStage endUserOriginId(@NotNull String endUserOriginId); + } + + public interface _FinalStage { + EndUserDetailsRequest build(); + + /** + *

            The integration categories to show in Merge Link.

            + */ + _FinalStage categories(List categories); + + _FinalStage addCategories(CategoriesEnum categories); + + _FinalStage addAllCategories(List categories); + + /** + *

            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/.

            + */ + _FinalStage integration(Optional integration); + + _FinalStage integration(String integration); + + /** + *

            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.

            + */ + _FinalStage linkExpiryMins(Optional linkExpiryMins); + + _FinalStage linkExpiryMins(Integer linkExpiryMins); + + /** + *

            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.

            + */ + _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl); + + _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + + /** + *

            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.

            + */ + _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink); + + _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + + /** + *

            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.

            + */ + _FinalStage commonModels(Optional> commonModels); + + _FinalStage commonModels(List commonModels); + + /** + *

            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.

            + */ + _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes); + + _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes); + + /** + *

            The following subset of IETF language tags can be used to configure localization.

            + */ + _FinalStage language(Optional language); + + _FinalStage language(EndUserDetailsRequestLanguage language); + + /** + *

            The boolean that indicates whether initial, periodic, and force syncs will be disabled.

            + */ + _FinalStage areSyncsDisabled(Optional areSyncsDisabled); + + _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + + /** + *

            A JSON object containing integration-specific configuration options.

            + */ + _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + /** + *

            When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

            + */ + _FinalStage completedAccountInitialScreen( + Optional completedAccountInitialScreen); + + _FinalStage completedAccountInitialScreen( + EndUserDetailsRequestCompletedAccountInitialScreen completedAccountInitialScreen); + + /** + *

            The UUID of the linked destination that you want this Linked Account to be tied to.

            + */ + _FinalStage linkedDestinationId(Optional linkedDestinationId); + + _FinalStage linkedDestinationId(String linkedDestinationId); + + /** + *

            The id of the credential that you want this Linked Account to be tied to.

            + */ + _FinalStage credentialId(Optional credentialId); + + _FinalStage credentialId(String credentialId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements EndUserEmailAddressStage, EndUserOrganizationNameStage, EndUserOriginIdStage, _FinalStage { + private String endUserEmailAddress; + + private String endUserOrganizationName; + + private String endUserOriginId; + + private Optional credentialId = Optional.empty(); + + private Optional linkedDestinationId = Optional.empty(); + + private Optional completedAccountInitialScreen = + Optional.empty(); + + private Optional> integrationSpecificConfig = Optional.empty(); + + private Optional areSyncsDisabled = Optional.empty(); + + private Optional language = Optional.empty(); + + private Optional>>> + categoryCommonModelScopes = Optional.empty(); + + private Optional> commonModels = Optional.empty(); + + private Optional hideAdminMagicLink = Optional.empty(); + + private Optional shouldCreateMagicLinkUrl = Optional.empty(); + + private Optional linkExpiryMins = Optional.empty(); + + private Optional integration = Optional.empty(); + + private List categories = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EndUserDetailsRequest other) { + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + categories(other.getCategories()); + integration(other.getIntegration()); + linkExpiryMins(other.getLinkExpiryMins()); + shouldCreateMagicLinkUrl(other.getShouldCreateMagicLinkUrl()); + hideAdminMagicLink(other.getHideAdminMagicLink()); + commonModels(other.getCommonModels()); + categoryCommonModelScopes(other.getCategoryCommonModelScopes()); + language(other.getLanguage()); + areSyncsDisabled(other.getAreSyncsDisabled()); + integrationSpecificConfig(other.getIntegrationSpecificConfig()); + completedAccountInitialScreen(other.getCompletedAccountInitialScreen()); + linkedDestinationId(other.getLinkedDestinationId()); + credentialId(other.getCredentialId()); + return this; + } + + /** + *

            Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

            + *

            Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_email_address") + public EndUserOrganizationNameStage endUserEmailAddress(@NotNull String endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + /** + *

            Your end user's organization.

            + *

            Your end user's organization.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_organization_name") + public EndUserOriginIdStage endUserOrganizationName(@NotNull String endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + /** + *

            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.

            + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("end_user_origin_id") + public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + /** + *

            The id of the credential that you want this Linked Account to be tied to.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage credentialId(String credentialId) { + this.credentialId = Optional.ofNullable(credentialId); + return this; + } + + /** + *

            The id of the credential that you want this Linked Account to be tied to.

            + */ + @java.lang.Override + @JsonSetter(value = "credential_id", nulls = Nulls.SKIP) + public _FinalStage credentialId(Optional credentialId) { + this.credentialId = credentialId; + return this; + } + + /** + *

            The UUID of the linked destination that you want this Linked Account to be tied to.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkedDestinationId(String linkedDestinationId) { + this.linkedDestinationId = Optional.ofNullable(linkedDestinationId); + return this; + } + + /** + *

            The UUID of the linked destination that you want this Linked Account to be tied to.

            + */ + @java.lang.Override + @JsonSetter(value = "linked_destination_id", nulls = Nulls.SKIP) + public _FinalStage linkedDestinationId(Optional linkedDestinationId) { + this.linkedDestinationId = linkedDestinationId; + return this; + } + + /** + *

            When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage completedAccountInitialScreen( + EndUserDetailsRequestCompletedAccountInitialScreen completedAccountInitialScreen) { + this.completedAccountInitialScreen = Optional.ofNullable(completedAccountInitialScreen); + return this; + } + + /** + *

            When creating a Link token, you can specifiy the initial screen of Linking Flow for a completed Linked Account.

            + */ + @java.lang.Override + @JsonSetter(value = "completed_account_initial_screen", nulls = Nulls.SKIP) + public _FinalStage completedAccountInitialScreen( + Optional completedAccountInitialScreen) { + this.completedAccountInitialScreen = completedAccountInitialScreen; + return this; + } + + /** + *

            A JSON object containing integration-specific configuration options.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integrationSpecificConfig(Map integrationSpecificConfig) { + this.integrationSpecificConfig = Optional.ofNullable(integrationSpecificConfig); + return this; + } + + /** + *

            A JSON object containing integration-specific configuration options.

            + */ + @java.lang.Override + @JsonSetter(value = "integration_specific_config", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig) { + this.integrationSpecificConfig = integrationSpecificConfig; + return this; + } + + /** + *

            The boolean that indicates whether initial, periodic, and force syncs will be disabled.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage areSyncsDisabled(Boolean areSyncsDisabled) { + this.areSyncsDisabled = Optional.ofNullable(areSyncsDisabled); + return this; + } + + /** + *

            The boolean that indicates whether initial, periodic, and force syncs will be disabled.

            + */ + @java.lang.Override + @JsonSetter(value = "are_syncs_disabled", nulls = Nulls.SKIP) + public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { + this.areSyncsDisabled = areSyncsDisabled; + return this; + } + + /** + *

            The following subset of IETF language tags can be used to configure localization.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(EndUserDetailsRequestLanguage language) { + this.language = Optional.ofNullable(language); + return this; + } + + /** + *

            The following subset of IETF language tags can be used to configure localization.

            + */ + @java.lang.Override + @JsonSetter(value = "language", nulls = Nulls.SKIP) + public _FinalStage language(Optional language) { + this.language = language; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage categoryCommonModelScopes( + Map>> categoryCommonModelScopes) { + this.categoryCommonModelScopes = Optional.ofNullable(categoryCommonModelScopes); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "category_common_model_scopes", nulls = Nulls.SKIP) + public _FinalStage categoryCommonModelScopes( + Optional>>> + categoryCommonModelScopes) { + this.categoryCommonModelScopes = categoryCommonModelScopes; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage commonModels(List commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public _FinalStage commonModels(Optional> commonModels) { + this.commonModels = commonModels; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink) { + this.hideAdminMagicLink = Optional.ofNullable(hideAdminMagicLink); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "hide_admin_magic_link", nulls = Nulls.SKIP) + public _FinalStage hideAdminMagicLink(Optional hideAdminMagicLink) { + this.hideAdminMagicLink = hideAdminMagicLink; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = Optional.ofNullable(shouldCreateMagicLinkUrl); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "should_create_magic_link_url", nulls = Nulls.SKIP) + public _FinalStage shouldCreateMagicLinkUrl(Optional shouldCreateMagicLinkUrl) { + this.shouldCreateMagicLinkUrl = shouldCreateMagicLinkUrl; + return this; + } + + /** + *

            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.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage linkExpiryMins(Integer linkExpiryMins) { + this.linkExpiryMins = Optional.ofNullable(linkExpiryMins); + return this; + } + + /** + *

            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.

            + */ + @java.lang.Override + @JsonSetter(value = "link_expiry_mins", nulls = Nulls.SKIP) + public _FinalStage linkExpiryMins(Optional linkExpiryMins) { + this.linkExpiryMins = linkExpiryMins; + return this; + } + + /** + *

            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/.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage integration(String integration) { + this.integration = Optional.ofNullable(integration); + return this; + } + + /** + *

            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/.

            + */ + @java.lang.Override + @JsonSetter(value = "integration", nulls = Nulls.SKIP) + public _FinalStage integration(Optional integration) { + this.integration = integration; + return this; + } + + /** + *

            The integration categories to show in Merge Link.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllCategories(List categories) { + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + /** + *

            The integration categories to show in Merge Link.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addCategories(CategoriesEnum categories) { + this.categories.add(categories); + return this; + } + + /** + *

            The integration categories to show in Merge Link.

            + */ + @java.lang.Override + @JsonSetter(value = "categories", nulls = Nulls.SKIP) + public _FinalStage categories(List categories) { + this.categories.clear(); + if (categories != null) { + this.categories.addAll(categories); + } + return this; + } + + @java.lang.Override + public EndUserDetailsRequest build() { + return new EndUserDetailsRequest( + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + categories, + integration, + linkExpiryMins, + shouldCreateMagicLinkUrl, + hideAdminMagicLink, + commonModels, + categoryCommonModelScopes, + language, + areSyncsDisabled, + integrationSpecificConfig, + completedAccountInitialScreen, + linkedDestinationId, + credentialId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequestCompletedAccountInitialScreen.java b/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequestCompletedAccountInitialScreen.java new file mode 100644 index 000000000..797f68501 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequestCompletedAccountInitialScreen.java @@ -0,0 +1,98 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EndUserDetailsRequestCompletedAccountInitialScreen.Deserializer.class) +public final class EndUserDetailsRequestCompletedAccountInitialScreen { + private final Object value; + + private final int type; + + private EndUserDetailsRequestCompletedAccountInitialScreen(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit2((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequestCompletedAccountInitialScreen + && equalTo((EndUserDetailsRequestCompletedAccountInitialScreen) other); + } + + private boolean equalTo(EndUserDetailsRequestCompletedAccountInitialScreen other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EndUserDetailsRequestCompletedAccountInitialScreen of(String value) { + return new EndUserDetailsRequestCompletedAccountInitialScreen(value, 0); + } + + public static EndUserDetailsRequestCompletedAccountInitialScreen of2(String value) { + return new EndUserDetailsRequestCompletedAccountInitialScreen(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit2(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EndUserDetailsRequestCompletedAccountInitialScreen.class); + } + + @java.lang.Override + public EndUserDetailsRequestCompletedAccountInitialScreen deserialize( + JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, new TypeReference() {})); + } catch (RuntimeException e) { + } + try { + return of2(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequestLanguage.java b/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequestLanguage.java new file mode 100644 index 000000000..8e5fc46a8 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/EndUserDetailsRequestLanguage.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = EndUserDetailsRequestLanguage.Deserializer.class) +public final class EndUserDetailsRequestLanguage { + private final Object value; + + private final int type; + + private EndUserDetailsRequestLanguage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LanguageEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EndUserDetailsRequestLanguage && equalTo((EndUserDetailsRequestLanguage) other); + } + + private boolean equalTo(EndUserDetailsRequestLanguage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static EndUserDetailsRequestLanguage of(LanguageEnum value) { + return new EndUserDetailsRequestLanguage(value, 0); + } + + public static EndUserDetailsRequestLanguage of(String value) { + return new EndUserDetailsRequestLanguage(value, 1); + } + + public interface Visitor { + T visit(LanguageEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(EndUserDetailsRequestLanguage.class); + } + + @java.lang.Override + public EndUserDetailsRequestLanguage deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LanguageEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ErrorValidationProblem.java b/src/main/java/com/merge/api/knowledgebase/types/ErrorValidationProblem.java new file mode 100644 index 000000000..59c4c7bd9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ErrorValidationProblem.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ErrorValidationProblem.Builder.class) +public final class ErrorValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Optional blockMergeLink; + + private final Optional rawError; + + private final Optional errorCode; + + private final Map additionalProperties; + + private ErrorValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Optional blockMergeLink, + Optional rawError, + Optional errorCode, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.blockMergeLink = blockMergeLink; + this.rawError = rawError; + this.errorCode = errorCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @JsonProperty("block_merge_link") + public Optional getBlockMergeLink() { + return blockMergeLink; + } + + @JsonProperty("raw_error") + public Optional getRawError() { + return rawError; + } + + @JsonProperty("error_code") + public Optional getErrorCode() { + return errorCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ErrorValidationProblem && equalTo((ErrorValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ErrorValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType) + && blockMergeLink.equals(other.blockMergeLink) + && rawError.equals(other.rawError) + && errorCode.equals(other.errorCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.source, + this.title, + this.detail, + this.problemType, + this.blockMergeLink, + this.rawError, + this.errorCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(ErrorValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + ErrorValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + + _FinalStage blockMergeLink(Optional blockMergeLink); + + _FinalStage blockMergeLink(Boolean blockMergeLink); + + _FinalStage rawError(Optional rawError); + + _FinalStage rawError(String rawError); + + _FinalStage errorCode(Optional errorCode); + + _FinalStage errorCode(Integer errorCode); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional errorCode = Optional.empty(); + + private Optional rawError = Optional.empty(); + + private Optional blockMergeLink = Optional.empty(); + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ErrorValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + blockMergeLink(other.getBlockMergeLink()); + rawError(other.getRawError()); + errorCode(other.getErrorCode()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage errorCode(Integer errorCode) { + this.errorCode = Optional.ofNullable(errorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_code", nulls = Nulls.SKIP) + public _FinalStage errorCode(Optional errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + public _FinalStage rawError(String rawError) { + this.rawError = Optional.ofNullable(rawError); + return this; + } + + @java.lang.Override + @JsonSetter(value = "raw_error", nulls = Nulls.SKIP) + public _FinalStage rawError(Optional rawError) { + this.rawError = rawError; + return this; + } + + @java.lang.Override + public _FinalStage blockMergeLink(Boolean blockMergeLink) { + this.blockMergeLink = Optional.ofNullable(blockMergeLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "block_merge_link", nulls = Nulls.SKIP) + public _FinalStage blockMergeLink(Optional blockMergeLink) { + this.blockMergeLink = blockMergeLink; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public ErrorValidationProblem build() { + return new ErrorValidationProblem( + source, title, detail, problemType, blockMergeLink, rawError, errorCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/EventTypeEnum.java b/src/main/java/com/merge/api/knowledgebase/types/EventTypeEnum.java new file mode 100644 index 000000000..b243ac389 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/EventTypeEnum.java @@ -0,0 +1,530 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EventTypeEnum { + public static final EventTypeEnum DISABLED_MERGE_WEBHOOK = + new EventTypeEnum(Value.DISABLED_MERGE_WEBHOOK, "DISABLED_MERGE_WEBHOOK"); + + public static final EventTypeEnum CHANGED_PERSONAL_INFORMATION = + new EventTypeEnum(Value.CHANGED_PERSONAL_INFORMATION, "CHANGED_PERSONAL_INFORMATION"); + + public static final EventTypeEnum CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = new EventTypeEnum( + Value.CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, "CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"); + + public static final EventTypeEnum DELETED_REMOTE_PRODUCTION_API_KEY = + new EventTypeEnum(Value.DELETED_REMOTE_PRODUCTION_API_KEY, "DELETED_REMOTE_PRODUCTION_API_KEY"); + + public static final EventTypeEnum DELETED_LINKED_ACCOUNT_FIELD_MAPPING = + new EventTypeEnum(Value.DELETED_LINKED_ACCOUNT_FIELD_MAPPING, "DELETED_LINKED_ACCOUNT_FIELD_MAPPING"); + + public static final EventTypeEnum ENABLED_MERGE_WEBHOOK = + new EventTypeEnum(Value.ENABLED_MERGE_WEBHOOK, "ENABLED_MERGE_WEBHOOK"); + + public static final EventTypeEnum DISABLED_INTEGRATION = + new EventTypeEnum(Value.DISABLED_INTEGRATION, "DISABLED_INTEGRATION"); + + public static final EventTypeEnum DELETED_DESTINATION = + new EventTypeEnum(Value.DELETED_DESTINATION, "DELETED_DESTINATION"); + + public static final EventTypeEnum CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = new EventTypeEnum( + Value.CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, "CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"); + + public static final EventTypeEnum DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = new EventTypeEnum( + Value.DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE, "DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE"); + + public static final EventTypeEnum CREATED_TEST_API_KEY = + new EventTypeEnum(Value.CREATED_TEST_API_KEY, "CREATED_TEST_API_KEY"); + + public static final EventTypeEnum REGENERATED_PRODUCTION_API_KEY = + new EventTypeEnum(Value.REGENERATED_PRODUCTION_API_KEY, "REGENERATED_PRODUCTION_API_KEY"); + + public static final EventTypeEnum END_USER_CREDENTIALS_ACCESSED = + new EventTypeEnum(Value.END_USER_CREDENTIALS_ACCESSED, "END_USER_CREDENTIALS_ACCESSED"); + + public static final EventTypeEnum DISABLED_CATEGORY = + new EventTypeEnum(Value.DISABLED_CATEGORY, "DISABLED_CATEGORY"); + + public static final EventTypeEnum DELETED_INTEGRATION_WIDE_FIELD_MAPPING = + new EventTypeEnum(Value.DELETED_INTEGRATION_WIDE_FIELD_MAPPING, "DELETED_INTEGRATION_WIDE_FIELD_MAPPING"); + + public static final EventTypeEnum TWO_FACTOR_AUTH_ENABLED = + new EventTypeEnum(Value.TWO_FACTOR_AUTH_ENABLED, "TWO_FACTOR_AUTH_ENABLED"); + + public static final EventTypeEnum CHANGED_DESTINATION = + new EventTypeEnum(Value.CHANGED_DESTINATION, "CHANGED_DESTINATION"); + + public static final EventTypeEnum DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION = new EventTypeEnum( + Value.DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, "DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"); + + public static final EventTypeEnum TWO_FACTOR_AUTH_DISABLED = + new EventTypeEnum(Value.TWO_FACTOR_AUTH_DISABLED, "TWO_FACTOR_AUTH_DISABLED"); + + public static final EventTypeEnum ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT = new EventTypeEnum( + Value.ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, "ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"); + + public static final EventTypeEnum FORCED_LINKED_ACCOUNT_RESYNC = + new EventTypeEnum(Value.FORCED_LINKED_ACCOUNT_RESYNC, "FORCED_LINKED_ACCOUNT_RESYNC"); + + public static final EventTypeEnum CHANGED_ORGANIZATION_SETTINGS = + new EventTypeEnum(Value.CHANGED_ORGANIZATION_SETTINGS, "CHANGED_ORGANIZATION_SETTINGS"); + + public static final EventTypeEnum ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION = new EventTypeEnum( + Value.ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION, "ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION"); + + public static final EventTypeEnum RESET_PASSWORD = new EventTypeEnum(Value.RESET_PASSWORD, "RESET_PASSWORD"); + + public static final EventTypeEnum INVITED_USER = new EventTypeEnum(Value.INVITED_USER, "INVITED_USER"); + + public static final EventTypeEnum MERGE_WEBHOOK_TARGET_CHANGED = + new EventTypeEnum(Value.MERGE_WEBHOOK_TARGET_CHANGED, "MERGE_WEBHOOK_TARGET_CHANGED"); + + public static final EventTypeEnum MUTED_ISSUE = new EventTypeEnum(Value.MUTED_ISSUE, "MUTED_ISSUE"); + + public static final EventTypeEnum GENERATED_MAGIC_LINK = + new EventTypeEnum(Value.GENERATED_MAGIC_LINK, "GENERATED_MAGIC_LINK"); + + public static final EventTypeEnum CREATED_REMOTE_PRODUCTION_API_KEY = + new EventTypeEnum(Value.CREATED_REMOTE_PRODUCTION_API_KEY, "CREATED_REMOTE_PRODUCTION_API_KEY"); + + public static final EventTypeEnum DELETED_LINKED_ACCOUNT = + new EventTypeEnum(Value.DELETED_LINKED_ACCOUNT, "DELETED_LINKED_ACCOUNT"); + + public static final EventTypeEnum CHANGED_SCOPES = new EventTypeEnum(Value.CHANGED_SCOPES, "CHANGED_SCOPES"); + + public static final EventTypeEnum CHANGED_INTEGRATION_WIDE_FIELD_MAPPING = + new EventTypeEnum(Value.CHANGED_INTEGRATION_WIDE_FIELD_MAPPING, "CHANGED_INTEGRATION_WIDE_FIELD_MAPPING"); + + public static final EventTypeEnum DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT = new EventTypeEnum( + Value.DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT, "DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT"); + + public static final EventTypeEnum REGENERATED_WEBHOOK_SIGNATURE = + new EventTypeEnum(Value.REGENERATED_WEBHOOK_SIGNATURE, "REGENERATED_WEBHOOK_SIGNATURE"); + + public static final EventTypeEnum CHANGED_PASSWORD = new EventTypeEnum(Value.CHANGED_PASSWORD, "CHANGED_PASSWORD"); + + public static final EventTypeEnum DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT = new EventTypeEnum( + Value.DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT, "DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT"); + + public static final EventTypeEnum CREATED_INTEGRATION_WIDE_FIELD_MAPPING = + new EventTypeEnum(Value.CREATED_INTEGRATION_WIDE_FIELD_MAPPING, "CREATED_INTEGRATION_WIDE_FIELD_MAPPING"); + + public static final EventTypeEnum CREATED_LINKED_ACCOUNT_FIELD_MAPPING = + new EventTypeEnum(Value.CREATED_LINKED_ACCOUNT_FIELD_MAPPING, "CREATED_LINKED_ACCOUNT_FIELD_MAPPING"); + + public static final EventTypeEnum ENABLED_INTEGRATION = + new EventTypeEnum(Value.ENABLED_INTEGRATION, "ENABLED_INTEGRATION"); + + public static final EventTypeEnum DELETED_TEST_API_KEY = + new EventTypeEnum(Value.DELETED_TEST_API_KEY, "DELETED_TEST_API_KEY"); + + public static final EventTypeEnum ENABLED_CATEGORY = new EventTypeEnum(Value.ENABLED_CATEGORY, "ENABLED_CATEGORY"); + + public static final EventTypeEnum CREATED_DESTINATION = + new EventTypeEnum(Value.CREATED_DESTINATION, "CREATED_DESTINATION"); + + public static final EventTypeEnum CHANGED_LINKED_ACCOUNT_FIELD_MAPPING = + new EventTypeEnum(Value.CHANGED_LINKED_ACCOUNT_FIELD_MAPPING, "CHANGED_LINKED_ACCOUNT_FIELD_MAPPING"); + + private final Value value; + + private final String string; + + EventTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof EventTypeEnum && this.string.equals(((EventTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISABLED_MERGE_WEBHOOK: + return visitor.visitDisabledMergeWebhook(); + case CHANGED_PERSONAL_INFORMATION: + return visitor.visitChangedPersonalInformation(); + case CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return visitor.visitCreatedLinkedAccountCommonModelOverride(); + case DELETED_REMOTE_PRODUCTION_API_KEY: + return visitor.visitDeletedRemoteProductionApiKey(); + case DELETED_LINKED_ACCOUNT_FIELD_MAPPING: + return visitor.visitDeletedLinkedAccountFieldMapping(); + case ENABLED_MERGE_WEBHOOK: + return visitor.visitEnabledMergeWebhook(); + case DISABLED_INTEGRATION: + return visitor.visitDisabledIntegration(); + case DELETED_DESTINATION: + return visitor.visitDeletedDestination(); + case CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return visitor.visitChangedLinkedAccountCommonModelOverride(); + case DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return visitor.visitDeletedLinkedAccountCommonModelOverride(); + case CREATED_TEST_API_KEY: + return visitor.visitCreatedTestApiKey(); + case REGENERATED_PRODUCTION_API_KEY: + return visitor.visitRegeneratedProductionApiKey(); + case END_USER_CREDENTIALS_ACCESSED: + return visitor.visitEndUserCredentialsAccessed(); + case DISABLED_CATEGORY: + return visitor.visitDisabledCategory(); + case DELETED_INTEGRATION_WIDE_FIELD_MAPPING: + return visitor.visitDeletedIntegrationWideFieldMapping(); + case TWO_FACTOR_AUTH_ENABLED: + return visitor.visitTwoFactorAuthEnabled(); + case CHANGED_DESTINATION: + return visitor.visitChangedDestination(); + case DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION: + return visitor.visitDisabledRedactUnmappedDataForOrganization(); + case TWO_FACTOR_AUTH_DISABLED: + return visitor.visitTwoFactorAuthDisabled(); + case ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT: + return visitor.visitEnabledRedactUnmappedDataForLinkedAccount(); + case FORCED_LINKED_ACCOUNT_RESYNC: + return visitor.visitForcedLinkedAccountResync(); + case CHANGED_ORGANIZATION_SETTINGS: + return visitor.visitChangedOrganizationSettings(); + case ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION: + return visitor.visitEnabledRedactUnmappedDataForOrganization(); + case RESET_PASSWORD: + return visitor.visitResetPassword(); + case INVITED_USER: + return visitor.visitInvitedUser(); + case MERGE_WEBHOOK_TARGET_CHANGED: + return visitor.visitMergeWebhookTargetChanged(); + case MUTED_ISSUE: + return visitor.visitMutedIssue(); + case GENERATED_MAGIC_LINK: + return visitor.visitGeneratedMagicLink(); + case CREATED_REMOTE_PRODUCTION_API_KEY: + return visitor.visitCreatedRemoteProductionApiKey(); + case DELETED_LINKED_ACCOUNT: + return visitor.visitDeletedLinkedAccount(); + case CHANGED_SCOPES: + return visitor.visitChangedScopes(); + case CHANGED_INTEGRATION_WIDE_FIELD_MAPPING: + return visitor.visitChangedIntegrationWideFieldMapping(); + case DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT: + return visitor.visitDeletedAllCommonModelsForLinkedAccount(); + case REGENERATED_WEBHOOK_SIGNATURE: + return visitor.visitRegeneratedWebhookSignature(); + case CHANGED_PASSWORD: + return visitor.visitChangedPassword(); + case DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT: + return visitor.visitDisabledRedactUnmappedDataForLinkedAccount(); + case CREATED_INTEGRATION_WIDE_FIELD_MAPPING: + return visitor.visitCreatedIntegrationWideFieldMapping(); + case CREATED_LINKED_ACCOUNT_FIELD_MAPPING: + return visitor.visitCreatedLinkedAccountFieldMapping(); + case ENABLED_INTEGRATION: + return visitor.visitEnabledIntegration(); + case DELETED_TEST_API_KEY: + return visitor.visitDeletedTestApiKey(); + case ENABLED_CATEGORY: + return visitor.visitEnabledCategory(); + case CREATED_DESTINATION: + return visitor.visitCreatedDestination(); + case CHANGED_LINKED_ACCOUNT_FIELD_MAPPING: + return visitor.visitChangedLinkedAccountFieldMapping(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EventTypeEnum valueOf(String value) { + switch (value) { + case "DISABLED_MERGE_WEBHOOK": + return DISABLED_MERGE_WEBHOOK; + case "CHANGED_PERSONAL_INFORMATION": + return CHANGED_PERSONAL_INFORMATION; + case "CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE": + return CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE; + case "DELETED_REMOTE_PRODUCTION_API_KEY": + return DELETED_REMOTE_PRODUCTION_API_KEY; + case "DELETED_LINKED_ACCOUNT_FIELD_MAPPING": + return DELETED_LINKED_ACCOUNT_FIELD_MAPPING; + case "ENABLED_MERGE_WEBHOOK": + return ENABLED_MERGE_WEBHOOK; + case "DISABLED_INTEGRATION": + return DISABLED_INTEGRATION; + case "DELETED_DESTINATION": + return DELETED_DESTINATION; + case "CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE": + return CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE; + case "DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE": + return DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE; + case "CREATED_TEST_API_KEY": + return CREATED_TEST_API_KEY; + case "REGENERATED_PRODUCTION_API_KEY": + return REGENERATED_PRODUCTION_API_KEY; + case "END_USER_CREDENTIALS_ACCESSED": + return END_USER_CREDENTIALS_ACCESSED; + case "DISABLED_CATEGORY": + return DISABLED_CATEGORY; + case "DELETED_INTEGRATION_WIDE_FIELD_MAPPING": + return DELETED_INTEGRATION_WIDE_FIELD_MAPPING; + case "TWO_FACTOR_AUTH_ENABLED": + return TWO_FACTOR_AUTH_ENABLED; + case "CHANGED_DESTINATION": + return CHANGED_DESTINATION; + case "DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION": + return DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION; + case "TWO_FACTOR_AUTH_DISABLED": + return TWO_FACTOR_AUTH_DISABLED; + case "ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT": + return ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT; + case "FORCED_LINKED_ACCOUNT_RESYNC": + return FORCED_LINKED_ACCOUNT_RESYNC; + case "CHANGED_ORGANIZATION_SETTINGS": + return CHANGED_ORGANIZATION_SETTINGS; + case "ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION": + return ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION; + case "RESET_PASSWORD": + return RESET_PASSWORD; + case "INVITED_USER": + return INVITED_USER; + case "MERGE_WEBHOOK_TARGET_CHANGED": + return MERGE_WEBHOOK_TARGET_CHANGED; + case "MUTED_ISSUE": + return MUTED_ISSUE; + case "GENERATED_MAGIC_LINK": + return GENERATED_MAGIC_LINK; + case "CREATED_REMOTE_PRODUCTION_API_KEY": + return CREATED_REMOTE_PRODUCTION_API_KEY; + case "DELETED_LINKED_ACCOUNT": + return DELETED_LINKED_ACCOUNT; + case "CHANGED_SCOPES": + return CHANGED_SCOPES; + case "CHANGED_INTEGRATION_WIDE_FIELD_MAPPING": + return CHANGED_INTEGRATION_WIDE_FIELD_MAPPING; + case "DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT": + return DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT; + case "REGENERATED_WEBHOOK_SIGNATURE": + return REGENERATED_WEBHOOK_SIGNATURE; + case "CHANGED_PASSWORD": + return CHANGED_PASSWORD; + case "DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT": + return DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT; + case "CREATED_INTEGRATION_WIDE_FIELD_MAPPING": + return CREATED_INTEGRATION_WIDE_FIELD_MAPPING; + case "CREATED_LINKED_ACCOUNT_FIELD_MAPPING": + return CREATED_LINKED_ACCOUNT_FIELD_MAPPING; + case "ENABLED_INTEGRATION": + return ENABLED_INTEGRATION; + case "DELETED_TEST_API_KEY": + return DELETED_TEST_API_KEY; + case "ENABLED_CATEGORY": + return ENABLED_CATEGORY; + case "CREATED_DESTINATION": + return CREATED_DESTINATION; + case "CHANGED_LINKED_ACCOUNT_FIELD_MAPPING": + return CHANGED_LINKED_ACCOUNT_FIELD_MAPPING; + default: + return new EventTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + 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, + + UNKNOWN + } + + public interface Visitor { + T visitCreatedRemoteProductionApiKey(); + + T visitDeletedRemoteProductionApiKey(); + + T visitCreatedTestApiKey(); + + T visitDeletedTestApiKey(); + + T visitRegeneratedProductionApiKey(); + + T visitRegeneratedWebhookSignature(); + + T visitInvitedUser(); + + T visitTwoFactorAuthEnabled(); + + T visitTwoFactorAuthDisabled(); + + T visitDeletedLinkedAccount(); + + T visitDeletedAllCommonModelsForLinkedAccount(); + + T visitCreatedDestination(); + + T visitDeletedDestination(); + + T visitChangedDestination(); + + T visitChangedScopes(); + + T visitChangedPersonalInformation(); + + T visitChangedOrganizationSettings(); + + T visitEnabledIntegration(); + + T visitDisabledIntegration(); + + T visitEnabledCategory(); + + T visitDisabledCategory(); + + T visitChangedPassword(); + + T visitResetPassword(); + + T visitEnabledRedactUnmappedDataForOrganization(); + + T visitEnabledRedactUnmappedDataForLinkedAccount(); + + T visitDisabledRedactUnmappedDataForOrganization(); + + T visitDisabledRedactUnmappedDataForLinkedAccount(); + + T visitCreatedIntegrationWideFieldMapping(); + + T visitCreatedLinkedAccountFieldMapping(); + + T visitChangedIntegrationWideFieldMapping(); + + T visitChangedLinkedAccountFieldMapping(); + + T visitDeletedIntegrationWideFieldMapping(); + + T visitDeletedLinkedAccountFieldMapping(); + + T visitCreatedLinkedAccountCommonModelOverride(); + + T visitChangedLinkedAccountCommonModelOverride(); + + T visitDeletedLinkedAccountCommonModelOverride(); + + T visitForcedLinkedAccountResync(); + + T visitMutedIssue(); + + T visitGeneratedMagicLink(); + + T visitEnabledMergeWebhook(); + + T visitDisabledMergeWebhook(); + + T visitMergeWebhookTargetChanged(); + + T visitEndUserCredentialsAccessed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/knowledgebase/types/ExternalTargetFieldApi.java new file mode 100644 index 000000000..6cb60051f --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ExternalTargetFieldApi.java @@ -0,0 +1,143 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApi.Builder.class) +public final class ExternalTargetFieldApi { + private final Optional name; + + private final Optional description; + + private final Optional isMapped; + + private final Map additionalProperties; + + private ExternalTargetFieldApi( + Optional name, + Optional description, + Optional isMapped, + Map additionalProperties) { + this.name = name; + this.description = description; + this.isMapped = isMapped; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public Optional getName() { + return name; + } + + @JsonProperty("description") + public Optional getDescription() { + return description; + } + + @JsonProperty("is_mapped") + public Optional getIsMapped() { + return isMapped; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApi && equalTo((ExternalTargetFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApi other) { + return name.equals(other.name) && description.equals(other.description) && isMapped.equals(other.isMapped); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isMapped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional name = Optional.empty(); + + private Optional description = Optional.empty(); + + private Optional isMapped = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApi other) { + name(other.getName()); + description(other.getDescription()); + isMapped(other.getIsMapped()); + return this; + } + + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public Builder description(Optional description) { + this.description = description; + return this; + } + + public Builder description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) + public Builder isMapped(Optional isMapped) { + this.isMapped = isMapped; + return this; + } + + public Builder isMapped(String isMapped) { + this.isMapped = Optional.ofNullable(isMapped); + return this; + } + + public ExternalTargetFieldApi build() { + return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ExternalTargetFieldApiResponse.java b/src/main/java/com/merge/api/knowledgebase/types/ExternalTargetFieldApiResponse.java new file mode 100644 index 000000000..a754cb5e1 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ExternalTargetFieldApiResponse.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ExternalTargetFieldApiResponse.Builder.class) +public final class ExternalTargetFieldApiResponse { + private final Optional> container; + + private final Optional> article; + + private final Optional> attachment; + + private final Optional> user; + + private final Optional> group; + + private final Map additionalProperties; + + private ExternalTargetFieldApiResponse( + Optional> container, + Optional> article, + Optional> attachment, + Optional> user, + Optional> group, + Map additionalProperties) { + this.container = container; + this.article = article; + this.attachment = attachment; + this.user = user; + this.group = group; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Container") + public Optional> getContainer() { + return container; + } + + @JsonProperty("Article") + public Optional> getArticle() { + return article; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ExternalTargetFieldApiResponse && equalTo((ExternalTargetFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ExternalTargetFieldApiResponse other) { + return container.equals(other.container) + && article.equals(other.article) + && attachment.equals(other.attachment) + && user.equals(other.user) + && group.equals(other.group); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.container, this.article, this.attachment, this.user, this.group); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> container = Optional.empty(); + + private Optional> article = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> group = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ExternalTargetFieldApiResponse other) { + container(other.getContainer()); + article(other.getArticle()); + attachment(other.getAttachment()); + user(other.getUser()); + group(other.getGroup()); + return this; + } + + @JsonSetter(value = "Container", nulls = Nulls.SKIP) + public Builder container(Optional> container) { + this.container = container; + return this; + } + + public Builder container(List container) { + this.container = Optional.ofNullable(container); + return this; + } + + @JsonSetter(value = "Article", nulls = Nulls.SKIP) + public Builder article(Optional> article) { + this.article = article; + return this; + } + + public Builder article(List article) { + this.article = Optional.ofNullable(article); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + public ExternalTargetFieldApiResponse build() { + return new ExternalTargetFieldApiResponse( + container, article, attachment, user, group, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstance.java new file mode 100644 index 000000000..4998ff1c4 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstance.java @@ -0,0 +1,230 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstance.Builder.class) +public final class FieldMappingApiInstance { + private final Optional id; + + private final Optional isIntegrationWide; + + private final Optional targetField; + + private final Optional remoteField; + + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + + private final Map additionalProperties; + + private FieldMappingApiInstance( + Optional id, + Optional isIntegrationWide, + Optional targetField, + Optional remoteField, + Optional jmesPath, + Optional advancedMappingExpression, + Map additionalProperties) { + this.id = id; + this.isIntegrationWide = isIntegrationWide; + this.targetField = targetField; + this.remoteField = remoteField; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + @JsonProperty("is_integration_wide") + public Optional getIsIntegrationWide() { + return isIntegrationWide; + } + + @JsonProperty("target_field") + public Optional getTargetField() { + return targetField; + } + + @JsonProperty("remote_field") + public Optional getRemoteField() { + return remoteField; + } + + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstance && equalTo((FieldMappingApiInstance) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstance other) { + return id.equals(other.id) + && isIntegrationWide.equals(other.isIntegrationWide) + && targetField.equals(other.targetField) + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.isIntegrationWide, + this.targetField, + this.remoteField, + this.jmesPath, + this.advancedMappingExpression); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional isIntegrationWide = Optional.empty(); + + private Optional targetField = Optional.empty(); + + private Optional remoteField = Optional.empty(); + + private Optional jmesPath = Optional.empty(); + + private Optional advancedMappingExpression = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstance other) { + id(other.getId()); + isIntegrationWide(other.getIsIntegrationWide()); + targetField(other.getTargetField()); + remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @JsonSetter(value = "is_integration_wide", nulls = Nulls.SKIP) + public Builder isIntegrationWide(Optional isIntegrationWide) { + this.isIntegrationWide = isIntegrationWide; + return this; + } + + public Builder isIntegrationWide(Boolean isIntegrationWide) { + this.isIntegrationWide = Optional.ofNullable(isIntegrationWide); + return this; + } + + @JsonSetter(value = "target_field", nulls = Nulls.SKIP) + public Builder targetField(Optional targetField) { + this.targetField = targetField; + return this; + } + + public Builder targetField(FieldMappingApiInstanceTargetField targetField) { + this.targetField = Optional.ofNullable(targetField); + return this; + } + + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) + public Builder remoteField(Optional remoteField) { + this.remoteField = remoteField; + return this; + } + + public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { + this.remoteField = Optional.ofNullable(remoteField); + return this; + } + + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public Builder advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + public Builder advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + + public FieldMappingApiInstance build() { + return new FieldMappingApiInstance( + id, + isIntegrationWide, + targetField, + remoteField, + jmesPath, + advancedMappingExpression, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceRemoteField.java new file mode 100644 index 000000000..9f8d1ae2b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceRemoteField.java @@ -0,0 +1,171 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteField.Builder.class) +public final class FieldMappingApiInstanceRemoteField { + private final Optional remoteKeyName; + + private final Optional> schema; + + private final FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteField( + Optional remoteKeyName, + Optional> schema, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo, + Map additionalProperties) { + this.remoteKeyName = remoteKeyName; + this.schema = schema; + this.remoteEndpointInfo = remoteEndpointInfo; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("remote_key_name") + public Optional getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("schema") + public Optional> getSchema() { + return schema; + } + + @JsonProperty("remote_endpoint_info") + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteField + && equalTo((FieldMappingApiInstanceRemoteField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteField other) { + return remoteKeyName.equals(other.remoteKeyName) + && schema.equals(other.schema) + && remoteEndpointInfo.equals(other.remoteEndpointInfo); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.remoteKeyName, this.schema, this.remoteEndpointInfo); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteEndpointInfoStage builder() { + return new Builder(); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo); + + Builder from(FieldMappingApiInstanceRemoteField other); + } + + public interface _FinalStage { + FieldMappingApiInstanceRemoteField build(); + + _FinalStage remoteKeyName(Optional remoteKeyName); + + _FinalStage remoteKeyName(String remoteKeyName); + + _FinalStage schema(Optional> schema); + + _FinalStage schema(Map schema); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteEndpointInfoStage, _FinalStage { + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo; + + private Optional> schema = Optional.empty(); + + private Optional remoteKeyName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceRemoteField other) { + remoteKeyName(other.getRemoteKeyName()); + schema(other.getSchema()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo( + @NotNull FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage schema(Map schema) { + this.schema = Optional.ofNullable(schema); + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Optional> schema) { + this.schema = schema; + return this; + } + + @java.lang.Override + public _FinalStage remoteKeyName(String remoteKeyName) { + this.remoteKeyName = Optional.ofNullable(remoteKeyName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) + public _FinalStage remoteKeyName(Optional remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceRemoteField build() { + return new FieldMappingApiInstanceRemoteField( + remoteKeyName, schema, remoteEndpointInfo, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java new file mode 100644 index 000000000..09c0bc721 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -0,0 +1,148 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.Builder.class) +public final class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo { + private final Optional method; + + private final Optional urlPath; + + private final Optional> fieldTraversalPath; + + private final Map additionalProperties; + + private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + Optional method, + Optional urlPath, + Optional> fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public Optional getMethod() { + return method; + } + + @JsonProperty("url_path") + public Optional getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public Optional> getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + && equalTo((FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional method = Optional.empty(); + + private Optional urlPath = Optional.empty(); + + private Optional> fieldTraversalPath = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @JsonSetter(value = "method", nulls = Nulls.SKIP) + public Builder method(Optional method) { + this.method = method; + return this; + } + + public Builder method(String method) { + this.method = Optional.ofNullable(method); + return this; + } + + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) + public Builder urlPath(Optional urlPath) { + this.urlPath = urlPath; + return this; + } + + public Builder urlPath(String urlPath) { + this.urlPath = Optional.ofNullable(urlPath); + return this; + } + + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public Builder fieldTraversalPath(Optional> fieldTraversalPath) { + this.fieldTraversalPath = fieldTraversalPath; + return this; + } + + public Builder fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath = Optional.ofNullable(fieldTraversalPath); + return this; + } + + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { + return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( + method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceResponse.java b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceResponse.java new file mode 100644 index 000000000..a71c9eca9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceResponse.java @@ -0,0 +1,195 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceResponse.Builder.class) +public final class FieldMappingApiInstanceResponse { + private final Optional> container; + + private final Optional> article; + + private final Optional> attachment; + + private final Optional> user; + + private final Optional> group; + + private final Map additionalProperties; + + private FieldMappingApiInstanceResponse( + Optional> container, + Optional> article, + Optional> attachment, + Optional> user, + Optional> group, + Map additionalProperties) { + this.container = container; + this.article = article; + this.attachment = attachment; + this.user = user; + this.group = group; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Container") + public Optional> getContainer() { + return container; + } + + @JsonProperty("Article") + public Optional> getArticle() { + return article; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceResponse && equalTo((FieldMappingApiInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceResponse other) { + return container.equals(other.container) + && article.equals(other.article) + && attachment.equals(other.attachment) + && user.equals(other.user) + && group.equals(other.group); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.container, this.article, this.attachment, this.user, this.group); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> container = Optional.empty(); + + private Optional> article = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> group = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingApiInstanceResponse other) { + container(other.getContainer()); + article(other.getArticle()); + attachment(other.getAttachment()); + user(other.getUser()); + group(other.getGroup()); + return this; + } + + @JsonSetter(value = "Container", nulls = Nulls.SKIP) + public Builder container(Optional> container) { + this.container = container; + return this; + } + + public Builder container(List container) { + this.container = Optional.ofNullable(container); + return this; + } + + @JsonSetter(value = "Article", nulls = Nulls.SKIP) + public Builder article(Optional> article) { + this.article = article; + return this; + } + + public Builder article(List article) { + this.article = Optional.ofNullable(article); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + public FieldMappingApiInstanceResponse build() { + return new FieldMappingApiInstanceResponse( + container, article, attachment, user, group, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceTargetField.java b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceTargetField.java new file mode 100644 index 000000000..d124aec18 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingApiInstanceTargetField.java @@ -0,0 +1,150 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingApiInstanceTargetField.Builder.class) +public final class FieldMappingApiInstanceTargetField { + private final String name; + + private final String description; + + private final boolean isOrganizationWide; + + private final Map additionalProperties; + + private FieldMappingApiInstanceTargetField( + String name, String description, boolean isOrganizationWide, Map additionalProperties) { + this.name = name; + this.description = description; + this.isOrganizationWide = isOrganizationWide; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("description") + public String getDescription() { + return description; + } + + @JsonProperty("is_organization_wide") + public boolean getIsOrganizationWide() { + return isOrganizationWide; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingApiInstanceTargetField + && equalTo((FieldMappingApiInstanceTargetField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingApiInstanceTargetField other) { + return name.equals(other.name) + && description.equals(other.description) + && isOrganizationWide == other.isOrganizationWide; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.description, this.isOrganizationWide); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + DescriptionStage name(@NotNull String name); + + Builder from(FieldMappingApiInstanceTargetField other); + } + + public interface DescriptionStage { + IsOrganizationWideStage description(@NotNull String description); + } + + public interface IsOrganizationWideStage { + _FinalStage isOrganizationWide(boolean isOrganizationWide); + } + + public interface _FinalStage { + FieldMappingApiInstanceTargetField build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DescriptionStage, IsOrganizationWideStage, _FinalStage { + private String name; + + private String description; + + private boolean isOrganizationWide; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingApiInstanceTargetField other) { + name(other.getName()); + description(other.getDescription()); + isOrganizationWide(other.getIsOrganizationWide()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public DescriptionStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("description") + public IsOrganizationWideStage description(@NotNull String description) { + this.description = description; + return this; + } + + @java.lang.Override + @JsonSetter("is_organization_wide") + public _FinalStage isOrganizationWide(boolean isOrganizationWide) { + this.isOrganizationWide = isOrganizationWide; + return this; + } + + @java.lang.Override + public FieldMappingApiInstanceTargetField build() { + return new FieldMappingApiInstanceTargetField(name, description, isOrganizationWide, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldMappingInstanceResponse.java b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingInstanceResponse.java new file mode 100644 index 000000000..d7891b923 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingInstanceResponse.java @@ -0,0 +1,224 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingInstanceResponse.Builder.class) +public final class FieldMappingInstanceResponse { + private final FieldMappingApiInstance model; + + private final List warnings; + + private final List errors; + + private final Optional> logs; + + private final Map additionalProperties; + + private FieldMappingInstanceResponse( + FieldMappingApiInstance model, + List warnings, + List errors, + Optional> logs, + Map additionalProperties) { + this.model = model; + this.warnings = warnings; + this.errors = errors; + this.logs = logs; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model") + public FieldMappingApiInstance getModel() { + return model; + } + + @JsonProperty("warnings") + public List getWarnings() { + return warnings; + } + + @JsonProperty("errors") + public List getErrors() { + return errors; + } + + @JsonProperty("logs") + public Optional> getLogs() { + return logs; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingInstanceResponse && equalTo((FieldMappingInstanceResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingInstanceResponse other) { + return model.equals(other.model) + && warnings.equals(other.warnings) + && errors.equals(other.errors) + && logs.equals(other.logs); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.model, this.warnings, this.errors, this.logs); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelStage builder() { + return new Builder(); + } + + public interface ModelStage { + _FinalStage model(@NotNull FieldMappingApiInstance model); + + Builder from(FieldMappingInstanceResponse other); + } + + public interface _FinalStage { + FieldMappingInstanceResponse build(); + + _FinalStage warnings(List warnings); + + _FinalStage addWarnings(WarningValidationProblem warnings); + + _FinalStage addAllWarnings(List warnings); + + _FinalStage errors(List errors); + + _FinalStage addErrors(ErrorValidationProblem errors); + + _FinalStage addAllErrors(List errors); + + _FinalStage logs(Optional> logs); + + _FinalStage logs(List logs); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelStage, _FinalStage { + private FieldMappingApiInstance model; + + private Optional> logs = Optional.empty(); + + private List errors = new ArrayList<>(); + + private List warnings = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FieldMappingInstanceResponse other) { + model(other.getModel()); + warnings(other.getWarnings()); + errors(other.getErrors()); + logs(other.getLogs()); + return this; + } + + @java.lang.Override + @JsonSetter("model") + public _FinalStage model(@NotNull FieldMappingApiInstance model) { + this.model = model; + return this; + } + + @java.lang.Override + public _FinalStage logs(List logs) { + this.logs = Optional.ofNullable(logs); + return this; + } + + @java.lang.Override + @JsonSetter(value = "logs", nulls = Nulls.SKIP) + public _FinalStage logs(Optional> logs) { + this.logs = logs; + return this; + } + + @java.lang.Override + public _FinalStage addAllErrors(List errors) { + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addErrors(ErrorValidationProblem errors) { + this.errors.add(errors); + return this; + } + + @java.lang.Override + @JsonSetter(value = "errors", nulls = Nulls.SKIP) + public _FinalStage errors(List errors) { + this.errors.clear(); + if (errors != null) { + this.errors.addAll(errors); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllWarnings(List warnings) { + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public _FinalStage addWarnings(WarningValidationProblem warnings) { + this.warnings.add(warnings); + return this; + } + + @java.lang.Override + @JsonSetter(value = "warnings", nulls = Nulls.SKIP) + public _FinalStage warnings(List warnings) { + this.warnings.clear(); + if (warnings != null) { + this.warnings.addAll(warnings); + } + return this; + } + + @java.lang.Override + public FieldMappingInstanceResponse build() { + return new FieldMappingInstanceResponse(model, warnings, errors, logs, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldMappingsRetrieveRequest.java b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingsRetrieveRequest.java new file mode 100644 index 000000000..a02cce48d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldMappingsRetrieveRequest.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsRetrieveRequest.Builder.class) +public final class FieldMappingsRetrieveRequest { + private final Optional excludeRemoteFieldMetadata; + + private final Map additionalProperties; + + private FieldMappingsRetrieveRequest( + Optional excludeRemoteFieldMetadata, Map additionalProperties) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.additionalProperties = additionalProperties; + } + + /** + * @return 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. + */ + @JsonProperty("exclude_remote_field_metadata") + public Optional getExcludeRemoteFieldMetadata() { + return excludeRemoteFieldMetadata; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsRetrieveRequest && equalTo((FieldMappingsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldMappingsRetrieveRequest other) { + return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.excludeRemoteFieldMetadata); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional excludeRemoteFieldMetadata = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsRetrieveRequest other) { + excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "exclude_remote_field_metadata", nulls = Nulls.SKIP) + public Builder excludeRemoteFieldMetadata(Optional excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + return this; + } + + public Builder excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata) { + this.excludeRemoteFieldMetadata = Optional.ofNullable(excludeRemoteFieldMetadata); + return this; + } + + public FieldMappingsRetrieveRequest build() { + return new FieldMappingsRetrieveRequest(excludeRemoteFieldMetadata, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldPermissionDeserializer.java b/src/main/java/com/merge/api/knowledgebase/types/FieldPermissionDeserializer.java new file mode 100644 index 000000000..3fa09469b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldPermissionDeserializer.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializer.Builder.class) +public final class FieldPermissionDeserializer { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializer( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializer && equalTo((FieldPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializer other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializer other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializer build() { + return new FieldPermissionDeserializer(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/FieldPermissionDeserializerRequest.java b/src/main/java/com/merge/api/knowledgebase/types/FieldPermissionDeserializerRequest.java new file mode 100644 index 000000000..447741f83 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/FieldPermissionDeserializerRequest.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldPermissionDeserializerRequest.Builder.class) +public final class FieldPermissionDeserializerRequest { + private final Optional> enabledFields; + + private final Optional> disabledFields; + + private final Map additionalProperties; + + private FieldPermissionDeserializerRequest( + Optional> enabledFields, + Optional> disabledFields, + Map additionalProperties) { + this.enabledFields = enabledFields; + this.disabledFields = disabledFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("enabled_fields") + public Optional> getEnabledFields() { + return enabledFields; + } + + @JsonProperty("disabled_fields") + public Optional> getDisabledFields() { + return disabledFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldPermissionDeserializerRequest + && equalTo((FieldPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FieldPermissionDeserializerRequest other) { + return enabledFields.equals(other.enabledFields) && disabledFields.equals(other.disabledFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.enabledFields, this.disabledFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> enabledFields = Optional.empty(); + + private Optional> disabledFields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldPermissionDeserializerRequest other) { + enabledFields(other.getEnabledFields()); + disabledFields(other.getDisabledFields()); + return this; + } + + @JsonSetter(value = "enabled_fields", nulls = Nulls.SKIP) + public Builder enabledFields(Optional> enabledFields) { + this.enabledFields = enabledFields; + return this; + } + + public Builder enabledFields(List enabledFields) { + this.enabledFields = Optional.ofNullable(enabledFields); + return this; + } + + @JsonSetter(value = "disabled_fields", nulls = Nulls.SKIP) + public Builder disabledFields(Optional> disabledFields) { + this.disabledFields = disabledFields; + return this; + } + + public Builder disabledFields(List disabledFields) { + this.disabledFields = Optional.ofNullable(disabledFields); + return this; + } + + public FieldPermissionDeserializerRequest build() { + return new FieldPermissionDeserializerRequest(enabledFields, disabledFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GenerateRemoteKeyRequest.java b/src/main/java/com/merge/api/knowledgebase/types/GenerateRemoteKeyRequest.java new file mode 100644 index 000000000..8e051ab54 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GenerateRemoteKeyRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GenerateRemoteKeyRequest.Builder.class) +public final class GenerateRemoteKeyRequest { + private final String name; + + private final Map additionalProperties; + + private GenerateRemoteKeyRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GenerateRemoteKeyRequest && equalTo((GenerateRemoteKeyRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GenerateRemoteKeyRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

            The name of the remote key

            + */ + _FinalStage name(@NotNull String name); + + Builder from(GenerateRemoteKeyRequest other); + } + + public interface _FinalStage { + GenerateRemoteKeyRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(GenerateRemoteKeyRequest other) { + name(other.getName()); + return this; + } + + /** + *

            The name of the remote key

            + *

            The name of the remote key

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public GenerateRemoteKeyRequest build() { + return new GenerateRemoteKeyRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/Group.java b/src/main/java/com/merge/api/knowledgebase/types/Group.java new file mode 100644 index 000000000..c71e20e95 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/Group.java @@ -0,0 +1,372 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Group.Builder.class) +public final class Group { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional parentGroup; + + private final Optional> users; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Optional> remoteData; + + private final Map additionalProperties; + + private Group( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional parentGroup, + Optional> users, + Optional remoteWasDeleted, + Optional fieldMappings, + Optional> remoteData, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.parentGroup = parentGroup; + this.users = users; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.remoteData = remoteData; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The group's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The parent group for this group. + */ + @JsonProperty("parent_group") + public Optional getParentGroup() { + return parentGroup; + } + + @JsonProperty("users") + public Optional> getUsers() { + return users; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @JsonProperty("remote_data") + public Optional> getRemoteData() { + return remoteData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Group && equalTo((Group) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Group other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && parentGroup.equals(other.parentGroup) + && users.equals(other.users) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings) + && remoteData.equals(other.remoteData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.parentGroup, + this.users, + this.remoteWasDeleted, + this.fieldMappings, + this.remoteData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional parentGroup = Optional.empty(); + + private Optional> users = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + private Optional> remoteData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Group other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + parentGroup(other.getParentGroup()); + users(other.getUsers()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + remoteData(other.getRemoteData()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

            The third-party API ID of the matching object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            The datetime that this object was created by Merge.

            + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

            The datetime that this object was modified by Merge.

            + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

            The group's name.

            + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

            The parent group for this group.

            + */ + @JsonSetter(value = "parent_group", nulls = Nulls.SKIP) + public Builder parentGroup(Optional parentGroup) { + this.parentGroup = parentGroup; + return this; + } + + public Builder parentGroup(GroupParentGroup parentGroup) { + this.parentGroup = Optional.ofNullable(parentGroup); + return this; + } + + @JsonSetter(value = "users", nulls = Nulls.SKIP) + public Builder users(Optional> users) { + this.users = users; + return this; + } + + public Builder users(List users) { + this.users = Optional.ofNullable(users); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(GroupFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) + public Builder remoteData(Optional> remoteData) { + this.remoteData = remoteData; + return this; + } + + public Builder remoteData(List remoteData) { + this.remoteData = Optional.ofNullable(remoteData); + return this; + } + + public Group build() { + return new Group( + id, + remoteId, + createdAt, + modifiedAt, + name, + parentGroup, + users, + remoteWasDeleted, + fieldMappings, + remoteData, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GroupFieldMappings.java b/src/main/java/com/merge/api/knowledgebase/types/GroupFieldMappings.java new file mode 100644 index 000000000..84e7548bf --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GroupFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupFieldMappings.Builder.class) +public final class GroupFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private GroupFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupFieldMappings && equalTo((GroupFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public GroupFieldMappings build() { + return new GroupFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GroupParentGroup.java b/src/main/java/com/merge/api/knowledgebase/types/GroupParentGroup.java new file mode 100644 index 000000000..b4a6c9b56 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GroupParentGroup.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GroupParentGroup.Deserializer.class) +public final class GroupParentGroup { + private final Object value; + + private final int type; + + private GroupParentGroup(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupParentGroup && equalTo((GroupParentGroup) other); + } + + private boolean equalTo(GroupParentGroup other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GroupParentGroup of(String value) { + return new GroupParentGroup(value, 0); + } + + public static GroupParentGroup of(Group value) { + return new GroupParentGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GroupParentGroup.class); + } + + @java.lang.Override + public GroupParentGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Group.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GroupUsersItem.java b/src/main/java/com/merge/api/knowledgebase/types/GroupUsersItem.java new file mode 100644 index 000000000..a1ca38ed9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GroupUsersItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = GroupUsersItem.Deserializer.class) +public final class GroupUsersItem { + private final Object value; + + private final int type; + + private GroupUsersItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupUsersItem && equalTo((GroupUsersItem) other); + } + + private boolean equalTo(GroupUsersItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static GroupUsersItem of(String value) { + return new GroupUsersItem(value, 0); + } + + public static GroupUsersItem of(User value) { + return new GroupUsersItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(GroupUsersItem.class); + } + + @java.lang.Override + public GroupUsersItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, User.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GroupsListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/GroupsListRequest.java new file mode 100644 index 000000000..0ab8e98ba --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GroupsListRequest.java @@ -0,0 +1,434 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsListRequest.Builder.class) +public final class GroupsListRequest { + private final Optional> expand; + + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private GroupsListRequest( + Optional> expand, + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.expand = expand; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsListRequest && equalTo((GroupsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsListRequest other) { + return expand.equals(other.expand) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.expand, + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsListRequest other) { + expand(other.getExpand()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + /** + *

            Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

            + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(GroupsListRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

            If provided, will only return objects created after this datetime.

            + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

            If provided, will only return objects created before this datetime.

            + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

            If provided, only objects synced by Merge after this date time will be returned.

            + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

            If provided, only objects synced by Merge before this date time will be returned.

            + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            The API provider's ID for the given object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public GroupsListRequest build() { + return new GroupsListRequest( + expand, + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GroupsListRequestExpandItem.java b/src/main/java/com/merge/api/knowledgebase/types/GroupsListRequestExpandItem.java new file mode 100644 index 000000000..fb1d82fb0 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GroupsListRequestExpandItem.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GroupsListRequestExpandItem { + public static final GroupsListRequestExpandItem PARENT_GROUP = + new GroupsListRequestExpandItem(Value.PARENT_GROUP, "parent_group"); + + public static final GroupsListRequestExpandItem USERS = new GroupsListRequestExpandItem(Value.USERS, "users"); + + private final Value value; + + private final String string; + + GroupsListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GroupsListRequestExpandItem + && this.string.equals(((GroupsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PARENT_GROUP: + return visitor.visitParentGroup(); + case USERS: + return visitor.visitUsers(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GroupsListRequestExpandItem valueOf(String value) { + switch (value) { + case "parent_group": + return PARENT_GROUP; + case "users": + return USERS; + default: + return new GroupsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_GROUP, + + USERS, + + UNKNOWN + } + + public interface Visitor { + T visitParentGroup(); + + T visitUsers(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GroupsRetrieveRequest.java b/src/main/java/com/merge/api/knowledgebase/types/GroupsRetrieveRequest.java new file mode 100644 index 000000000..3e015b0bd --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GroupsRetrieveRequest.java @@ -0,0 +1,170 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = GroupsRetrieveRequest.Builder.class) +public final class GroupsRetrieveRequest { + private final Optional> expand; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private GroupsRetrieveRequest( + Optional> expand, + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.expand = expand; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + */ + @JsonProperty("expand") + public Optional> getExpand() { + return expand; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof GroupsRetrieveRequest && equalTo((GroupsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(GroupsRetrieveRequest other) { + return expand.equals(other.expand) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.expand, this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> expand = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(GroupsRetrieveRequest other) { + expand(other.getExpand()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

            Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

            + */ + @JsonSetter(value = "expand", nulls = Nulls.SKIP) + public Builder expand(Optional> expand) { + this.expand = expand; + return this; + } + + public Builder expand(List expand) { + this.expand = Optional.ofNullable(expand); + return this; + } + + public Builder expand(GroupsRetrieveRequestExpandItem expand) { + this.expand = Optional.of(Collections.singletonList(expand)); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public GroupsRetrieveRequest build() { + return new GroupsRetrieveRequest(expand, includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/GroupsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/knowledgebase/types/GroupsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..d765a3638 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/GroupsRetrieveRequestExpandItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GroupsRetrieveRequestExpandItem { + public static final GroupsRetrieveRequestExpandItem PARENT_GROUP = + new GroupsRetrieveRequestExpandItem(Value.PARENT_GROUP, "parent_group"); + + public static final GroupsRetrieveRequestExpandItem USERS = + new GroupsRetrieveRequestExpandItem(Value.USERS, "users"); + + private final Value value; + + private final String string; + + GroupsRetrieveRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof GroupsRetrieveRequestExpandItem + && this.string.equals(((GroupsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PARENT_GROUP: + return visitor.visitParentGroup(); + case USERS: + return visitor.visitUsers(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GroupsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "parent_group": + return PARENT_GROUP; + case "users": + return USERS; + default: + return new GroupsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_GROUP, + + USERS, + + UNKNOWN + } + + public interface Visitor { + T visitParentGroup(); + + T visitUsers(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/IndividualCommonModelScopeDeserializer.java b/src/main/java/com/merge/api/knowledgebase/types/IndividualCommonModelScopeDeserializer.java new file mode 100644 index 000000000..81724e0dd --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/IndividualCommonModelScopeDeserializer.java @@ -0,0 +1,168 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializer.Builder.class) +public final class IndividualCommonModelScopeDeserializer { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializer( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializer + && equalTo((IndividualCommonModelScopeDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializer other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializer other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializer build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializer other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializer fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions(Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializer build() { + return new IndividualCommonModelScopeDeserializer( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/IndividualCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/knowledgebase/types/IndividualCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..cdfc3e736 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/IndividualCommonModelScopeDeserializerRequest.java @@ -0,0 +1,169 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IndividualCommonModelScopeDeserializerRequest.Builder.class) +public final class IndividualCommonModelScopeDeserializerRequest { + private final String modelName; + + private final Optional> modelPermissions; + + private final Optional fieldPermissions; + + private final Map additionalProperties; + + private IndividualCommonModelScopeDeserializerRequest( + String modelName, + Optional> modelPermissions, + Optional fieldPermissions, + Map additionalProperties) { + this.modelName = modelName; + this.modelPermissions = modelPermissions; + this.fieldPermissions = fieldPermissions; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_permissions") + public Optional> getModelPermissions() { + return modelPermissions; + } + + @JsonProperty("field_permissions") + public Optional getFieldPermissions() { + return fieldPermissions; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IndividualCommonModelScopeDeserializerRequest + && equalTo((IndividualCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IndividualCommonModelScopeDeserializerRequest other) { + return modelName.equals(other.modelName) + && modelPermissions.equals(other.modelPermissions) + && fieldPermissions.equals(other.fieldPermissions); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.modelName, this.modelPermissions, this.fieldPermissions); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(IndividualCommonModelScopeDeserializerRequest other); + } + + public interface _FinalStage { + IndividualCommonModelScopeDeserializerRequest build(); + + _FinalStage modelPermissions(Optional> modelPermissions); + + _FinalStage modelPermissions(Map modelPermissions); + + _FinalStage fieldPermissions(Optional fieldPermissions); + + _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private Optional fieldPermissions = Optional.empty(); + + private Optional> modelPermissions = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(IndividualCommonModelScopeDeserializerRequest other) { + modelName(other.getModelName()); + modelPermissions(other.getModelPermissions()); + fieldPermissions(other.getFieldPermissions()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage fieldPermissions(FieldPermissionDeserializerRequest fieldPermissions) { + this.fieldPermissions = Optional.ofNullable(fieldPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_permissions", nulls = Nulls.SKIP) + public _FinalStage fieldPermissions(Optional fieldPermissions) { + this.fieldPermissions = fieldPermissions; + return this; + } + + @java.lang.Override + public _FinalStage modelPermissions(Map modelPermissions) { + this.modelPermissions = Optional.ofNullable(modelPermissions); + return this; + } + + @java.lang.Override + @JsonSetter(value = "model_permissions", nulls = Nulls.SKIP) + public _FinalStage modelPermissions( + Optional> modelPermissions) { + this.modelPermissions = modelPermissions; + return this; + } + + @java.lang.Override + public IndividualCommonModelScopeDeserializerRequest build() { + return new IndividualCommonModelScopeDeserializerRequest( + modelName, modelPermissions, fieldPermissions, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/Issue.java b/src/main/java/com/merge/api/knowledgebase/types/Issue.java new file mode 100644 index 000000000..599e38571 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/Issue.java @@ -0,0 +1,349 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Issue.Builder.class) +public final class Issue { + private final Optional id; + + private final Optional status; + + private final String errorDescription; + + private final Optional> endUser; + + private final Optional firstIncidentTime; + + private final Optional lastIncidentTime; + + private final Optional isMuted; + + private final Optional> errorDetails; + + private final Map additionalProperties; + + private Issue( + Optional id, + Optional status, + String errorDescription, + Optional> endUser, + Optional firstIncidentTime, + Optional lastIncidentTime, + Optional isMuted, + Optional> errorDetails, + Map additionalProperties) { + this.id = id; + this.status = status; + this.errorDescription = errorDescription; + this.endUser = endUser; + this.firstIncidentTime = firstIncidentTime; + this.lastIncidentTime = lastIncidentTime; + this.isMuted = isMuted; + this.errorDetails = errorDetails; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Status of the issue. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonProperty("error_description") + public String getErrorDescription() { + return errorDescription; + } + + @JsonProperty("end_user") + public Optional> getEndUser() { + return endUser; + } + + @JsonProperty("first_incident_time") + public Optional getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonProperty("last_incident_time") + public Optional getLastIncidentTime() { + return lastIncidentTime; + } + + @JsonProperty("is_muted") + public Optional getIsMuted() { + return isMuted; + } + + @JsonProperty("error_details") + public Optional> getErrorDetails() { + return errorDetails; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Issue && equalTo((Issue) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Issue other) { + return id.equals(other.id) + && status.equals(other.status) + && errorDescription.equals(other.errorDescription) + && endUser.equals(other.endUser) + && firstIncidentTime.equals(other.firstIncidentTime) + && lastIncidentTime.equals(other.lastIncidentTime) + && isMuted.equals(other.isMuted) + && errorDetails.equals(other.errorDetails); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.status, + this.errorDescription, + this.endUser, + this.firstIncidentTime, + this.lastIncidentTime, + this.isMuted, + this.errorDetails); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ErrorDescriptionStage builder() { + return new Builder(); + } + + public interface ErrorDescriptionStage { + _FinalStage errorDescription(@NotNull String errorDescription); + + Builder from(Issue other); + } + + public interface _FinalStage { + Issue build(); + + _FinalStage id(Optional id); + + _FinalStage id(String id); + + /** + *

            Status of the issue.

            + */ + _FinalStage status(Optional status); + + _FinalStage status(IssueStatus status); + + _FinalStage endUser(Optional> endUser); + + _FinalStage endUser(Map endUser); + + _FinalStage firstIncidentTime(Optional firstIncidentTime); + + _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + + _FinalStage lastIncidentTime(Optional lastIncidentTime); + + _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + + _FinalStage isMuted(Optional isMuted); + + _FinalStage isMuted(Boolean isMuted); + + _FinalStage errorDetails(Optional> errorDetails); + + _FinalStage errorDetails(List errorDetails); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ErrorDescriptionStage, _FinalStage { + private String errorDescription; + + private Optional> errorDetails = Optional.empty(); + + private Optional isMuted = Optional.empty(); + + private Optional lastIncidentTime = Optional.empty(); + + private Optional firstIncidentTime = Optional.empty(); + + private Optional> endUser = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional id = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(Issue other) { + id(other.getId()); + status(other.getStatus()); + errorDescription(other.getErrorDescription()); + endUser(other.getEndUser()); + firstIncidentTime(other.getFirstIncidentTime()); + lastIncidentTime(other.getLastIncidentTime()); + isMuted(other.getIsMuted()); + errorDetails(other.getErrorDetails()); + return this; + } + + @java.lang.Override + @JsonSetter("error_description") + public _FinalStage errorDescription(@NotNull String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + @java.lang.Override + public _FinalStage errorDetails(List errorDetails) { + this.errorDetails = Optional.ofNullable(errorDetails); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_details", nulls = Nulls.SKIP) + public _FinalStage errorDetails(Optional> errorDetails) { + this.errorDetails = errorDetails; + return this; + } + + @java.lang.Override + public _FinalStage isMuted(Boolean isMuted) { + this.isMuted = Optional.ofNullable(isMuted); + return this; + } + + @java.lang.Override + @JsonSetter(value = "is_muted", nulls = Nulls.SKIP) + public _FinalStage isMuted(Optional isMuted) { + this.isMuted = isMuted; + return this; + } + + @java.lang.Override + public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { + this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_incident_time", nulls = Nulls.SKIP) + public _FinalStage lastIncidentTime(Optional lastIncidentTime) { + this.lastIncidentTime = lastIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { + this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); + return this; + } + + @java.lang.Override + @JsonSetter(value = "first_incident_time", nulls = Nulls.SKIP) + public _FinalStage firstIncidentTime(Optional firstIncidentTime) { + this.firstIncidentTime = firstIncidentTime; + return this; + } + + @java.lang.Override + public _FinalStage endUser(Map endUser) { + this.endUser = Optional.ofNullable(endUser); + return this; + } + + @java.lang.Override + @JsonSetter(value = "end_user", nulls = Nulls.SKIP) + public _FinalStage endUser(Optional> endUser) { + this.endUser = endUser; + return this; + } + + /** + *

            Status of the issue.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(IssueStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

            Status of the issue.

            + */ + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + @java.lang.Override + public _FinalStage id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + @java.lang.Override + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public _FinalStage id(Optional id) { + this.id = id; + return this; + } + + @java.lang.Override + public Issue build() { + return new Issue( + id, + status, + errorDescription, + endUser, + firstIncidentTime, + lastIncidentTime, + isMuted, + errorDetails, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/IssueStatus.java b/src/main/java/com/merge/api/knowledgebase/types/IssueStatus.java new file mode 100644 index 000000000..a3779a7f5 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/IssueStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = IssueStatus.Deserializer.class) +public final class IssueStatus { + private final Object value; + + private final int type; + + private IssueStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((IssueStatusEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssueStatus && equalTo((IssueStatus) other); + } + + private boolean equalTo(IssueStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static IssueStatus of(IssueStatusEnum value) { + return new IssueStatus(value, 0); + } + + public static IssueStatus of(String value) { + return new IssueStatus(value, 1); + } + + public interface Visitor { + T visit(IssueStatusEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(IssueStatus.class); + } + + @java.lang.Override + public IssueStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, IssueStatusEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/IssueStatusEnum.java b/src/main/java/com/merge/api/knowledgebase/types/IssueStatusEnum.java new file mode 100644 index 000000000..1cf433f5d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/IssueStatusEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class IssueStatusEnum { + public static final IssueStatusEnum ONGOING = new IssueStatusEnum(Value.ONGOING, "ONGOING"); + + public static final IssueStatusEnum RESOLVED = new IssueStatusEnum(Value.RESOLVED, "RESOLVED"); + + private final Value value; + + private final String string; + + IssueStatusEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof IssueStatusEnum && this.string.equals(((IssueStatusEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ONGOING: + return visitor.visitOngoing(); + case RESOLVED: + return visitor.visitResolved(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IssueStatusEnum valueOf(String value) { + switch (value) { + case "ONGOING": + return ONGOING; + case "RESOLVED": + return RESOLVED; + default: + return new IssueStatusEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ONGOING, + + RESOLVED, + + UNKNOWN + } + + public interface Visitor { + T visitOngoing(); + + T visitResolved(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/IssuesListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/IssuesListRequest.java new file mode 100644 index 000000000..e2c38ee2a --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/IssuesListRequest.java @@ -0,0 +1,505 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesListRequest.Builder.class) +public final class IssuesListRequest { + private final Optional accountToken; + + private final Optional cursor; + + private final Optional endDate; + + private final Optional endUserOrganizationName; + + private final Optional firstIncidentTimeAfter; + + private final Optional firstIncidentTimeBefore; + + private final Optional includeMuted; + + private final Optional integrationName; + + private final Optional lastIncidentTimeAfter; + + private final Optional lastIncidentTimeBefore; + + private final Optional linkedAccountId; + + private final Optional pageSize; + + private final Optional startDate; + + private final Optional status; + + private final Map additionalProperties; + + private IssuesListRequest( + Optional accountToken, + Optional cursor, + Optional endDate, + Optional endUserOrganizationName, + Optional firstIncidentTimeAfter, + Optional firstIncidentTimeBefore, + Optional includeMuted, + Optional integrationName, + Optional lastIncidentTimeAfter, + Optional lastIncidentTimeBefore, + Optional linkedAccountId, + Optional pageSize, + Optional startDate, + Optional status, + Map additionalProperties) { + this.accountToken = accountToken; + this.cursor = cursor; + this.endDate = endDate; + this.endUserOrganizationName = endUserOrganizationName; + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + this.includeMuted = includeMuted; + this.integrationName = integrationName; + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + this.linkedAccountId = linkedAccountId; + this.pageSize = pageSize; + this.startDate = startDate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("account_token") + public Optional getAccountToken() { + return accountToken; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If included, will only include issues whose most recent action occurred before this time + */ + @JsonProperty("end_date") + public Optional getEndDate() { + return endDate; + } + + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return issues whose first incident time was after this datetime. + */ + @JsonProperty("first_incident_time_after") + public Optional getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose first incident time was before this datetime. + */ + @JsonProperty("first_incident_time_before") + public Optional getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + /** + * @return If true, will include muted issues + */ + @JsonProperty("include_muted") + public Optional getIncludeMuted() { + return includeMuted; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If provided, will only return issues whose last incident time was after this datetime. + */ + @JsonProperty("last_incident_time_after") + public Optional getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + /** + * @return If provided, will only return issues whose last incident time was before this datetime. + */ + @JsonProperty("last_incident_time_before") + public Optional getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + + /** + * @return If provided, will only include issues pertaining to the linked account passed in. + */ + @JsonProperty("linked_account_id") + public Optional getLinkedAccountId() { + return linkedAccountId; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return If included, will only include issues whose most recent action occurred after this time + */ + @JsonProperty("start_date") + public Optional getStartDate() { + return startDate; + } + + /** + * @return Status of the issue. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesListRequest && equalTo((IssuesListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(IssuesListRequest other) { + return accountToken.equals(other.accountToken) + && cursor.equals(other.cursor) + && endDate.equals(other.endDate) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && firstIncidentTimeAfter.equals(other.firstIncidentTimeAfter) + && firstIncidentTimeBefore.equals(other.firstIncidentTimeBefore) + && includeMuted.equals(other.includeMuted) + && integrationName.equals(other.integrationName) + && lastIncidentTimeAfter.equals(other.lastIncidentTimeAfter) + && lastIncidentTimeBefore.equals(other.lastIncidentTimeBefore) + && linkedAccountId.equals(other.linkedAccountId) + && pageSize.equals(other.pageSize) + && startDate.equals(other.startDate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accountToken, + this.cursor, + this.endDate, + this.endUserOrganizationName, + this.firstIncidentTimeAfter, + this.firstIncidentTimeBefore, + this.includeMuted, + this.integrationName, + this.lastIncidentTimeAfter, + this.lastIncidentTimeBefore, + this.linkedAccountId, + this.pageSize, + this.startDate, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accountToken = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endDate = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional firstIncidentTimeAfter = Optional.empty(); + + private Optional firstIncidentTimeBefore = Optional.empty(); + + private Optional includeMuted = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional lastIncidentTimeAfter = Optional.empty(); + + private Optional lastIncidentTimeBefore = Optional.empty(); + + private Optional linkedAccountId = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional startDate = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesListRequest other) { + accountToken(other.getAccountToken()); + cursor(other.getCursor()); + endDate(other.getEndDate()); + endUserOrganizationName(other.getEndUserOrganizationName()); + firstIncidentTimeAfter(other.getFirstIncidentTimeAfter()); + firstIncidentTimeBefore(other.getFirstIncidentTimeBefore()); + includeMuted(other.getIncludeMuted()); + integrationName(other.getIntegrationName()); + lastIncidentTimeAfter(other.getLastIncidentTimeAfter()); + lastIncidentTimeBefore(other.getLastIncidentTimeBefore()); + linkedAccountId(other.getLinkedAccountId()); + pageSize(other.getPageSize()); + startDate(other.getStartDate()); + status(other.getStatus()); + return this; + } + + @JsonSetter(value = "account_token", nulls = Nulls.SKIP) + public Builder accountToken(Optional accountToken) { + this.accountToken = accountToken; + return this; + } + + public Builder accountToken(String accountToken) { + this.accountToken = Optional.ofNullable(accountToken); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            If included, will only include issues whose most recent action occurred before this time

            + */ + @JsonSetter(value = "end_date", nulls = Nulls.SKIP) + public Builder endDate(Optional endDate) { + this.endDate = endDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = Optional.ofNullable(endDate); + return this; + } + + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + /** + *

            If provided, will only return issues whose first incident time was after this datetime.

            + */ + @JsonSetter(value = "first_incident_time_after", nulls = Nulls.SKIP) + public Builder firstIncidentTimeAfter(Optional firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = firstIncidentTimeAfter; + return this; + } + + public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { + this.firstIncidentTimeAfter = Optional.ofNullable(firstIncidentTimeAfter); + return this; + } + + /** + *

            If provided, will only return issues whose first incident time was before this datetime.

            + */ + @JsonSetter(value = "first_incident_time_before", nulls = Nulls.SKIP) + public Builder firstIncidentTimeBefore(Optional firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = firstIncidentTimeBefore; + return this; + } + + public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { + this.firstIncidentTimeBefore = Optional.ofNullable(firstIncidentTimeBefore); + return this; + } + + /** + *

            If true, will include muted issues

            + */ + @JsonSetter(value = "include_muted", nulls = Nulls.SKIP) + public Builder includeMuted(Optional includeMuted) { + this.includeMuted = includeMuted; + return this; + } + + public Builder includeMuted(String includeMuted) { + this.includeMuted = Optional.ofNullable(includeMuted); + return this; + } + + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + /** + *

            If provided, will only return issues whose last incident time was after this datetime.

            + */ + @JsonSetter(value = "last_incident_time_after", nulls = Nulls.SKIP) + public Builder lastIncidentTimeAfter(Optional lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = lastIncidentTimeAfter; + return this; + } + + public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { + this.lastIncidentTimeAfter = Optional.ofNullable(lastIncidentTimeAfter); + return this; + } + + /** + *

            If provided, will only return issues whose last incident time was before this datetime.

            + */ + @JsonSetter(value = "last_incident_time_before", nulls = Nulls.SKIP) + public Builder lastIncidentTimeBefore(Optional lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = lastIncidentTimeBefore; + return this; + } + + public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { + this.lastIncidentTimeBefore = Optional.ofNullable(lastIncidentTimeBefore); + return this; + } + + /** + *

            If provided, will only include issues pertaining to the linked account passed in.

            + */ + @JsonSetter(value = "linked_account_id", nulls = Nulls.SKIP) + public Builder linkedAccountId(Optional linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + public Builder linkedAccountId(String linkedAccountId) { + this.linkedAccountId = Optional.ofNullable(linkedAccountId); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            If included, will only include issues whose most recent action occurred after this time

            + */ + @JsonSetter(value = "start_date", nulls = Nulls.SKIP) + public Builder startDate(Optional startDate) { + this.startDate = startDate; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = Optional.ofNullable(startDate); + return this; + } + + /** + *

            Status of the issue.

            + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(IssuesListRequestStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + public IssuesListRequest build() { + return new IssuesListRequest( + accountToken, + cursor, + endDate, + endUserOrganizationName, + firstIncidentTimeAfter, + firstIncidentTimeBefore, + includeMuted, + integrationName, + lastIncidentTimeAfter, + lastIncidentTimeBefore, + linkedAccountId, + pageSize, + startDate, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/IssuesListRequestStatus.java b/src/main/java/com/merge/api/knowledgebase/types/IssuesListRequestStatus.java new file mode 100644 index 000000000..bcdb95f7d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/IssuesListRequestStatus.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class IssuesListRequestStatus { + public static final IssuesListRequestStatus ONGOING = new IssuesListRequestStatus(Value.ONGOING, "ONGOING"); + + public static final IssuesListRequestStatus RESOLVED = new IssuesListRequestStatus(Value.RESOLVED, "RESOLVED"); + + private final Value value; + + private final String string; + + IssuesListRequestStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof IssuesListRequestStatus + && this.string.equals(((IssuesListRequestStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ONGOING: + return visitor.visitOngoing(); + case RESOLVED: + return visitor.visitResolved(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IssuesListRequestStatus valueOf(String value) { + switch (value) { + case "ONGOING": + return ONGOING; + case "RESOLVED": + return RESOLVED; + default: + return new IssuesListRequestStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + ONGOING, + + RESOLVED, + + UNKNOWN + } + + public interface Visitor { + T visitOngoing(); + + T visitResolved(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/LanguageEnum.java b/src/main/java/com/merge/api/knowledgebase/types/LanguageEnum.java new file mode 100644 index 000000000..5456da76e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/LanguageEnum.java @@ -0,0 +1,82 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LanguageEnum { + public static final LanguageEnum DE = new LanguageEnum(Value.DE, "de"); + + public static final LanguageEnum EN = new LanguageEnum(Value.EN, "en"); + + private final Value value; + + private final String string; + + LanguageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof LanguageEnum && this.string.equals(((LanguageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DE: + return visitor.visitDe(); + case EN: + return visitor.visitEn(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LanguageEnum valueOf(String value) { + switch (value) { + case "de": + return DE; + case "en": + return EN; + default: + return new LanguageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + EN, + + DE, + + UNKNOWN + } + + public interface Visitor { + T visitEn(); + + T visitDe(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/LastSyncResultEnum.java b/src/main/java/com/merge/api/knowledgebase/types/LastSyncResultEnum.java new file mode 100644 index 000000000..3dc5647b4 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/LastSyncResultEnum.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LastSyncResultEnum { + public static final LastSyncResultEnum DISABLED = new LastSyncResultEnum(Value.DISABLED, "DISABLED"); + + public static final LastSyncResultEnum SYNCING = new LastSyncResultEnum(Value.SYNCING, "SYNCING"); + + public static final LastSyncResultEnum PAUSED = new LastSyncResultEnum(Value.PAUSED, "PAUSED"); + + public static final LastSyncResultEnum DONE = new LastSyncResultEnum(Value.DONE, "DONE"); + + public static final LastSyncResultEnum FAILED = new LastSyncResultEnum(Value.FAILED, "FAILED"); + + public static final LastSyncResultEnum PARTIALLY_SYNCED = + new LastSyncResultEnum(Value.PARTIALLY_SYNCED, "PARTIALLY_SYNCED"); + + private final Value value; + + private final String string; + + LastSyncResultEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LastSyncResultEnum && this.string.equals(((LastSyncResultEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISABLED: + return visitor.visitDisabled(); + case SYNCING: + return visitor.visitSyncing(); + case PAUSED: + return visitor.visitPaused(); + case DONE: + return visitor.visitDone(); + case FAILED: + return visitor.visitFailed(); + case PARTIALLY_SYNCED: + return visitor.visitPartiallySynced(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LastSyncResultEnum valueOf(String value) { + switch (value) { + case "DISABLED": + return DISABLED; + case "SYNCING": + return SYNCING; + case "PAUSED": + return PAUSED; + case "DONE": + return DONE; + case "FAILED": + return FAILED; + case "PARTIALLY_SYNCED": + return PARTIALLY_SYNCED; + default: + return new LastSyncResultEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + SYNCING, + + DONE, + + FAILED, + + DISABLED, + + PAUSED, + + PARTIALLY_SYNCED, + + UNKNOWN + } + + public interface Visitor { + T visitSyncing(); + + T visitDone(); + + T visitFailed(); + + T visitDisabled(); + + T visitPaused(); + + T visitPartiallySynced(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/LinkToken.java b/src/main/java/com/merge/api/knowledgebase/types/LinkToken.java new file mode 100644 index 000000000..bcb85d2c1 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/LinkToken.java @@ -0,0 +1,166 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkToken.Builder.class) +public final class LinkToken { + private final String linkToken; + + private final Optional integrationName; + + private final Optional magicLinkUrl; + + private final Map additionalProperties; + + private LinkToken( + String linkToken, + Optional integrationName, + Optional magicLinkUrl, + Map additionalProperties) { + this.linkToken = linkToken; + this.integrationName = integrationName; + this.magicLinkUrl = magicLinkUrl; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("link_token") + public String getLinkToken() { + return linkToken; + } + + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + @JsonProperty("magic_link_url") + public Optional getMagicLinkUrl() { + return magicLinkUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkToken && equalTo((LinkToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkToken other) { + return linkToken.equals(other.linkToken) + && integrationName.equals(other.integrationName) + && magicLinkUrl.equals(other.magicLinkUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkToken, this.integrationName, this.magicLinkUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkTokenStage builder() { + return new Builder(); + } + + public interface LinkTokenStage { + _FinalStage linkToken(@NotNull String linkToken); + + Builder from(LinkToken other); + } + + public interface _FinalStage { + LinkToken build(); + + _FinalStage integrationName(Optional integrationName); + + _FinalStage integrationName(String integrationName); + + _FinalStage magicLinkUrl(Optional magicLinkUrl); + + _FinalStage magicLinkUrl(String magicLinkUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkTokenStage, _FinalStage { + private String linkToken; + + private Optional magicLinkUrl = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LinkToken other) { + linkToken(other.getLinkToken()); + integrationName(other.getIntegrationName()); + magicLinkUrl(other.getMagicLinkUrl()); + return this; + } + + @java.lang.Override + @JsonSetter("link_token") + public _FinalStage linkToken(@NotNull String linkToken) { + this.linkToken = linkToken; + return this; + } + + @java.lang.Override + public _FinalStage magicLinkUrl(String magicLinkUrl) { + this.magicLinkUrl = Optional.ofNullable(magicLinkUrl); + return this; + } + + @java.lang.Override + @JsonSetter(value = "magic_link_url", nulls = Nulls.SKIP) + public _FinalStage magicLinkUrl(Optional magicLinkUrl) { + this.magicLinkUrl = magicLinkUrl; + return this; + } + + @java.lang.Override + public _FinalStage integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public _FinalStage integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + @java.lang.Override + public LinkToken build() { + return new LinkToken(linkToken, integrationName, magicLinkUrl, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountCommonModelScopeDeserializerRequest.java b/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountCommonModelScopeDeserializerRequest.java new file mode 100644 index 000000000..fc1be135d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountCommonModelScopeDeserializerRequest.java @@ -0,0 +1,115 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountCommonModelScopeDeserializerRequest.Builder.class) +public final class LinkedAccountCommonModelScopeDeserializerRequest { + private final List commonModels; + + private final Map additionalProperties; + + private LinkedAccountCommonModelScopeDeserializerRequest( + List commonModels, + Map additionalProperties) { + this.commonModels = commonModels; + this.additionalProperties = additionalProperties; + } + + /** + * @return The common models you want to update the scopes for + */ + @JsonProperty("common_models") + public List getCommonModels() { + return commonModels; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountCommonModelScopeDeserializerRequest + && equalTo((LinkedAccountCommonModelScopeDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountCommonModelScopeDeserializerRequest other) { + return commonModels.equals(other.commonModels); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List commonModels = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountCommonModelScopeDeserializerRequest other) { + commonModels(other.getCommonModels()); + return this; + } + + /** + *

            The common models you want to update the scopes for

            + */ + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(List commonModels) { + this.commonModels.clear(); + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public Builder addCommonModels(IndividualCommonModelScopeDeserializerRequest commonModels) { + this.commonModels.add(commonModels); + return this; + } + + public Builder addAllCommonModels(List commonModels) { + if (commonModels != null) { + this.commonModels.addAll(commonModels); + } + return this; + } + + public LinkedAccountCommonModelScopeDeserializerRequest build() { + return new LinkedAccountCommonModelScopeDeserializerRequest(commonModels, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountsListRequest.java new file mode 100644 index 000000000..c8b2b8a81 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountsListRequest.java @@ -0,0 +1,484 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LinkedAccountsListRequest.Builder.class) +public final class LinkedAccountsListRequest { + private final Optional category; + + private final Optional cursor; + + private final Optional endUserEmailAddress; + + private final Optional endUserOrganizationName; + + private final Optional endUserOriginId; + + private final Optional endUserOriginIds; + + private final Optional id; + + private final Optional ids; + + private final Optional includeDuplicates; + + private final Optional integrationName; + + private final Optional isTestAccount; + + private final Optional pageSize; + + private final Optional status; + + private final Map additionalProperties; + + private LinkedAccountsListRequest( + Optional category, + Optional cursor, + Optional endUserEmailAddress, + Optional endUserOrganizationName, + Optional endUserOriginId, + Optional endUserOriginIds, + Optional id, + Optional ids, + Optional includeDuplicates, + Optional integrationName, + Optional isTestAccount, + Optional pageSize, + Optional status, + Map additionalProperties) { + this.category = category; + this.cursor = cursor; + this.endUserEmailAddress = endUserEmailAddress; + this.endUserOrganizationName = endUserOrganizationName; + this.endUserOriginId = endUserOriginId; + this.endUserOriginIds = endUserOriginIds; + this.id = id; + this.ids = ids; + this.includeDuplicates = includeDuplicates; + this.integrationName = integrationName; + this.isTestAccount = isTestAccount; + this.pageSize = pageSize; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return Options: hris, ats, accounting, ticketing, crm, mktg, filestorage, knowledgebase, chat + */ + @JsonProperty("category") + public Optional getCategory() { + return category; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return If provided, will only return linked accounts associated with the given email address. + */ + @JsonProperty("end_user_email_address") + public Optional getEndUserEmailAddress() { + return endUserEmailAddress; + } + + /** + * @return If provided, will only return linked accounts associated with the given organization name. + */ + @JsonProperty("end_user_organization_name") + public Optional getEndUserOrganizationName() { + return endUserOrganizationName; + } + + /** + * @return If provided, will only return linked accounts associated with the given origin ID. + */ + @JsonProperty("end_user_origin_id") + public Optional getEndUserOriginId() { + return endUserOriginId; + } + + /** + * @return Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + */ + @JsonProperty("end_user_origin_ids") + public Optional getEndUserOriginIds() { + return endUserOriginIds; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + */ + @JsonProperty("ids") + public Optional getIds() { + return ids; + } + + /** + * @return 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. + */ + @JsonProperty("include_duplicates") + public Optional getIncludeDuplicates() { + return includeDuplicates; + } + + /** + * @return If provided, will only return linked accounts associated with the given integration name. + */ + @JsonProperty("integration_name") + public Optional getIntegrationName() { + return integrationName; + } + + /** + * @return If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + */ + @JsonProperty("is_test_account") + public Optional getIsTestAccount() { + return isTestAccount; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LinkedAccountsListRequest && equalTo((LinkedAccountsListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LinkedAccountsListRequest other) { + return category.equals(other.category) + && cursor.equals(other.cursor) + && endUserEmailAddress.equals(other.endUserEmailAddress) + && endUserOrganizationName.equals(other.endUserOrganizationName) + && endUserOriginId.equals(other.endUserOriginId) + && endUserOriginIds.equals(other.endUserOriginIds) + && id.equals(other.id) + && ids.equals(other.ids) + && includeDuplicates.equals(other.includeDuplicates) + && integrationName.equals(other.integrationName) + && isTestAccount.equals(other.isTestAccount) + && pageSize.equals(other.pageSize) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.category, + this.cursor, + this.endUserEmailAddress, + this.endUserOrganizationName, + this.endUserOriginId, + this.endUserOriginIds, + this.id, + this.ids, + this.includeDuplicates, + this.integrationName, + this.isTestAccount, + this.pageSize, + this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional category = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional endUserEmailAddress = Optional.empty(); + + private Optional endUserOrganizationName = Optional.empty(); + + private Optional endUserOriginId = Optional.empty(); + + private Optional endUserOriginIds = Optional.empty(); + + private Optional id = Optional.empty(); + + private Optional ids = Optional.empty(); + + private Optional includeDuplicates = Optional.empty(); + + private Optional integrationName = Optional.empty(); + + private Optional isTestAccount = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional status = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(LinkedAccountsListRequest other) { + category(other.getCategory()); + cursor(other.getCursor()); + endUserEmailAddress(other.getEndUserEmailAddress()); + endUserOrganizationName(other.getEndUserOrganizationName()); + endUserOriginId(other.getEndUserOriginId()); + endUserOriginIds(other.getEndUserOriginIds()); + id(other.getId()); + ids(other.getIds()); + includeDuplicates(other.getIncludeDuplicates()); + integrationName(other.getIntegrationName()); + isTestAccount(other.getIsTestAccount()); + pageSize(other.getPageSize()); + status(other.getStatus()); + return this; + } + + /** + *

            Options: hris, ats, accounting, ticketing, crm, mktg, filestorage, knowledgebase, chat

            + */ + @JsonSetter(value = "category", nulls = Nulls.SKIP) + public Builder category(Optional category) { + this.category = category; + return this; + } + + public Builder category(LinkedAccountsListRequestCategory category) { + this.category = Optional.ofNullable(category); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            If provided, will only return linked accounts associated with the given email address.

            + */ + @JsonSetter(value = "end_user_email_address", nulls = Nulls.SKIP) + public Builder endUserEmailAddress(Optional endUserEmailAddress) { + this.endUserEmailAddress = endUserEmailAddress; + return this; + } + + public Builder endUserEmailAddress(String endUserEmailAddress) { + this.endUserEmailAddress = Optional.ofNullable(endUserEmailAddress); + return this; + } + + /** + *

            If provided, will only return linked accounts associated with the given organization name.

            + */ + @JsonSetter(value = "end_user_organization_name", nulls = Nulls.SKIP) + public Builder endUserOrganizationName(Optional endUserOrganizationName) { + this.endUserOrganizationName = endUserOrganizationName; + return this; + } + + public Builder endUserOrganizationName(String endUserOrganizationName) { + this.endUserOrganizationName = Optional.ofNullable(endUserOrganizationName); + return this; + } + + /** + *

            If provided, will only return linked accounts associated with the given origin ID.

            + */ + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) + public Builder endUserOriginId(Optional endUserOriginId) { + this.endUserOriginId = endUserOriginId; + return this; + } + + public Builder endUserOriginId(String endUserOriginId) { + this.endUserOriginId = Optional.ofNullable(endUserOriginId); + return this; + } + + /** + *

            Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once.

            + */ + @JsonSetter(value = "end_user_origin_ids", nulls = Nulls.SKIP) + public Builder endUserOriginIds(Optional endUserOriginIds) { + this.endUserOriginIds = endUserOriginIds; + return this; + } + + public Builder endUserOriginIds(String endUserOriginIds) { + this.endUserOriginIds = Optional.ofNullable(endUserOriginIds); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

            Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once.

            + */ + @JsonSetter(value = "ids", nulls = Nulls.SKIP) + public Builder ids(Optional ids) { + this.ids = ids; + return this; + } + + public Builder ids(String ids) { + this.ids = Optional.ofNullable(ids); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "include_duplicates", nulls = Nulls.SKIP) + public Builder includeDuplicates(Optional includeDuplicates) { + this.includeDuplicates = includeDuplicates; + return this; + } + + public Builder includeDuplicates(Boolean includeDuplicates) { + this.includeDuplicates = Optional.ofNullable(includeDuplicates); + return this; + } + + /** + *

            If provided, will only return linked accounts associated with the given integration name.

            + */ + @JsonSetter(value = "integration_name", nulls = Nulls.SKIP) + public Builder integrationName(Optional integrationName) { + this.integrationName = integrationName; + return this; + } + + public Builder integrationName(String integrationName) { + this.integrationName = Optional.ofNullable(integrationName); + return this; + } + + /** + *

            If included, will only include test linked accounts. If not included, will only include non-test linked accounts.

            + */ + @JsonSetter(value = "is_test_account", nulls = Nulls.SKIP) + public Builder isTestAccount(Optional isTestAccount) { + this.isTestAccount = isTestAccount; + return this; + } + + public Builder isTestAccount(String isTestAccount) { + this.isTestAccount = Optional.ofNullable(isTestAccount); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            Filter by status. Options: COMPLETE, IDLE, INCOMPLETE, RELINK_NEEDED

            + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + public LinkedAccountsListRequest build() { + return new LinkedAccountsListRequest( + category, + cursor, + endUserEmailAddress, + endUserOrganizationName, + endUserOriginId, + endUserOriginIds, + id, + ids, + includeDuplicates, + integrationName, + isTestAccount, + pageSize, + status, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountsListRequestCategory.java b/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountsListRequestCategory.java new file mode 100644 index 000000000..a14363098 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/LinkedAccountsListRequestCategory.java @@ -0,0 +1,161 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LinkedAccountsListRequestCategory { + public static final LinkedAccountsListRequestCategory HRIS = + new LinkedAccountsListRequestCategory(Value.HRIS, "hris"); + + public static final LinkedAccountsListRequestCategory KNOWLEDGEBASE = + new LinkedAccountsListRequestCategory(Value.KNOWLEDGEBASE, "knowledgebase"); + + public static final LinkedAccountsListRequestCategory TICKETING = + new LinkedAccountsListRequestCategory(Value.TICKETING, "ticketing"); + + public static final LinkedAccountsListRequestCategory CRM = new LinkedAccountsListRequestCategory(Value.CRM, "crm"); + + public static final LinkedAccountsListRequestCategory FILESTORAGE = + new LinkedAccountsListRequestCategory(Value.FILESTORAGE, "filestorage"); + + public static final LinkedAccountsListRequestCategory ACCOUNTING = + new LinkedAccountsListRequestCategory(Value.ACCOUNTING, "accounting"); + + public static final LinkedAccountsListRequestCategory MKTG = + new LinkedAccountsListRequestCategory(Value.MKTG, "mktg"); + + public static final LinkedAccountsListRequestCategory ATS = new LinkedAccountsListRequestCategory(Value.ATS, "ats"); + + public static final LinkedAccountsListRequestCategory CHAT = + new LinkedAccountsListRequestCategory(Value.CHAT, "chat"); + + private final Value value; + + private final String string; + + LinkedAccountsListRequestCategory(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LinkedAccountsListRequestCategory + && this.string.equals(((LinkedAccountsListRequestCategory) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HRIS: + return visitor.visitHris(); + case KNOWLEDGEBASE: + return visitor.visitKnowledgebase(); + case TICKETING: + return visitor.visitTicketing(); + case CRM: + return visitor.visitCrm(); + case FILESTORAGE: + return visitor.visitFilestorage(); + case ACCOUNTING: + return visitor.visitAccounting(); + case MKTG: + return visitor.visitMktg(); + case ATS: + return visitor.visitAts(); + case CHAT: + return visitor.visitChat(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LinkedAccountsListRequestCategory valueOf(String value) { + switch (value) { + case "hris": + return HRIS; + case "knowledgebase": + return KNOWLEDGEBASE; + case "ticketing": + return TICKETING; + case "crm": + return CRM; + case "filestorage": + return FILESTORAGE; + case "accounting": + return ACCOUNTING; + case "mktg": + return MKTG; + case "ats": + return ATS; + case "chat": + return CHAT; + default: + return new LinkedAccountsListRequestCategory(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNTING, + + ATS, + + CHAT, + + CRM, + + FILESTORAGE, + + HRIS, + + KNOWLEDGEBASE, + + MKTG, + + TICKETING, + + UNKNOWN + } + + public interface Visitor { + T visitAccounting(); + + T visitAts(); + + T visitChat(); + + T visitCrm(); + + T visitFilestorage(); + + T visitHris(); + + T visitKnowledgebase(); + + T visitMktg(); + + T visitTicketing(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/MethodEnum.java b/src/main/java/com/merge/api/knowledgebase/types/MethodEnum.java new file mode 100644 index 000000000..75e5f0fa4 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/MethodEnum.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class MethodEnum { + public static final MethodEnum OPTIONS = new MethodEnum(Value.OPTIONS, "OPTIONS"); + + public static final MethodEnum PATCH = new MethodEnum(Value.PATCH, "PATCH"); + + public static final MethodEnum DELETE = new MethodEnum(Value.DELETE, "DELETE"); + + public static final MethodEnum GET = new MethodEnum(Value.GET, "GET"); + + public static final MethodEnum PUT = new MethodEnum(Value.PUT, "PUT"); + + public static final MethodEnum HEAD = new MethodEnum(Value.HEAD, "HEAD"); + + public static final MethodEnum POST = new MethodEnum(Value.POST, "POST"); + + private final Value value; + + private final String string; + + MethodEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof MethodEnum && this.string.equals(((MethodEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OPTIONS: + return visitor.visitOptions(); + case PATCH: + return visitor.visitPatch(); + case DELETE: + return visitor.visitDelete(); + case GET: + return visitor.visitGet(); + case PUT: + return visitor.visitPut(); + case HEAD: + return visitor.visitHead(); + case POST: + return visitor.visitPost(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static MethodEnum valueOf(String value) { + switch (value) { + case "OPTIONS": + return OPTIONS; + case "PATCH": + return PATCH; + case "DELETE": + return DELETE; + case "GET": + return GET; + case "PUT": + return PUT; + case "HEAD": + return HEAD; + case "POST": + return POST; + default: + return new MethodEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + GET, + + OPTIONS, + + HEAD, + + POST, + + PUT, + + PATCH, + + DELETE, + + UNKNOWN + } + + public interface Visitor { + T visitGet(); + + T visitOptions(); + + T visitHead(); + + T visitPost(); + + T visitPut(); + + T visitPatch(); + + T visitDelete(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ModelOperation.java b/src/main/java/com/merge/api/knowledgebase/types/ModelOperation.java new file mode 100644 index 000000000..f52b97952 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ModelOperation.java @@ -0,0 +1,238 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelOperation.Builder.class) +public final class ModelOperation { + private final String modelName; + + private final List availableOperations; + + private final List requiredPostParameters; + + private final List supportedFields; + + private final Map additionalProperties; + + private ModelOperation( + String modelName, + List availableOperations, + List requiredPostParameters, + List supportedFields, + Map additionalProperties) { + this.modelName = modelName; + this.availableOperations = availableOperations; + this.requiredPostParameters = requiredPostParameters; + this.supportedFields = supportedFields; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("available_operations") + public List getAvailableOperations() { + return availableOperations; + } + + @JsonProperty("required_post_parameters") + public List getRequiredPostParameters() { + return requiredPostParameters; + } + + @JsonProperty("supported_fields") + public List getSupportedFields() { + return supportedFields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelOperation && equalTo((ModelOperation) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelOperation other) { + return modelName.equals(other.modelName) + && availableOperations.equals(other.availableOperations) + && requiredPostParameters.equals(other.requiredPostParameters) + && supportedFields.equals(other.supportedFields); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, this.availableOperations, this.requiredPostParameters, this.supportedFields); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + _FinalStage modelName(@NotNull String modelName); + + Builder from(ModelOperation other); + } + + public interface _FinalStage { + ModelOperation build(); + + _FinalStage availableOperations(List availableOperations); + + _FinalStage addAvailableOperations(String availableOperations); + + _FinalStage addAllAvailableOperations(List availableOperations); + + _FinalStage requiredPostParameters(List requiredPostParameters); + + _FinalStage addRequiredPostParameters(String requiredPostParameters); + + _FinalStage addAllRequiredPostParameters(List requiredPostParameters); + + _FinalStage supportedFields(List supportedFields); + + _FinalStage addSupportedFields(String supportedFields); + + _FinalStage addAllSupportedFields(List supportedFields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements ModelNameStage, _FinalStage { + private String modelName; + + private List supportedFields = new ArrayList<>(); + + private List requiredPostParameters = new ArrayList<>(); + + private List availableOperations = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ModelOperation other) { + modelName(other.getModelName()); + availableOperations(other.getAvailableOperations()); + requiredPostParameters(other.getRequiredPostParameters()); + supportedFields(other.getSupportedFields()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public _FinalStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + public _FinalStage addAllSupportedFields(List supportedFields) { + if (supportedFields != null) { + this.supportedFields.addAll(supportedFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addSupportedFields(String supportedFields) { + this.supportedFields.add(supportedFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "supported_fields", nulls = Nulls.SKIP) + public _FinalStage supportedFields(List supportedFields) { + this.supportedFields.clear(); + if (supportedFields != null) { + this.supportedFields.addAll(supportedFields); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllRequiredPostParameters(List requiredPostParameters) { + if (requiredPostParameters != null) { + this.requiredPostParameters.addAll(requiredPostParameters); + } + return this; + } + + @java.lang.Override + public _FinalStage addRequiredPostParameters(String requiredPostParameters) { + this.requiredPostParameters.add(requiredPostParameters); + return this; + } + + @java.lang.Override + @JsonSetter(value = "required_post_parameters", nulls = Nulls.SKIP) + public _FinalStage requiredPostParameters(List requiredPostParameters) { + this.requiredPostParameters.clear(); + if (requiredPostParameters != null) { + this.requiredPostParameters.addAll(requiredPostParameters); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableOperations(List availableOperations) { + if (availableOperations != null) { + this.availableOperations.addAll(availableOperations); + } + return this; + } + + @java.lang.Override + public _FinalStage addAvailableOperations(String availableOperations) { + this.availableOperations.add(availableOperations); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_operations", nulls = Nulls.SKIP) + public _FinalStage availableOperations(List availableOperations) { + this.availableOperations.clear(); + if (availableOperations != null) { + this.availableOperations.addAll(availableOperations); + } + return this; + } + + @java.lang.Override + public ModelOperation build() { + return new ModelOperation( + modelName, availableOperations, requiredPostParameters, supportedFields, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ModelPermissionDeserializer.java b/src/main/java/com/merge/api/knowledgebase/types/ModelPermissionDeserializer.java new file mode 100644 index 000000000..2476feb83 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ModelPermissionDeserializer.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializer.Builder.class) +public final class ModelPermissionDeserializer { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializer(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializer && equalTo((ModelPermissionDeserializer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializer other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializer other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializer build() { + return new ModelPermissionDeserializer(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ModelPermissionDeserializerRequest.java b/src/main/java/com/merge/api/knowledgebase/types/ModelPermissionDeserializerRequest.java new file mode 100644 index 000000000..08e98206e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ModelPermissionDeserializerRequest.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ModelPermissionDeserializerRequest.Builder.class) +public final class ModelPermissionDeserializerRequest { + private final Optional isEnabled; + + private final Map additionalProperties; + + private ModelPermissionDeserializerRequest(Optional isEnabled, Map additionalProperties) { + this.isEnabled = isEnabled; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("is_enabled") + public Optional getIsEnabled() { + return isEnabled; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ModelPermissionDeserializerRequest + && equalTo((ModelPermissionDeserializerRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ModelPermissionDeserializerRequest other) { + return isEnabled.equals(other.isEnabled); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.isEnabled); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional isEnabled = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ModelPermissionDeserializerRequest other) { + isEnabled(other.getIsEnabled()); + return this; + } + + @JsonSetter(value = "is_enabled", nulls = Nulls.SKIP) + public Builder isEnabled(Optional isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = Optional.ofNullable(isEnabled); + return this; + } + + public ModelPermissionDeserializerRequest build() { + return new ModelPermissionDeserializerRequest(isEnabled, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/knowledgebase/types/MultipartFormFieldRequest.java new file mode 100644 index 000000000..7e6c96cfe --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/MultipartFormFieldRequest.java @@ -0,0 +1,281 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = MultipartFormFieldRequest.Builder.class) +public final class MultipartFormFieldRequest { + private final String name; + + private final String data; + + private final Optional encoding; + + private final Optional fileName; + + private final Optional contentType; + + private final Map additionalProperties; + + private MultipartFormFieldRequest( + String name, + String data, + Optional encoding, + Optional fileName, + Optional contentType, + Map additionalProperties) { + this.name = name; + this.data = data; + this.encoding = encoding; + this.fileName = fileName; + this.contentType = contentType; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the form field + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The data for the form field. + */ + @JsonProperty("data") + public String getData() { + return data; + } + + /** + * @return The encoding of the value of data. Defaults to RAW if not defined. + */ + @JsonProperty("encoding") + public Optional getEncoding() { + return encoding; + } + + /** + * @return The file name of the form field, if the field is for a file. + */ + @JsonProperty("file_name") + public Optional getFileName() { + return fileName; + } + + /** + * @return The MIME type of the file, if the field is for a file. + */ + @JsonProperty("content_type") + public Optional getContentType() { + return contentType; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequest && equalTo((MultipartFormFieldRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(MultipartFormFieldRequest other) { + return name.equals(other.name) + && data.equals(other.data) + && encoding.equals(other.encoding) + && fileName.equals(other.fileName) + && contentType.equals(other.contentType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.data, this.encoding, this.fileName, this.contentType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

            The name of the form field

            + */ + DataStage name(@NotNull String name); + + Builder from(MultipartFormFieldRequest other); + } + + public interface DataStage { + /** + *

            The data for the form field.

            + */ + _FinalStage data(@NotNull String data); + } + + public interface _FinalStage { + MultipartFormFieldRequest build(); + + /** + *

            The encoding of the value of data. Defaults to RAW if not defined.

            + */ + _FinalStage encoding(Optional encoding); + + _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); + + /** + *

            The file name of the form field, if the field is for a file.

            + */ + _FinalStage fileName(Optional fileName); + + _FinalStage fileName(String fileName); + + /** + *

            The MIME type of the file, if the field is for a file.

            + */ + _FinalStage contentType(Optional contentType); + + _FinalStage contentType(String contentType); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, DataStage, _FinalStage { + private String name; + + private String data; + + private Optional contentType = Optional.empty(); + + private Optional fileName = Optional.empty(); + + private Optional encoding = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(MultipartFormFieldRequest other) { + name(other.getName()); + data(other.getData()); + encoding(other.getEncoding()); + fileName(other.getFileName()); + contentType(other.getContentType()); + return this; + } + + /** + *

            The name of the form field

            + *

            The name of the form field

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public DataStage name(@NotNull String name) { + this.name = name; + return this; + } + + /** + *

            The data for the form field.

            + *

            The data for the form field.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("data") + public _FinalStage data(@NotNull String data) { + this.data = data; + return this; + } + + /** + *

            The MIME type of the file, if the field is for a file.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contentType(String contentType) { + this.contentType = Optional.ofNullable(contentType); + return this; + } + + /** + *

            The MIME type of the file, if the field is for a file.

            + */ + @java.lang.Override + @JsonSetter(value = "content_type", nulls = Nulls.SKIP) + public _FinalStage contentType(Optional contentType) { + this.contentType = contentType; + return this; + } + + /** + *

            The file name of the form field, if the field is for a file.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage fileName(String fileName) { + this.fileName = Optional.ofNullable(fileName); + return this; + } + + /** + *

            The file name of the form field, if the field is for a file.

            + */ + @java.lang.Override + @JsonSetter(value = "file_name", nulls = Nulls.SKIP) + public _FinalStage fileName(Optional fileName) { + this.fileName = fileName; + return this; + } + + /** + *

            The encoding of the value of data. Defaults to RAW if not defined.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(MultipartFormFieldRequestEncoding encoding) { + this.encoding = Optional.ofNullable(encoding); + return this; + } + + /** + *

            The encoding of the value of data. Defaults to RAW if not defined.

            + */ + @java.lang.Override + @JsonSetter(value = "encoding", nulls = Nulls.SKIP) + public _FinalStage encoding(Optional encoding) { + this.encoding = encoding; + return this; + } + + @java.lang.Override + public MultipartFormFieldRequest build() { + return new MultipartFormFieldRequest(name, data, encoding, fileName, contentType, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/MultipartFormFieldRequestEncoding.java b/src/main/java/com/merge/api/knowledgebase/types/MultipartFormFieldRequestEncoding.java new file mode 100644 index 000000000..83d2d17a8 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/MultipartFormFieldRequestEncoding.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = MultipartFormFieldRequestEncoding.Deserializer.class) +public final class MultipartFormFieldRequestEncoding { + private final Object value; + + private final int type; + + private MultipartFormFieldRequestEncoding(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EncodingEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof MultipartFormFieldRequestEncoding && equalTo((MultipartFormFieldRequestEncoding) other); + } + + private boolean equalTo(MultipartFormFieldRequestEncoding other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static MultipartFormFieldRequestEncoding of(EncodingEnum value) { + return new MultipartFormFieldRequestEncoding(value, 0); + } + + public static MultipartFormFieldRequestEncoding of(String value) { + return new MultipartFormFieldRequestEncoding(value, 1); + } + + public interface Visitor { + T visit(EncodingEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(MultipartFormFieldRequestEncoding.class); + } + + @java.lang.Override + public MultipartFormFieldRequestEncoding deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EncodingEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedAccountDetailsAndActionsList.java new file mode 100644 index 000000000..6ead4b3aa --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedAccountDetailsAndActionsList.java @@ -0,0 +1,145 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAccountDetailsAndActionsList.Builder.class) +public final class PaginatedAccountDetailsAndActionsList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAccountDetailsAndActionsList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAccountDetailsAndActionsList + && equalTo((PaginatedAccountDetailsAndActionsList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAccountDetailsAndActionsList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAccountDetailsAndActionsList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAccountDetailsAndActionsList build() { + return new PaginatedAccountDetailsAndActionsList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedArticleList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedArticleList.java new file mode 100644 index 000000000..a579e71cb --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedArticleList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedArticleList.Builder.class) +public final class PaginatedArticleList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedArticleList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedArticleList && equalTo((PaginatedArticleList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedArticleList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedArticleList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List
            results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedArticleList build() { + return new PaginatedArticleList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedAttachmentList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedAttachmentList.java new file mode 100644 index 000000000..2b298732b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedAttachmentList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAttachmentList.Builder.class) +public final class PaginatedAttachmentList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAttachmentList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAttachmentList && equalTo((PaginatedAttachmentList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAttachmentList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAttachmentList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAttachmentList build() { + return new PaginatedAttachmentList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedAuditLogEventList.java new file mode 100644 index 000000000..10ccfba6d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedAuditLogEventList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedAuditLogEventList.Builder.class) +public final class PaginatedAuditLogEventList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedAuditLogEventList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedAuditLogEventList && equalTo((PaginatedAuditLogEventList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedAuditLogEventList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedAuditLogEventList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedAuditLogEventList build() { + return new PaginatedAuditLogEventList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedContainerList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedContainerList.java new file mode 100644 index 000000000..26d562ebf --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedContainerList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedContainerList.Builder.class) +public final class PaginatedContainerList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedContainerList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedContainerList && equalTo((PaginatedContainerList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedContainerList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedContainerList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedContainerList build() { + return new PaginatedContainerList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedGroupList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedGroupList.java new file mode 100644 index 000000000..303bf5653 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedGroupList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedGroupList.Builder.class) +public final class PaginatedGroupList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedGroupList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedGroupList && equalTo((PaginatedGroupList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedGroupList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedGroupList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedGroupList build() { + return new PaginatedGroupList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedIssueList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedIssueList.java new file mode 100644 index 000000000..a66ae4fe3 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedIssueList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedIssueList.Builder.class) +public final class PaginatedIssueList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedIssueList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedIssueList && equalTo((PaginatedIssueList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedIssueList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedIssueList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedIssueList build() { + return new PaginatedIssueList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedSyncStatusList.java new file mode 100644 index 000000000..1887d56ae --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedSyncStatusList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedSyncStatusList.Builder.class) +public final class PaginatedSyncStatusList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedSyncStatusList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedSyncStatusList && equalTo((PaginatedSyncStatusList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedSyncStatusList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedSyncStatusList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedSyncStatusList build() { + return new PaginatedSyncStatusList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PaginatedUserList.java b/src/main/java/com/merge/api/knowledgebase/types/PaginatedUserList.java new file mode 100644 index 000000000..ec3ba3f9f --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PaginatedUserList.java @@ -0,0 +1,144 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaginatedUserList.Builder.class) +public final class PaginatedUserList { + private final Optional next; + + private final Optional previous; + + private final Optional> results; + + private final Map additionalProperties; + + private PaginatedUserList( + Optional next, + Optional previous, + Optional> results, + Map additionalProperties) { + this.next = next; + this.previous = previous; + this.results = results; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("next") + public Optional getNext() { + return next; + } + + @JsonProperty("previous") + public Optional getPrevious() { + return previous; + } + + @JsonProperty("results") + public Optional> getResults() { + return results; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaginatedUserList && equalTo((PaginatedUserList) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PaginatedUserList other) { + return next.equals(other.next) && previous.equals(other.previous) && results.equals(other.results); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.next, this.previous, this.results); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional next = Optional.empty(); + + private Optional previous = Optional.empty(); + + private Optional> results = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaginatedUserList other) { + next(other.getNext()); + previous(other.getPrevious()); + results(other.getResults()); + return this; + } + + @JsonSetter(value = "next", nulls = Nulls.SKIP) + public Builder next(Optional next) { + this.next = next; + return this; + } + + public Builder next(String next) { + this.next = Optional.ofNullable(next); + return this; + } + + @JsonSetter(value = "previous", nulls = Nulls.SKIP) + public Builder previous(Optional previous) { + this.previous = previous; + return this; + } + + public Builder previous(String previous) { + this.previous = Optional.ofNullable(previous); + return this; + } + + @JsonSetter(value = "results", nulls = Nulls.SKIP) + public Builder results(Optional> results) { + this.results = results; + return this; + } + + public Builder results(List results) { + this.results = Optional.ofNullable(results); + return this; + } + + public PaginatedUserList build() { + return new PaginatedUserList(next, previous, results, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/knowledgebase/types/PatchedEditFieldMappingRequest.java new file mode 100644 index 000000000..fb565a535 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PatchedEditFieldMappingRequest.java @@ -0,0 +1,268 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) +public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + + private final Optional> remoteFieldTraversalPath; + + private final Optional remoteMethod; + + private final Optional remoteUrlPath; + + private final Optional jmesPath; + + private final Optional advancedMappingExpression; + + private final Map additionalProperties; + + private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, + Optional> remoteFieldTraversalPath, + Optional remoteMethod, + Optional remoteUrlPath, + Optional jmesPath, + Optional advancedMappingExpression, + Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + this.remoteMethod = remoteMethod; + this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; + this.advancedMappingExpression = advancedMappingExpression; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + + /** + * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + */ + @JsonProperty("remote_field_traversal_path") + public Optional> getRemoteFieldTraversalPath() { + return remoteFieldTraversalPath; + } + + /** + * @return The method of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_method") + public Optional getRemoteMethod() { + return remoteMethod; + } + + /** + * @return The path of the remote endpoint where the remote field is coming from. + */ + @JsonProperty("remote_url_path") + public Optional getRemoteUrlPath() { + return remoteUrlPath; + } + + /** + * @return DEPRECATED: Use 'advanced_mapping_expression' instead. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + + /** + * @return A JSONata expression used to transform the remote field data. + */ + @JsonProperty("advanced_mapping_expression") + public Optional getAdvancedMappingExpression() { + return advancedMappingExpression; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PatchedEditFieldMappingRequest && equalTo((PatchedEditFieldMappingRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PatchedEditFieldMappingRequest other) { + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + && remoteMethod.equals(other.remoteMethod) + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath) + && advancedMappingExpression.equals(other.advancedMappingExpression); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath, + this.advancedMappingExpression); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + + private Optional> remoteFieldTraversalPath = Optional.empty(); + + private Optional remoteMethod = Optional.empty(); + + private Optional remoteUrlPath = Optional.empty(); + + private Optional jmesPath = Optional.empty(); + + private Optional advancedMappingExpression = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); + remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); + remoteMethod(other.getRemoteMethod()); + remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + advancedMappingExpression(other.getAdvancedMappingExpression()); + return this; + } + + /** + *

            Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

            + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

            The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

            + */ + @JsonSetter(value = "remote_field_traversal_path", nulls = Nulls.SKIP) + public Builder remoteFieldTraversalPath(Optional> remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = remoteFieldTraversalPath; + return this; + } + + public Builder remoteFieldTraversalPath(List remoteFieldTraversalPath) { + this.remoteFieldTraversalPath = Optional.ofNullable(remoteFieldTraversalPath); + return this; + } + + /** + *

            The method of the remote endpoint where the remote field is coming from.

            + */ + @JsonSetter(value = "remote_method", nulls = Nulls.SKIP) + public Builder remoteMethod(Optional remoteMethod) { + this.remoteMethod = remoteMethod; + return this; + } + + public Builder remoteMethod(String remoteMethod) { + this.remoteMethod = Optional.ofNullable(remoteMethod); + return this; + } + + /** + *

            The path of the remote endpoint where the remote field is coming from.

            + */ + @JsonSetter(value = "remote_url_path", nulls = Nulls.SKIP) + public Builder remoteUrlPath(Optional remoteUrlPath) { + this.remoteUrlPath = remoteUrlPath; + return this; + } + + public Builder remoteUrlPath(String remoteUrlPath) { + this.remoteUrlPath = Optional.ofNullable(remoteUrlPath); + return this; + } + + /** + *

            DEPRECATED: Use 'advanced_mapping_expression' instead.

            + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

            A JSONata expression used to transform the remote field data.

            + */ + @JsonSetter(value = "advanced_mapping_expression", nulls = Nulls.SKIP) + public Builder advancedMappingExpression(Optional advancedMappingExpression) { + this.advancedMappingExpression = advancedMappingExpression; + return this; + } + + public Builder advancedMappingExpression(String advancedMappingExpression) { + this.advancedMappingExpression = Optional.ofNullable(advancedMappingExpression); + return this; + } + + public PatchedEditFieldMappingRequest build() { + return new PatchedEditFieldMappingRequest( + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + advancedMappingExpression, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/Permission.java b/src/main/java/com/merge/api/knowledgebase/types/Permission.java new file mode 100644 index 000000000..afb5ea7df --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/Permission.java @@ -0,0 +1,372 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Permission.Builder.class) +public final class Permission { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional user; + + private final Optional group; + + private final Optional type; + + private final Optional>> roles; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Map additionalProperties; + + private Permission( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional user, + Optional group, + Optional type, + Optional>> roles, + Optional remoteWasDeleted, + Optional fieldMappings, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.user = user; + this.group = group; + this.type = type; + this.roles = roles; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + @JsonProperty("user") + public Optional getUser() { + return user; + } + + @JsonProperty("group") + public Optional getGroup() { + return group; + } + + /** + * @return Denotes what type of people have access to the Article or Container. + */ + @JsonProperty("type") + public Optional getType() { + return type; + } + + /** + * @return 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. + */ + @JsonProperty("roles") + public Optional>> getRoles() { + return roles; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Permission && equalTo((Permission) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Permission other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && user.equals(other.user) + && group.equals(other.group) + && type.equals(other.type) + && roles.equals(other.roles) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.user, + this.group, + this.type, + this.roles, + this.remoteWasDeleted, + this.fieldMappings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional user = Optional.empty(); + + private Optional group = Optional.empty(); + + private Optional type = Optional.empty(); + + private Optional>> roles = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Permission other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + user(other.getUser()); + group(other.getGroup()); + type(other.getType()); + roles(other.getRoles()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

            The third-party API ID of the matching object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            The datetime that this object was created by Merge.

            + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

            The datetime that this object was modified by Merge.

            + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + @JsonSetter(value = "user", nulls = Nulls.SKIP) + public Builder user(Optional user) { + this.user = user; + return this; + } + + public Builder user(PermissionUser user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "group", nulls = Nulls.SKIP) + public Builder group(Optional group) { + this.group = group; + return this; + } + + public Builder group(PermissionGroup group) { + this.group = Optional.ofNullable(group); + return this; + } + + /** + *

            Denotes what type of people have access to the Article or Container.

            + */ + @JsonSetter(value = "type", nulls = Nulls.SKIP) + public Builder type(Optional type) { + this.type = type; + return this; + } + + public Builder type(PermissionType type) { + this.type = Optional.ofNullable(type); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional>> roles) { + this.roles = roles; + return this; + } + + public Builder roles(List> roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(PermissionFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + public Permission build() { + return new Permission( + id, + remoteId, + createdAt, + modifiedAt, + user, + group, + type, + roles, + remoteWasDeleted, + fieldMappings, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PermissionFieldMappings.java b/src/main/java/com/merge/api/knowledgebase/types/PermissionFieldMappings.java new file mode 100644 index 000000000..62578a3b8 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PermissionFieldMappings.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PermissionFieldMappings.Builder.class) +public final class PermissionFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private PermissionFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionFieldMappings && equalTo((PermissionFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PermissionFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PermissionFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public PermissionFieldMappings build() { + return new PermissionFieldMappings( + organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PermissionGroup.java b/src/main/java/com/merge/api/knowledgebase/types/PermissionGroup.java new file mode 100644 index 000000000..32534e404 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PermissionGroup.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionGroup.Deserializer.class) +public final class PermissionGroup { + private final Object value; + + private final int type; + + private PermissionGroup(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Group) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionGroup && equalTo((PermissionGroup) other); + } + + private boolean equalTo(PermissionGroup other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PermissionGroup of(String value) { + return new PermissionGroup(value, 0); + } + + public static PermissionGroup of(Group value) { + return new PermissionGroup(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Group value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionGroup.class); + } + + @java.lang.Override + public PermissionGroup deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Group.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PermissionType.java b/src/main/java/com/merge/api/knowledgebase/types/PermissionType.java new file mode 100644 index 000000000..f8509600b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PermissionType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionType.Deserializer.class) +public final class PermissionType { + private final Object value; + + private final int type; + + private PermissionType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((PermissionTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionType && equalTo((PermissionType) other); + } + + private boolean equalTo(PermissionType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PermissionType of(PermissionTypeEnum value) { + return new PermissionType(value, 0); + } + + public static PermissionType of(String value) { + return new PermissionType(value, 1); + } + + public interface Visitor { + T visit(PermissionTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionType.class); + } + + @java.lang.Override + public PermissionType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, PermissionTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PermissionTypeEnum.java b/src/main/java/com/merge/api/knowledgebase/types/PermissionTypeEnum.java new file mode 100644 index 000000000..2857664fd --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PermissionTypeEnum.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class PermissionTypeEnum { + public static final PermissionTypeEnum GROUP = new PermissionTypeEnum(Value.GROUP, "GROUP"); + + public static final PermissionTypeEnum USER = new PermissionTypeEnum(Value.USER, "USER"); + + public static final PermissionTypeEnum COMPANY = new PermissionTypeEnum(Value.COMPANY, "COMPANY"); + + public static final PermissionTypeEnum ANYONE = new PermissionTypeEnum(Value.ANYONE, "ANYONE"); + + private final Value value; + + private final String string; + + PermissionTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof PermissionTypeEnum && this.string.equals(((PermissionTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case GROUP: + return visitor.visitGroup(); + case USER: + return visitor.visitUser(); + case COMPANY: + return visitor.visitCompany(); + case ANYONE: + return visitor.visitAnyone(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PermissionTypeEnum valueOf(String value) { + switch (value) { + case "GROUP": + return GROUP; + case "USER": + return USER; + case "COMPANY": + return COMPANY; + case "ANYONE": + return ANYONE; + default: + return new PermissionTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + USER, + + GROUP, + + COMPANY, + + ANYONE, + + UNKNOWN + } + + public interface Visitor { + T visitUser(); + + T visitGroup(); + + T visitCompany(); + + T visitAnyone(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/PermissionUser.java b/src/main/java/com/merge/api/knowledgebase/types/PermissionUser.java new file mode 100644 index 000000000..b5c640907 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/PermissionUser.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionUser.Deserializer.class) +public final class PermissionUser { + private final Object value; + + private final int type; + + private PermissionUser(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((User) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionUser && equalTo((PermissionUser) other); + } + + private boolean equalTo(PermissionUser other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PermissionUser of(String value) { + return new PermissionUser(value, 0); + } + + public static PermissionUser of(User value) { + return new PermissionUser(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(User value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionUser.class); + } + + @java.lang.Override + public PermissionUser deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, User.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/knowledgebase/types/RegenerateAccountToken.java new file mode 100644 index 000000000..58b2dc823 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteData.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteData.java new file mode 100644 index 000000000..fe4130080 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteData.java @@ -0,0 +1,157 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteData.Builder.class) +public final class RemoteData { + private final String path; + + private final Optional data; + + private final Map additionalProperties; + + private RemoteData(String path, Optional data, Map additionalProperties) { + this.path = path; + this.data = data; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API path that is being called. + */ + @JsonProperty("path") + public String getPath() { + return path; + } + + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ + @JsonProperty("data") + public Optional getData() { + return data; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteData && equalTo((RemoteData) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteData other) { + return path.equals(other.path) && data.equals(other.data); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.path, this.data); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PathStage builder() { + return new Builder(); + } + + public interface PathStage { + /** + *

            The third-party API path that is being called.

            + */ + _FinalStage path(@NotNull String path); + + Builder from(RemoteData other); + } + + public interface _FinalStage { + RemoteData build(); + + /** + *

            The data returned from the third-party for this object in its original, unnormalized format.

            + */ + _FinalStage data(Optional data); + + _FinalStage data(JsonNode data); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PathStage, _FinalStage { + private String path; + + private Optional data = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteData other) { + path(other.getPath()); + data(other.getData()); + return this; + } + + /** + *

            The third-party API path that is being called.

            + *

            The third-party API path that is being called.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("path") + public _FinalStage path(@NotNull String path) { + this.path = path; + return this; + } + + /** + *

            The data returned from the third-party for this object in its original, unnormalized format.

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage data(JsonNode data) { + this.data = Optional.ofNullable(data); + return this; + } + + /** + *

            The data returned from the third-party for this object in its original, unnormalized format.

            + */ + @java.lang.Override + @JsonSetter(value = "data", nulls = Nulls.SKIP) + public _FinalStage data(Optional data) { + this.data = data; + return this; + } + + @java.lang.Override + public RemoteData build() { + return new RemoteData(path, data, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteEndpointInfo.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteEndpointInfo.java new file mode 100644 index 000000000..dda3a5cda --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteEndpointInfo.java @@ -0,0 +1,175 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteEndpointInfo.Builder.class) +public final class RemoteEndpointInfo { + private final String method; + + private final String urlPath; + + private final List fieldTraversalPath; + + private final Map additionalProperties; + + private RemoteEndpointInfo( + String method, + String urlPath, + List fieldTraversalPath, + Map additionalProperties) { + this.method = method; + this.urlPath = urlPath; + this.fieldTraversalPath = fieldTraversalPath; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("url_path") + public String getUrlPath() { + return urlPath; + } + + @JsonProperty("field_traversal_path") + public List getFieldTraversalPath() { + return fieldTraversalPath; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteEndpointInfo && equalTo((RemoteEndpointInfo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteEndpointInfo other) { + return method.equals(other.method) + && urlPath.equals(other.urlPath) + && fieldTraversalPath.equals(other.fieldTraversalPath); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.method, this.urlPath, this.fieldTraversalPath); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + UrlPathStage method(@NotNull String method); + + Builder from(RemoteEndpointInfo other); + } + + public interface UrlPathStage { + _FinalStage urlPath(@NotNull String urlPath); + } + + public interface _FinalStage { + RemoteEndpointInfo build(); + + _FinalStage fieldTraversalPath(List fieldTraversalPath); + + _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath); + + _FinalStage addAllFieldTraversalPath(List fieldTraversalPath); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, UrlPathStage, _FinalStage { + private String method; + + private String urlPath; + + private List fieldTraversalPath = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteEndpointInfo other) { + method(other.getMethod()); + urlPath(other.getUrlPath()); + fieldTraversalPath(other.getFieldTraversalPath()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public UrlPathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("url_path") + public _FinalStage urlPath(@NotNull String urlPath) { + this.urlPath = urlPath; + return this; + } + + @java.lang.Override + public _FinalStage addAllFieldTraversalPath(List fieldTraversalPath) { + if (fieldTraversalPath != null) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + } + return this; + } + + @java.lang.Override + public _FinalStage addFieldTraversalPath(JsonNode fieldTraversalPath) { + this.fieldTraversalPath.add(fieldTraversalPath); + return this; + } + + @java.lang.Override + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) + public _FinalStage fieldTraversalPath(List fieldTraversalPath) { + this.fieldTraversalPath.clear(); + if (fieldTraversalPath != null) { + this.fieldTraversalPath.addAll(fieldTraversalPath); + } + return this; + } + + @java.lang.Override + public RemoteEndpointInfo build() { + return new RemoteEndpointInfo(method, urlPath, fieldTraversalPath, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApi.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApi.java new file mode 100644 index 000000000..63a8d156a --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApi.java @@ -0,0 +1,279 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApi.Builder.class) +public final class RemoteFieldApi { + private final Map schema; + + private final String remoteKeyName; + + private final RemoteEndpointInfo remoteEndpointInfo; + + private final Optional> exampleValues; + + private final Optional advancedMetadata; + + private final Optional coverage; + + private final Map additionalProperties; + + private RemoteFieldApi( + Map schema, + String remoteKeyName, + RemoteEndpointInfo remoteEndpointInfo, + Optional> exampleValues, + Optional advancedMetadata, + Optional coverage, + Map additionalProperties) { + this.schema = schema; + this.remoteKeyName = remoteKeyName; + this.remoteEndpointInfo = remoteEndpointInfo; + this.exampleValues = exampleValues; + this.advancedMetadata = advancedMetadata; + this.coverage = coverage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("schema") + public Map getSchema() { + return schema; + } + + @JsonProperty("remote_key_name") + public String getRemoteKeyName() { + return remoteKeyName; + } + + @JsonProperty("remote_endpoint_info") + public RemoteEndpointInfo getRemoteEndpointInfo() { + return remoteEndpointInfo; + } + + @JsonProperty("example_values") + public Optional> getExampleValues() { + return exampleValues; + } + + @JsonProperty("advanced_metadata") + public Optional getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonProperty("coverage") + public Optional getCoverage() { + return coverage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApi && equalTo((RemoteFieldApi) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApi other) { + return schema.equals(other.schema) + && remoteKeyName.equals(other.remoteKeyName) + && remoteEndpointInfo.equals(other.remoteEndpointInfo) + && exampleValues.equals(other.exampleValues) + && advancedMetadata.equals(other.advancedMetadata) + && coverage.equals(other.coverage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.schema, + this.remoteKeyName, + this.remoteEndpointInfo, + this.exampleValues, + this.advancedMetadata, + this.coverage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RemoteKeyNameStage builder() { + return new Builder(); + } + + public interface RemoteKeyNameStage { + RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName); + + Builder from(RemoteFieldApi other); + } + + public interface RemoteEndpointInfoStage { + _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo); + } + + public interface _FinalStage { + RemoteFieldApi build(); + + _FinalStage schema(Map schema); + + _FinalStage putAllSchema(Map schema); + + _FinalStage schema(String key, JsonNode value); + + _FinalStage exampleValues(Optional> exampleValues); + + _FinalStage exampleValues(List exampleValues); + + _FinalStage advancedMetadata(Optional advancedMetadata); + + _FinalStage advancedMetadata(RemoteFieldApiAdvancedMetadata advancedMetadata); + + _FinalStage coverage(Optional coverage); + + _FinalStage coverage(RemoteFieldApiCoverage coverage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RemoteKeyNameStage, RemoteEndpointInfoStage, _FinalStage { + private String remoteKeyName; + + private RemoteEndpointInfo remoteEndpointInfo; + + private Optional coverage = Optional.empty(); + + private Optional advancedMetadata = Optional.empty(); + + private Optional> exampleValues = Optional.empty(); + + private Map schema = new LinkedHashMap<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteFieldApi other) { + schema(other.getSchema()); + remoteKeyName(other.getRemoteKeyName()); + remoteEndpointInfo(other.getRemoteEndpointInfo()); + exampleValues(other.getExampleValues()); + advancedMetadata(other.getAdvancedMetadata()); + coverage(other.getCoverage()); + return this; + } + + @java.lang.Override + @JsonSetter("remote_key_name") + public RemoteEndpointInfoStage remoteKeyName(@NotNull String remoteKeyName) { + this.remoteKeyName = remoteKeyName; + return this; + } + + @java.lang.Override + @JsonSetter("remote_endpoint_info") + public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpointInfo) { + this.remoteEndpointInfo = remoteEndpointInfo; + return this; + } + + @java.lang.Override + public _FinalStage coverage(RemoteFieldApiCoverage coverage) { + this.coverage = Optional.ofNullable(coverage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "coverage", nulls = Nulls.SKIP) + public _FinalStage coverage(Optional coverage) { + this.coverage = coverage; + return this; + } + + @java.lang.Override + public _FinalStage advancedMetadata(RemoteFieldApiAdvancedMetadata advancedMetadata) { + this.advancedMetadata = Optional.ofNullable(advancedMetadata); + return this; + } + + @java.lang.Override + @JsonSetter(value = "advanced_metadata", nulls = Nulls.SKIP) + public _FinalStage advancedMetadata(Optional advancedMetadata) { + this.advancedMetadata = advancedMetadata; + return this; + } + + @java.lang.Override + public _FinalStage exampleValues(List exampleValues) { + this.exampleValues = Optional.ofNullable(exampleValues); + return this; + } + + @java.lang.Override + @JsonSetter(value = "example_values", nulls = Nulls.SKIP) + public _FinalStage exampleValues(Optional> exampleValues) { + this.exampleValues = exampleValues; + return this; + } + + @java.lang.Override + public _FinalStage schema(String key, JsonNode value) { + this.schema.put(key, value); + return this; + } + + @java.lang.Override + public _FinalStage putAllSchema(Map schema) { + if (schema != null) { + this.schema.putAll(schema); + } + return this; + } + + @java.lang.Override + @JsonSetter(value = "schema", nulls = Nulls.SKIP) + public _FinalStage schema(Map schema) { + this.schema.clear(); + if (schema != null) { + this.schema.putAll(schema); + } + return this; + } + + @java.lang.Override + public RemoteFieldApi build() { + return new RemoteFieldApi( + schema, + remoteKeyName, + remoteEndpointInfo, + exampleValues, + advancedMetadata, + coverage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiAdvancedMetadata.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiAdvancedMetadata.java new file mode 100644 index 000000000..f78de25fa --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiAdvancedMetadata.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiAdvancedMetadata.Deserializer.class) +public final class RemoteFieldApiAdvancedMetadata { + private final Object value; + + private final int type; + + private RemoteFieldApiAdvancedMetadata(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((AdvancedMetadata) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiAdvancedMetadata && equalTo((RemoteFieldApiAdvancedMetadata) other); + } + + private boolean equalTo(RemoteFieldApiAdvancedMetadata other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiAdvancedMetadata of(AdvancedMetadata value) { + return new RemoteFieldApiAdvancedMetadata(value, 0); + } + + public static RemoteFieldApiAdvancedMetadata of(String value) { + return new RemoteFieldApiAdvancedMetadata(value, 1); + } + + public interface Visitor { + T visit(AdvancedMetadata value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiAdvancedMetadata.class); + } + + @java.lang.Override + public RemoteFieldApiAdvancedMetadata deserialize(JsonParser p, DeserializationContext context) + throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, AdvancedMetadata.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiCoverage.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiCoverage.java new file mode 100644 index 000000000..2a344115d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiCoverage.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteFieldApiCoverage.Deserializer.class) +public final class RemoteFieldApiCoverage { + private final Object value; + + private final int type; + + private RemoteFieldApiCoverage(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((int) this.value); + } else if (this.type == 1) { + return visitor.visit((double) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiCoverage && equalTo((RemoteFieldApiCoverage) other); + } + + private boolean equalTo(RemoteFieldApiCoverage other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteFieldApiCoverage of(int value) { + return new RemoteFieldApiCoverage(value, 0); + } + + public static RemoteFieldApiCoverage of(double value) { + return new RemoteFieldApiCoverage(value, 1); + } + + public interface Visitor { + T visit(int value); + + T visit(double value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteFieldApiCoverage.class); + } + + @java.lang.Override + public RemoteFieldApiCoverage deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + if (value instanceof Integer) { + return of((Integer) value); + } + if (value instanceof Double) { + return of((Double) value); + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiResponse.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiResponse.java new file mode 100644 index 000000000..09e7aed37 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldApiResponse.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldApiResponse.Builder.class) +public final class RemoteFieldApiResponse { + private final Optional> container; + + private final Optional> article; + + private final Optional> attachment; + + private final Optional> user; + + private final Optional> group; + + private final Map additionalProperties; + + private RemoteFieldApiResponse( + Optional> container, + Optional> article, + Optional> attachment, + Optional> user, + Optional> group, + Map additionalProperties) { + this.container = container; + this.article = article; + this.attachment = attachment; + this.user = user; + this.group = group; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("Container") + public Optional> getContainer() { + return container; + } + + @JsonProperty("Article") + public Optional> getArticle() { + return article; + } + + @JsonProperty("Attachment") + public Optional> getAttachment() { + return attachment; + } + + @JsonProperty("User") + public Optional> getUser() { + return user; + } + + @JsonProperty("Group") + public Optional> getGroup() { + return group; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldApiResponse && equalTo((RemoteFieldApiResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldApiResponse other) { + return container.equals(other.container) + && article.equals(other.article) + && attachment.equals(other.attachment) + && user.equals(other.user) + && group.equals(other.group); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.container, this.article, this.attachment, this.user, this.group); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> container = Optional.empty(); + + private Optional> article = Optional.empty(); + + private Optional> attachment = Optional.empty(); + + private Optional> user = Optional.empty(); + + private Optional> group = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldApiResponse other) { + container(other.getContainer()); + article(other.getArticle()); + attachment(other.getAttachment()); + user(other.getUser()); + group(other.getGroup()); + return this; + } + + @JsonSetter(value = "Container", nulls = Nulls.SKIP) + public Builder container(Optional> container) { + this.container = container; + return this; + } + + public Builder container(List container) { + this.container = Optional.ofNullable(container); + return this; + } + + @JsonSetter(value = "Article", nulls = Nulls.SKIP) + public Builder article(Optional> article) { + this.article = article; + return this; + } + + public Builder article(List article) { + this.article = Optional.ofNullable(article); + return this; + } + + @JsonSetter(value = "Attachment", nulls = Nulls.SKIP) + public Builder attachment(Optional> attachment) { + this.attachment = attachment; + return this; + } + + public Builder attachment(List attachment) { + this.attachment = Optional.ofNullable(attachment); + return this; + } + + @JsonSetter(value = "User", nulls = Nulls.SKIP) + public Builder user(Optional> user) { + this.user = user; + return this; + } + + public Builder user(List user) { + this.user = Optional.ofNullable(user); + return this; + } + + @JsonSetter(value = "Group", nulls = Nulls.SKIP) + public Builder group(Optional> group) { + this.group = group; + return this; + } + + public Builder group(List group) { + this.group = Optional.ofNullable(group); + return this; + } + + public RemoteFieldApiResponse build() { + return new RemoteFieldApiResponse(container, article, attachment, user, group, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldsRetrieveRequest.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldsRetrieveRequest.java new file mode 100644 index 000000000..a1f6aca0b --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteFieldsRetrieveRequest.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteFieldsRetrieveRequest.Builder.class) +public final class RemoteFieldsRetrieveRequest { + private final Optional commonModels; + + private final Optional includeExampleValues; + + private final Map additionalProperties; + + private RemoteFieldsRetrieveRequest( + Optional commonModels, + Optional includeExampleValues, + Map additionalProperties) { + this.commonModels = commonModels; + this.includeExampleValues = includeExampleValues; + this.additionalProperties = additionalProperties; + } + + /** + * @return A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + */ + @JsonProperty("common_models") + public Optional getCommonModels() { + return commonModels; + } + + /** + * @return 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. + */ + @JsonProperty("include_example_values") + public Optional getIncludeExampleValues() { + return includeExampleValues; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteFieldsRetrieveRequest && equalTo((RemoteFieldsRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteFieldsRetrieveRequest other) { + return commonModels.equals(other.commonModels) && includeExampleValues.equals(other.includeExampleValues); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.commonModels, this.includeExampleValues); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional commonModels = Optional.empty(); + + private Optional includeExampleValues = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(RemoteFieldsRetrieveRequest other) { + commonModels(other.getCommonModels()); + includeExampleValues(other.getIncludeExampleValues()); + return this; + } + + /** + *

            A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.

            + */ + @JsonSetter(value = "common_models", nulls = Nulls.SKIP) + public Builder commonModels(Optional commonModels) { + this.commonModels = commonModels; + return this; + } + + public Builder commonModels(String commonModels) { + this.commonModels = Optional.ofNullable(commonModels); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "include_example_values", nulls = Nulls.SKIP) + public Builder includeExampleValues(Optional includeExampleValues) { + this.includeExampleValues = includeExampleValues; + return this; + } + + public Builder includeExampleValues(String includeExampleValues) { + this.includeExampleValues = Optional.ofNullable(includeExampleValues); + return this; + } + + public RemoteFieldsRetrieveRequest build() { + return new RemoteFieldsRetrieveRequest(commonModels, includeExampleValues, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteKey.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteKey.java new file mode 100644 index 000000000..ca562ba00 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteKey.java @@ -0,0 +1,124 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKey.Builder.class) +public final class RemoteKey { + private final String name; + + private final String key; + + private final Map additionalProperties; + + private RemoteKey(String name, String key, Map additionalProperties) { + this.name = name; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("name") + public String getName() { + return name; + } + + @JsonProperty("key") + public String getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKey && equalTo((RemoteKey) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKey other) { + return name.equals(other.name) && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + KeyStage name(@NotNull String name); + + Builder from(RemoteKey other); + } + + public interface KeyStage { + _FinalStage key(@NotNull String key); + } + + public interface _FinalStage { + RemoteKey build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, KeyStage, _FinalStage { + private String name; + + private String key; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKey other) { + name(other.getName()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("name") + public KeyStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + @JsonSetter("key") + public _FinalStage key(@NotNull String key) { + this.key = key; + return this; + } + + @java.lang.Override + public RemoteKey build() { + return new RemoteKey(name, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteKeyForRegenerationRequest.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteKeyForRegenerationRequest.java new file mode 100644 index 000000000..e2ccb3bd7 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteKeyForRegenerationRequest.java @@ -0,0 +1,113 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteKeyForRegenerationRequest.Builder.class) +public final class RemoteKeyForRegenerationRequest { + private final String name; + + private final Map additionalProperties; + + private RemoteKeyForRegenerationRequest(String name, Map additionalProperties) { + this.name = name; + this.additionalProperties = additionalProperties; + } + + /** + * @return The name of the remote key + */ + @JsonProperty("name") + public String getName() { + return name; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteKeyForRegenerationRequest && equalTo((RemoteKeyForRegenerationRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteKeyForRegenerationRequest other) { + return name.equals(other.name); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.name); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

            The name of the remote key

            + */ + _FinalStage name(@NotNull String name); + + Builder from(RemoteKeyForRegenerationRequest other); + } + + public interface _FinalStage { + RemoteKeyForRegenerationRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, _FinalStage { + private String name; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteKeyForRegenerationRequest other) { + name(other.getName()); + return this; + } + + /** + *

            The name of the remote key

            + *

            The name of the remote key

            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public _FinalStage name(@NotNull String name) { + this.name = name; + return this; + } + + @java.lang.Override + public RemoteKeyForRegenerationRequest build() { + return new RemoteKeyForRegenerationRequest(name, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteResponse.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteResponse.java new file mode 100644 index 000000000..93625e2ac --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteResponse.java @@ -0,0 +1,277 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RemoteResponse.Builder.class) +public final class RemoteResponse { + private final String method; + + private final String path; + + private final int status; + + private final JsonNode response; + + private final Optional> responseHeaders; + + private final Optional responseType; + + private final Optional> headers; + + private final Map additionalProperties; + + private RemoteResponse( + String method, + String path, + int status, + JsonNode response, + Optional> responseHeaders, + Optional responseType, + Optional> headers, + Map additionalProperties) { + this.method = method; + this.path = path; + this.status = status; + this.response = response; + this.responseHeaders = responseHeaders; + this.responseType = responseType; + this.headers = headers; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("method") + public String getMethod() { + return method; + } + + @JsonProperty("path") + public String getPath() { + return path; + } + + @JsonProperty("status") + public int getStatus() { + return status; + } + + @JsonProperty("response") + public JsonNode getResponse() { + return response; + } + + @JsonProperty("response_headers") + public Optional> getResponseHeaders() { + return responseHeaders; + } + + @JsonProperty("response_type") + public Optional getResponseType() { + return responseType; + } + + @JsonProperty("headers") + public Optional> getHeaders() { + return headers; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponse && equalTo((RemoteResponse) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RemoteResponse other) { + return method.equals(other.method) + && path.equals(other.path) + && status == other.status + && response.equals(other.response) + && responseHeaders.equals(other.responseHeaders) + && responseType.equals(other.responseType) + && headers.equals(other.headers); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.method, + this.path, + this.status, + this.response, + this.responseHeaders, + this.responseType, + this.headers); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MethodStage builder() { + return new Builder(); + } + + public interface MethodStage { + PathStage method(@NotNull String method); + + Builder from(RemoteResponse other); + } + + public interface PathStage { + StatusStage path(@NotNull String path); + } + + public interface StatusStage { + ResponseStage status(int status); + } + + public interface ResponseStage { + _FinalStage response(@NotNull JsonNode response); + } + + public interface _FinalStage { + RemoteResponse build(); + + _FinalStage responseHeaders(Optional> responseHeaders); + + _FinalStage responseHeaders(Map responseHeaders); + + _FinalStage responseType(Optional responseType); + + _FinalStage responseType(RemoteResponseResponseType responseType); + + _FinalStage headers(Optional> headers); + + _FinalStage headers(Map headers); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MethodStage, PathStage, StatusStage, ResponseStage, _FinalStage { + private String method; + + private String path; + + private int status; + + private JsonNode response; + + private Optional> headers = Optional.empty(); + + private Optional responseType = Optional.empty(); + + private Optional> responseHeaders = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RemoteResponse other) { + method(other.getMethod()); + path(other.getPath()); + status(other.getStatus()); + response(other.getResponse()); + responseHeaders(other.getResponseHeaders()); + responseType(other.getResponseType()); + headers(other.getHeaders()); + return this; + } + + @java.lang.Override + @JsonSetter("method") + public PathStage method(@NotNull String method) { + this.method = method; + return this; + } + + @java.lang.Override + @JsonSetter("path") + public StatusStage path(@NotNull String path) { + this.path = path; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public ResponseStage status(int status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("response") + public _FinalStage response(@NotNull JsonNode response) { + this.response = response; + return this; + } + + @java.lang.Override + public _FinalStage headers(Map headers) { + this.headers = Optional.ofNullable(headers); + return this; + } + + @java.lang.Override + @JsonSetter(value = "headers", nulls = Nulls.SKIP) + public _FinalStage headers(Optional> headers) { + this.headers = headers; + return this; + } + + @java.lang.Override + public _FinalStage responseType(RemoteResponseResponseType responseType) { + this.responseType = Optional.ofNullable(responseType); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_type", nulls = Nulls.SKIP) + public _FinalStage responseType(Optional responseType) { + this.responseType = responseType; + return this; + } + + @java.lang.Override + public _FinalStage responseHeaders(Map responseHeaders) { + this.responseHeaders = Optional.ofNullable(responseHeaders); + return this; + } + + @java.lang.Override + @JsonSetter(value = "response_headers", nulls = Nulls.SKIP) + public _FinalStage responseHeaders(Optional> responseHeaders) { + this.responseHeaders = responseHeaders; + return this; + } + + @java.lang.Override + public RemoteResponse build() { + return new RemoteResponse( + method, path, status, response, responseHeaders, responseType, headers, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RemoteResponseResponseType.java b/src/main/java/com/merge/api/knowledgebase/types/RemoteResponseResponseType.java new file mode 100644 index 000000000..7d2db8a43 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RemoteResponseResponseType.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = RemoteResponseResponseType.Deserializer.class) +public final class RemoteResponseResponseType { + private final Object value; + + private final int type; + + private RemoteResponseResponseType(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((ResponseTypeEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RemoteResponseResponseType && equalTo((RemoteResponseResponseType) other); + } + + private boolean equalTo(RemoteResponseResponseType other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static RemoteResponseResponseType of(ResponseTypeEnum value) { + return new RemoteResponseResponseType(value, 0); + } + + public static RemoteResponseResponseType of(String value) { + return new RemoteResponseResponseType(value, 1); + } + + public interface Visitor { + T visit(ResponseTypeEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(RemoteResponseResponseType.class); + } + + @java.lang.Override + public RemoteResponseResponseType deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, ResponseTypeEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RequestFormatEnum.java b/src/main/java/com/merge/api/knowledgebase/types/RequestFormatEnum.java new file mode 100644 index 000000000..2cefe721e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RequestFormatEnum.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RequestFormatEnum { + public static final RequestFormatEnum MULTIPART = new RequestFormatEnum(Value.MULTIPART, "MULTIPART"); + + public static final RequestFormatEnum XML = new RequestFormatEnum(Value.XML, "XML"); + + public static final RequestFormatEnum JSON = new RequestFormatEnum(Value.JSON, "JSON"); + + private final Value value; + + private final String string; + + RequestFormatEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof RequestFormatEnum && this.string.equals(((RequestFormatEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MULTIPART: + return visitor.visitMultipart(); + case XML: + return visitor.visitXml(); + case JSON: + return visitor.visitJson(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RequestFormatEnum valueOf(String value) { + switch (value) { + case "MULTIPART": + return MULTIPART; + case "XML": + return XML; + case "JSON": + return JSON; + default: + return new RequestFormatEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + JSON, + + XML, + + MULTIPART, + + UNKNOWN + } + + public interface Visitor { + T visitJson(); + + T visitXml(); + + T visitMultipart(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/knowledgebase/types/ResponseTypeEnum.java new file mode 100644 index 000000000..02983df5c --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ResponseTypeEnum.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ResponseTypeEnum { + public static final ResponseTypeEnum BASE_64_GZIP = new ResponseTypeEnum(Value.BASE_64_GZIP, "BASE64_GZIP"); + + public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); + + private final Value value; + + private final String string; + + ResponseTypeEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ResponseTypeEnum && this.string.equals(((ResponseTypeEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BASE_64_GZIP: + return visitor.visitBase64Gzip(); + case JSON: + return visitor.visitJson(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ResponseTypeEnum valueOf(String value) { + switch (value) { + case "BASE64_GZIP": + return BASE_64_GZIP; + case "JSON": + return JSON; + default: + return new ResponseTypeEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + JSON, + + BASE_64_GZIP, + + UNKNOWN + } + + public interface Visitor { + T visitJson(); + + T visitBase64Gzip(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RoleEnum.java b/src/main/java/com/merge/api/knowledgebase/types/RoleEnum.java new file mode 100644 index 000000000..c713eccd2 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RoleEnum.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RoleEnum { + public static final RoleEnum API = new RoleEnum(Value.API, "API"); + + public static final RoleEnum DEVELOPER = new RoleEnum(Value.DEVELOPER, "DEVELOPER"); + + public static final RoleEnum MERGE_TEAM = new RoleEnum(Value.MERGE_TEAM, "MERGE_TEAM"); + + public static final RoleEnum MEMBER = new RoleEnum(Value.MEMBER, "MEMBER"); + + public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); + + private final Value value; + + private final String string; + + RoleEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof RoleEnum && this.string.equals(((RoleEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case API: + return visitor.visitApi(); + case DEVELOPER: + return visitor.visitDeveloper(); + case MERGE_TEAM: + return visitor.visitMergeTeam(); + case MEMBER: + return visitor.visitMember(); + case SYSTEM: + return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); + case ADMIN: + return visitor.visitAdmin(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RoleEnum valueOf(String value) { + switch (value) { + case "API": + return API; + case "DEVELOPER": + return DEVELOPER; + case "MERGE_TEAM": + return MERGE_TEAM; + case "MEMBER": + return MEMBER; + case "SYSTEM": + return SYSTEM; + case "SUPPORT": + return SUPPORT; + case "ADMIN": + return ADMIN; + default: + return new RoleEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ADMIN, + + DEVELOPER, + + MEMBER, + + API, + + SYSTEM, + + MERGE_TEAM, + + SUPPORT, + + UNKNOWN + } + + public interface Visitor { + T visitAdmin(); + + T visitDeveloper(); + + T visitMember(); + + T visitApi(); + + T visitSystem(); + + T visitMergeTeam(); + + T visitSupport(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/RolesEnum.java b/src/main/java/com/merge/api/knowledgebase/types/RolesEnum.java new file mode 100644 index 000000000..e86590106 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/RolesEnum.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class RolesEnum { + public static final RolesEnum OWNER = new RolesEnum(Value.OWNER, "OWNER"); + + public static final RolesEnum READ = new RolesEnum(Value.READ, "READ"); + + public static final RolesEnum WRITE = new RolesEnum(Value.WRITE, "WRITE"); + + private final Value value; + + private final String string; + + RolesEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof RolesEnum && this.string.equals(((RolesEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OWNER: + return visitor.visitOwner(); + case READ: + return visitor.visitRead(); + case WRITE: + return visitor.visitWrite(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static RolesEnum valueOf(String value) { + switch (value) { + case "OWNER": + return OWNER; + case "READ": + return READ; + case "WRITE": + return WRITE; + default: + return new RolesEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + READ, + + WRITE, + + OWNER, + + UNKNOWN + } + + public interface Visitor { + T visitRead(); + + T visitWrite(); + + T visitOwner(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/SelectiveSyncConfigurationsUsageEnum.java b/src/main/java/com/merge/api/knowledgebase/types/SelectiveSyncConfigurationsUsageEnum.java new file mode 100644 index 000000000..84257dfbe --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/SelectiveSyncConfigurationsUsageEnum.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class SelectiveSyncConfigurationsUsageEnum { + public static final SelectiveSyncConfigurationsUsageEnum IN_NEXT_SYNC = + new SelectiveSyncConfigurationsUsageEnum(Value.IN_NEXT_SYNC, "IN_NEXT_SYNC"); + + public static final SelectiveSyncConfigurationsUsageEnum IN_LAST_SYNC = + new SelectiveSyncConfigurationsUsageEnum(Value.IN_LAST_SYNC, "IN_LAST_SYNC"); + + private final Value value; + + private final String string; + + SelectiveSyncConfigurationsUsageEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof SelectiveSyncConfigurationsUsageEnum + && this.string.equals(((SelectiveSyncConfigurationsUsageEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case IN_NEXT_SYNC: + return visitor.visitInNextSync(); + case IN_LAST_SYNC: + return visitor.visitInLastSync(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SelectiveSyncConfigurationsUsageEnum valueOf(String value) { + switch (value) { + case "IN_NEXT_SYNC": + return IN_NEXT_SYNC; + case "IN_LAST_SYNC": + return IN_LAST_SYNC; + default: + return new SelectiveSyncConfigurationsUsageEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + IN_NEXT_SYNC, + + IN_LAST_SYNC, + + UNKNOWN + } + + public interface Visitor { + T visitInNextSync(); + + T visitInLastSync(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/Status3C6Enum.java b/src/main/java/com/merge/api/knowledgebase/types/Status3C6Enum.java new file mode 100644 index 000000000..358247cf9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/Status3C6Enum.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class Status3C6Enum { + public static final Status3C6Enum PUBLISHED = new Status3C6Enum(Value.PUBLISHED, "PUBLISHED"); + + public static final Status3C6Enum DRAFT = new Status3C6Enum(Value.DRAFT, "DRAFT"); + + public static final Status3C6Enum TRASH = new Status3C6Enum(Value.TRASH, "TRASH"); + + public static final Status3C6Enum ARCHIVED = new Status3C6Enum(Value.ARCHIVED, "ARCHIVED"); + + private final Value value; + + private final String string; + + Status3C6Enum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof Status3C6Enum && this.string.equals(((Status3C6Enum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PUBLISHED: + return visitor.visitPublished(); + case DRAFT: + return visitor.visitDraft(); + case TRASH: + return visitor.visitTrash(); + case ARCHIVED: + return visitor.visitArchived(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static Status3C6Enum valueOf(String value) { + switch (value) { + case "PUBLISHED": + return PUBLISHED; + case "DRAFT": + return DRAFT; + case "TRASH": + return TRASH; + case "ARCHIVED": + return ARCHIVED; + default: + return new Status3C6Enum(Value.UNKNOWN, value); + } + } + + public enum Value { + DRAFT, + + PUBLISHED, + + ARCHIVED, + + TRASH, + + UNKNOWN + } + + public interface Visitor { + T visitDraft(); + + T visitPublished(); + + T visitArchived(); + + T visitTrash(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/StatusFd5Enum.java b/src/main/java/com/merge/api/knowledgebase/types/StatusFd5Enum.java new file mode 100644 index 000000000..3861f42ba --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/StatusFd5Enum.java @@ -0,0 +1,123 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class StatusFd5Enum { + public static final StatusFd5Enum DISABLED = new StatusFd5Enum(Value.DISABLED, "DISABLED"); + + public static final StatusFd5Enum SYNCING = new StatusFd5Enum(Value.SYNCING, "SYNCING"); + + public static final StatusFd5Enum PAUSED = new StatusFd5Enum(Value.PAUSED, "PAUSED"); + + public static final StatusFd5Enum DONE = new StatusFd5Enum(Value.DONE, "DONE"); + + public static final StatusFd5Enum FAILED = new StatusFd5Enum(Value.FAILED, "FAILED"); + + public static final StatusFd5Enum PARTIALLY_SYNCED = new StatusFd5Enum(Value.PARTIALLY_SYNCED, "PARTIALLY_SYNCED"); + + private final Value value; + + private final String string; + + StatusFd5Enum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof StatusFd5Enum && this.string.equals(((StatusFd5Enum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISABLED: + return visitor.visitDisabled(); + case SYNCING: + return visitor.visitSyncing(); + case PAUSED: + return visitor.visitPaused(); + case DONE: + return visitor.visitDone(); + case FAILED: + return visitor.visitFailed(); + case PARTIALLY_SYNCED: + return visitor.visitPartiallySynced(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static StatusFd5Enum valueOf(String value) { + switch (value) { + case "DISABLED": + return DISABLED; + case "SYNCING": + return SYNCING; + case "PAUSED": + return PAUSED; + case "DONE": + return DONE; + case "FAILED": + return FAILED; + case "PARTIALLY_SYNCED": + return PARTIALLY_SYNCED; + default: + return new StatusFd5Enum(Value.UNKNOWN, value); + } + } + + public enum Value { + SYNCING, + + DONE, + + FAILED, + + DISABLED, + + PAUSED, + + PARTIALLY_SYNCED, + + UNKNOWN + } + + public interface Visitor { + T visitSyncing(); + + T visitDone(); + + T visitFailed(); + + T visitDisabled(); + + T visitPaused(); + + T visitPartiallySynced(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/SyncStatus.java b/src/main/java/com/merge/api/knowledgebase/types/SyncStatus.java new file mode 100644 index 000000000..77f8af9b1 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/SyncStatus.java @@ -0,0 +1,353 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatus.Builder.class) +public final class SyncStatus { + private final String modelName; + + private final String modelId; + + private final Optional lastSyncStart; + + private final Optional nextSyncStart; + + private final Optional lastSyncResult; + + private final Optional lastSyncFinished; + + private final SyncStatusStatus status; + + private final boolean isInitialSync; + + private final Optional selectiveSyncConfigurationsUsage; + + private final Map additionalProperties; + + private SyncStatus( + String modelName, + String modelId, + Optional lastSyncStart, + Optional nextSyncStart, + Optional lastSyncResult, + Optional lastSyncFinished, + SyncStatusStatus status, + boolean isInitialSync, + Optional selectiveSyncConfigurationsUsage, + Map additionalProperties) { + this.modelName = modelName; + this.modelId = modelId; + this.lastSyncStart = lastSyncStart; + this.nextSyncStart = nextSyncStart; + this.lastSyncResult = lastSyncResult; + this.lastSyncFinished = lastSyncFinished; + this.status = status; + this.isInitialSync = isInitialSync; + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("model_name") + public String getModelName() { + return modelName; + } + + @JsonProperty("model_id") + public String getModelId() { + return modelId; + } + + @JsonProperty("last_sync_start") + public Optional getLastSyncStart() { + return lastSyncStart; + } + + @JsonProperty("next_sync_start") + public Optional getNextSyncStart() { + return nextSyncStart; + } + + @JsonProperty("last_sync_result") + public Optional getLastSyncResult() { + return lastSyncResult; + } + + @JsonProperty("last_sync_finished") + public Optional getLastSyncFinished() { + return lastSyncFinished; + } + + @JsonProperty("status") + public SyncStatusStatus getStatus() { + return status; + } + + @JsonProperty("is_initial_sync") + public boolean getIsInitialSync() { + return isInitialSync; + } + + @JsonProperty("selective_sync_configurations_usage") + public Optional getSelectiveSyncConfigurationsUsage() { + return selectiveSyncConfigurationsUsage; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatus && equalTo((SyncStatus) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatus other) { + return modelName.equals(other.modelName) + && modelId.equals(other.modelId) + && lastSyncStart.equals(other.lastSyncStart) + && nextSyncStart.equals(other.nextSyncStart) + && lastSyncResult.equals(other.lastSyncResult) + && lastSyncFinished.equals(other.lastSyncFinished) + && status.equals(other.status) + && isInitialSync == other.isInitialSync + && selectiveSyncConfigurationsUsage.equals(other.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.modelName, + this.modelId, + this.lastSyncStart, + this.nextSyncStart, + this.lastSyncResult, + this.lastSyncFinished, + this.status, + this.isInitialSync, + this.selectiveSyncConfigurationsUsage); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static ModelNameStage builder() { + return new Builder(); + } + + public interface ModelNameStage { + ModelIdStage modelName(@NotNull String modelName); + + Builder from(SyncStatus other); + } + + public interface ModelIdStage { + StatusStage modelId(@NotNull String modelId); + } + + public interface StatusStage { + IsInitialSyncStage status(@NotNull SyncStatusStatus status); + } + + public interface IsInitialSyncStage { + _FinalStage isInitialSync(boolean isInitialSync); + } + + public interface _FinalStage { + SyncStatus build(); + + _FinalStage lastSyncStart(Optional lastSyncStart); + + _FinalStage lastSyncStart(OffsetDateTime lastSyncStart); + + _FinalStage nextSyncStart(Optional nextSyncStart); + + _FinalStage nextSyncStart(OffsetDateTime nextSyncStart); + + _FinalStage lastSyncResult(Optional lastSyncResult); + + _FinalStage lastSyncResult(SyncStatusLastSyncResult lastSyncResult); + + _FinalStage lastSyncFinished(Optional lastSyncFinished); + + _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished); + + _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage); + + _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements ModelNameStage, ModelIdStage, StatusStage, IsInitialSyncStage, _FinalStage { + private String modelName; + + private String modelId; + + private SyncStatusStatus status; + + private boolean isInitialSync; + + private Optional selectiveSyncConfigurationsUsage = Optional.empty(); + + private Optional lastSyncFinished = Optional.empty(); + + private Optional lastSyncResult = Optional.empty(); + + private Optional nextSyncStart = Optional.empty(); + + private Optional lastSyncStart = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(SyncStatus other) { + modelName(other.getModelName()); + modelId(other.getModelId()); + lastSyncStart(other.getLastSyncStart()); + nextSyncStart(other.getNextSyncStart()); + lastSyncResult(other.getLastSyncResult()); + lastSyncFinished(other.getLastSyncFinished()); + status(other.getStatus()); + isInitialSync(other.getIsInitialSync()); + selectiveSyncConfigurationsUsage(other.getSelectiveSyncConfigurationsUsage()); + return this; + } + + @java.lang.Override + @JsonSetter("model_name") + public ModelIdStage modelName(@NotNull String modelName) { + this.modelName = modelName; + return this; + } + + @java.lang.Override + @JsonSetter("model_id") + public StatusStage modelId(@NotNull String modelId) { + this.modelId = modelId; + return this; + } + + @java.lang.Override + @JsonSetter("status") + public IsInitialSyncStage status(@NotNull SyncStatusStatus status) { + this.status = status; + return this; + } + + @java.lang.Override + @JsonSetter("is_initial_sync") + public _FinalStage isInitialSync(boolean isInitialSync) { + this.isInitialSync = isInitialSync; + return this; + } + + @java.lang.Override + public _FinalStage selectiveSyncConfigurationsUsage( + SelectiveSyncConfigurationsUsageEnum selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = Optional.ofNullable(selectiveSyncConfigurationsUsage); + return this; + } + + @java.lang.Override + @JsonSetter(value = "selective_sync_configurations_usage", nulls = Nulls.SKIP) + public _FinalStage selectiveSyncConfigurationsUsage( + Optional selectiveSyncConfigurationsUsage) { + this.selectiveSyncConfigurationsUsage = selectiveSyncConfigurationsUsage; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncFinished(OffsetDateTime lastSyncFinished) { + this.lastSyncFinished = Optional.ofNullable(lastSyncFinished); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_finished", nulls = Nulls.SKIP) + public _FinalStage lastSyncFinished(Optional lastSyncFinished) { + this.lastSyncFinished = lastSyncFinished; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncResult(SyncStatusLastSyncResult lastSyncResult) { + this.lastSyncResult = Optional.ofNullable(lastSyncResult); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_result", nulls = Nulls.SKIP) + public _FinalStage lastSyncResult(Optional lastSyncResult) { + this.lastSyncResult = lastSyncResult; + return this; + } + + @java.lang.Override + public _FinalStage nextSyncStart(OffsetDateTime nextSyncStart) { + this.nextSyncStart = Optional.ofNullable(nextSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "next_sync_start", nulls = Nulls.SKIP) + public _FinalStage nextSyncStart(Optional nextSyncStart) { + this.nextSyncStart = nextSyncStart; + return this; + } + + @java.lang.Override + public _FinalStage lastSyncStart(OffsetDateTime lastSyncStart) { + this.lastSyncStart = Optional.ofNullable(lastSyncStart); + return this; + } + + @java.lang.Override + @JsonSetter(value = "last_sync_start", nulls = Nulls.SKIP) + public _FinalStage lastSyncStart(Optional lastSyncStart) { + this.lastSyncStart = lastSyncStart; + return this; + } + + @java.lang.Override + public SyncStatus build() { + return new SyncStatus( + modelName, + modelId, + lastSyncStart, + nextSyncStart, + lastSyncResult, + lastSyncFinished, + status, + isInitialSync, + selectiveSyncConfigurationsUsage, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/SyncStatusLastSyncResult.java b/src/main/java/com/merge/api/knowledgebase/types/SyncStatusLastSyncResult.java new file mode 100644 index 000000000..bd9d40e54 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/SyncStatusLastSyncResult.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SyncStatusLastSyncResult.Deserializer.class) +public final class SyncStatusLastSyncResult { + private final Object value; + + private final int type; + + private SyncStatusLastSyncResult(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((LastSyncResultEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusLastSyncResult && equalTo((SyncStatusLastSyncResult) other); + } + + private boolean equalTo(SyncStatusLastSyncResult other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SyncStatusLastSyncResult of(LastSyncResultEnum value) { + return new SyncStatusLastSyncResult(value, 0); + } + + public static SyncStatusLastSyncResult of(String value) { + return new SyncStatusLastSyncResult(value, 1); + } + + public interface Visitor { + T visit(LastSyncResultEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SyncStatusLastSyncResult.class); + } + + @java.lang.Override + public SyncStatusLastSyncResult deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, LastSyncResultEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/SyncStatusListRequest.java new file mode 100644 index 000000000..7a8209ab2 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/SyncStatusListRequest.java @@ -0,0 +1,130 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = SyncStatusListRequest.Builder.class) +public final class SyncStatusListRequest { + private final Optional cursor; + + private final Optional pageSize; + + private final Map additionalProperties; + + private SyncStatusListRequest( + Optional cursor, Optional pageSize, Map additionalProperties) { + this.cursor = cursor; + this.pageSize = pageSize; + this.additionalProperties = additionalProperties; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusListRequest && equalTo((SyncStatusListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(SyncStatusListRequest other) { + return cursor.equals(other.cursor) && pageSize.equals(other.pageSize); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.cursor, this.pageSize); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional cursor = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(SyncStatusListRequest other) { + cursor(other.getCursor()); + pageSize(other.getPageSize()); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + public SyncStatusListRequest build() { + return new SyncStatusListRequest(cursor, pageSize, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/SyncStatusStatus.java b/src/main/java/com/merge/api/knowledgebase/types/SyncStatusStatus.java new file mode 100644 index 000000000..c5f5a4e04 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/SyncStatusStatus.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = SyncStatusStatus.Deserializer.class) +public final class SyncStatusStatus { + private final Object value; + + private final int type; + + private SyncStatusStatus(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((StatusFd5Enum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof SyncStatusStatus && equalTo((SyncStatusStatus) other); + } + + private boolean equalTo(SyncStatusStatus other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static SyncStatusStatus of(StatusFd5Enum value) { + return new SyncStatusStatus(value, 0); + } + + public static SyncStatusStatus of(String value) { + return new SyncStatusStatus(value, 1); + } + + public interface Visitor { + T visit(StatusFd5Enum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(SyncStatusStatus.class); + } + + @java.lang.Override + public SyncStatusStatus deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, StatusFd5Enum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/User.java b/src/main/java/com/merge/api/knowledgebase/types/User.java new file mode 100644 index 000000000..763c7fa65 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/User.java @@ -0,0 +1,319 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = User.Builder.class) +public final class User { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional name; + + private final Optional emailAddress; + + private final Optional remoteWasDeleted; + + private final Optional fieldMappings; + + private final Map additionalProperties; + + private User( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional name, + Optional emailAddress, + Optional remoteWasDeleted, + Optional fieldMappings, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.name = name; + this.emailAddress = emailAddress; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return The user's name. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return The user's email address. + */ + @JsonProperty("email_address") + public Optional getEmailAddress() { + return emailAddress; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional getFieldMappings() { + return fieldMappings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof User && equalTo((User) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(User other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && name.equals(other.name) + && emailAddress.equals(other.emailAddress) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.name, + this.emailAddress, + this.remoteWasDeleted, + this.fieldMappings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional emailAddress = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional fieldMappings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(User other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + name(other.getName()); + emailAddress(other.getEmailAddress()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

            The third-party API ID of the matching object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

            The datetime that this object was created by Merge.

            + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

            The datetime that this object was modified by Merge.

            + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

            The user's name.

            + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

            The user's email address.

            + */ + @JsonSetter(value = "email_address", nulls = Nulls.SKIP) + public Builder emailAddress(Optional emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Builder emailAddress(String emailAddress) { + this.emailAddress = Optional.ofNullable(emailAddress); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(UserFieldMappings fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + public User build() { + return new User( + id, + remoteId, + createdAt, + modifiedAt, + name, + emailAddress, + remoteWasDeleted, + fieldMappings, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/UserFieldMappings.java b/src/main/java/com/merge/api/knowledgebase/types/UserFieldMappings.java new file mode 100644 index 000000000..a2283bfb9 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/UserFieldMappings.java @@ -0,0 +1,122 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UserFieldMappings.Builder.class) +public final class UserFieldMappings { + private final Optional> organizationDefinedTargets; + + private final Optional> linkedAccountDefinedTargets; + + private final Map additionalProperties; + + private UserFieldMappings( + Optional> organizationDefinedTargets, + Optional> linkedAccountDefinedTargets, + Map additionalProperties) { + this.organizationDefinedTargets = organizationDefinedTargets; + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("organization_defined_targets") + public Optional> getOrganizationDefinedTargets() { + return organizationDefinedTargets; + } + + @JsonProperty("linked_account_defined_targets") + public Optional> getLinkedAccountDefinedTargets() { + return linkedAccountDefinedTargets; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UserFieldMappings && equalTo((UserFieldMappings) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UserFieldMappings other) { + return organizationDefinedTargets.equals(other.organizationDefinedTargets) + && linkedAccountDefinedTargets.equals(other.linkedAccountDefinedTargets); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.organizationDefinedTargets, this.linkedAccountDefinedTargets); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> organizationDefinedTargets = Optional.empty(); + + private Optional> linkedAccountDefinedTargets = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UserFieldMappings other) { + organizationDefinedTargets(other.getOrganizationDefinedTargets()); + linkedAccountDefinedTargets(other.getLinkedAccountDefinedTargets()); + return this; + } + + @JsonSetter(value = "organization_defined_targets", nulls = Nulls.SKIP) + public Builder organizationDefinedTargets(Optional> organizationDefinedTargets) { + this.organizationDefinedTargets = organizationDefinedTargets; + return this; + } + + public Builder organizationDefinedTargets(Map organizationDefinedTargets) { + this.organizationDefinedTargets = Optional.ofNullable(organizationDefinedTargets); + return this; + } + + @JsonSetter(value = "linked_account_defined_targets", nulls = Nulls.SKIP) + public Builder linkedAccountDefinedTargets(Optional> linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = linkedAccountDefinedTargets; + return this; + } + + public Builder linkedAccountDefinedTargets(Map linkedAccountDefinedTargets) { + this.linkedAccountDefinedTargets = Optional.ofNullable(linkedAccountDefinedTargets); + return this; + } + + public UserFieldMappings build() { + return new UserFieldMappings(organizationDefinedTargets, linkedAccountDefinedTargets, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/UsersListRequest.java b/src/main/java/com/merge/api/knowledgebase/types/UsersListRequest.java new file mode 100644 index 000000000..f9dbc8011 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/UsersListRequest.java @@ -0,0 +1,395 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersListRequest.Builder.class) +public final class UsersListRequest { + private final Optional createdAfter; + + private final Optional createdBefore; + + private final Optional cursor; + + private final Optional includeDeletedData; + + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Optional modifiedAfter; + + private final Optional modifiedBefore; + + private final Optional pageSize; + + private final Optional remoteId; + + private final Map additionalProperties; + + private UsersListRequest( + Optional createdAfter, + Optional createdBefore, + Optional cursor, + Optional includeDeletedData, + Optional includeRemoteData, + Optional includeShellData, + Optional modifiedAfter, + Optional modifiedBefore, + Optional pageSize, + Optional remoteId, + Map additionalProperties) { + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; + this.cursor = cursor; + this.includeDeletedData = includeDeletedData; + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.modifiedAfter = modifiedAfter; + this.modifiedBefore = modifiedBefore; + this.pageSize = pageSize; + this.remoteId = remoteId; + this.additionalProperties = additionalProperties; + } + + /** + * @return If provided, will only return objects created after this datetime. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return If provided, will only return objects created before this datetime. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + + /** + * @return The pagination cursor value. + */ + @JsonProperty("cursor") + public Optional getCursor() { + return cursor; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return If provided, only objects synced by Merge after this date time will be returned. + */ + @JsonProperty("modified_after") + public Optional getModifiedAfter() { + return modifiedAfter; + } + + /** + * @return If provided, only objects synced by Merge before this date time will be returned. + */ + @JsonProperty("modified_before") + public Optional getModifiedBefore() { + return modifiedBefore; + } + + /** + * @return Number of results to return per page. The maximum limit is 100. + */ + @JsonProperty("page_size") + public Optional getPageSize() { + return pageSize; + } + + /** + * @return The API provider's ID for the given object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersListRequest && equalTo((UsersListRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersListRequest other) { + return createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore) + && cursor.equals(other.cursor) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteData.equals(other.includeRemoteData) + && includeShellData.equals(other.includeShellData) + && modifiedAfter.equals(other.modifiedAfter) + && modifiedBefore.equals(other.modifiedBefore) + && pageSize.equals(other.pageSize) + && remoteId.equals(other.remoteId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.createdAfter, + this.createdBefore, + this.cursor, + this.includeDeletedData, + this.includeRemoteData, + this.includeShellData, + this.modifiedAfter, + this.modifiedBefore, + this.pageSize, + this.remoteId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional createdAfter = Optional.empty(); + + private Optional createdBefore = Optional.empty(); + + private Optional cursor = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional modifiedAfter = Optional.empty(); + + private Optional modifiedBefore = Optional.empty(); + + private Optional pageSize = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersListRequest other) { + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); + cursor(other.getCursor()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + modifiedAfter(other.getModifiedAfter()); + modifiedBefore(other.getModifiedBefore()); + pageSize(other.getPageSize()); + remoteId(other.getRemoteId()); + return this; + } + + /** + *

            If provided, will only return objects created after this datetime.

            + */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(OffsetDateTime createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); + return this; + } + + /** + *

            If provided, will only return objects created before this datetime.

            + */ + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(OffsetDateTime createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); + return this; + } + + /** + *

            The pagination cursor value.

            + */ + @JsonSetter(value = "cursor", nulls = Nulls.SKIP) + public Builder cursor(Optional cursor) { + this.cursor = cursor; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = Optional.ofNullable(cursor); + return this; + } + + /** + *

            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.

            + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

            If provided, only objects synced by Merge after this date time will be returned.

            + */ + @JsonSetter(value = "modified_after", nulls = Nulls.SKIP) + public Builder modifiedAfter(Optional modifiedAfter) { + this.modifiedAfter = modifiedAfter; + return this; + } + + public Builder modifiedAfter(OffsetDateTime modifiedAfter) { + this.modifiedAfter = Optional.ofNullable(modifiedAfter); + return this; + } + + /** + *

            If provided, only objects synced by Merge before this date time will be returned.

            + */ + @JsonSetter(value = "modified_before", nulls = Nulls.SKIP) + public Builder modifiedBefore(Optional modifiedBefore) { + this.modifiedBefore = modifiedBefore; + return this; + } + + public Builder modifiedBefore(OffsetDateTime modifiedBefore) { + this.modifiedBefore = Optional.ofNullable(modifiedBefore); + return this; + } + + /** + *

            Number of results to return per page. The maximum limit is 100.

            + */ + @JsonSetter(value = "page_size", nulls = Nulls.SKIP) + public Builder pageSize(Optional pageSize) { + this.pageSize = pageSize; + return this; + } + + public Builder pageSize(Integer pageSize) { + this.pageSize = Optional.ofNullable(pageSize); + return this; + } + + /** + *

            The API provider's ID for the given object.

            + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + public UsersListRequest build() { + return new UsersListRequest( + createdAfter, + createdBefore, + cursor, + includeDeletedData, + includeRemoteData, + includeShellData, + modifiedAfter, + modifiedBefore, + pageSize, + remoteId, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/UsersRetrieveRequest.java b/src/main/java/com/merge/api/knowledgebase/types/UsersRetrieveRequest.java new file mode 100644 index 000000000..69d62a66e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/UsersRetrieveRequest.java @@ -0,0 +1,132 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = UsersRetrieveRequest.Builder.class) +public final class UsersRetrieveRequest { + private final Optional includeRemoteData; + + private final Optional includeShellData; + + private final Map additionalProperties; + + private UsersRetrieveRequest( + Optional includeRemoteData, + Optional includeShellData, + Map additionalProperties) { + this.includeRemoteData = includeRemoteData; + this.includeShellData = includeShellData; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether to include the original data Merge fetched from the third-party to produce these models. + */ + @JsonProperty("include_remote_data") + public Optional getIncludeRemoteData() { + return includeRemoteData; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersRetrieveRequest && equalTo((UsersRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersRetrieveRequest other) { + return includeRemoteData.equals(other.includeRemoteData) && includeShellData.equals(other.includeShellData); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.includeRemoteData, this.includeShellData); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional includeRemoteData = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(UsersRetrieveRequest other) { + includeRemoteData(other.getIncludeRemoteData()); + includeShellData(other.getIncludeShellData()); + return this; + } + + /** + *

            Whether to include the original data Merge fetched from the third-party to produce these models.

            + */ + @JsonSetter(value = "include_remote_data", nulls = Nulls.SKIP) + public Builder includeRemoteData(Optional includeRemoteData) { + this.includeRemoteData = includeRemoteData; + return this; + } + + public Builder includeRemoteData(Boolean includeRemoteData) { + this.includeRemoteData = Optional.ofNullable(includeRemoteData); + return this; + } + + /** + *

            Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

            + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + public UsersRetrieveRequest build() { + return new UsersRetrieveRequest(includeRemoteData, includeShellData, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/ValidationProblemSource.java b/src/main/java/com/merge/api/knowledgebase/types/ValidationProblemSource.java new file mode 100644 index 000000000..3a3899c8e --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/ValidationProblemSource.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ValidationProblemSource.Builder.class) +public final class ValidationProblemSource { + private final String pointer; + + private final Map additionalProperties; + + private ValidationProblemSource(String pointer, Map additionalProperties) { + this.pointer = pointer; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("pointer") + public String getPointer() { + return pointer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ValidationProblemSource && equalTo((ValidationProblemSource) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ValidationProblemSource other) { + return pointer.equals(other.pointer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.pointer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PointerStage builder() { + return new Builder(); + } + + public interface PointerStage { + _FinalStage pointer(@NotNull String pointer); + + Builder from(ValidationProblemSource other); + } + + public interface _FinalStage { + ValidationProblemSource build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PointerStage, _FinalStage { + private String pointer; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ValidationProblemSource other) { + pointer(other.getPointer()); + return this; + } + + @java.lang.Override + @JsonSetter("pointer") + public _FinalStage pointer(@NotNull String pointer) { + this.pointer = pointer; + return this; + } + + @java.lang.Override + public ValidationProblemSource build() { + return new ValidationProblemSource(pointer, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/VisibilityEnum.java b/src/main/java/com/merge/api/knowledgebase/types/VisibilityEnum.java new file mode 100644 index 000000000..2e3a6864d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/VisibilityEnum.java @@ -0,0 +1,93 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class VisibilityEnum { + public static final VisibilityEnum RESTRICTED = new VisibilityEnum(Value.RESTRICTED, "RESTRICTED"); + + public static final VisibilityEnum PUBLIC = new VisibilityEnum(Value.PUBLIC, "PUBLIC"); + + public static final VisibilityEnum INTERNAL = new VisibilityEnum(Value.INTERNAL, "INTERNAL"); + + private final Value value; + + private final String string; + + VisibilityEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof VisibilityEnum && this.string.equals(((VisibilityEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RESTRICTED: + return visitor.visitRestricted(); + case PUBLIC: + return visitor.visitPublic(); + case INTERNAL: + return visitor.visitInternal(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static VisibilityEnum valueOf(String value) { + switch (value) { + case "RESTRICTED": + return RESTRICTED; + case "PUBLIC": + return PUBLIC; + case "INTERNAL": + return INTERNAL; + default: + return new VisibilityEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + PUBLIC, + + INTERNAL, + + RESTRICTED, + + UNKNOWN + } + + public interface Visitor { + T visitPublic(); + + T visitInternal(); + + T visitRestricted(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/WarningValidationProblem.java b/src/main/java/com/merge/api/knowledgebase/types/WarningValidationProblem.java new file mode 100644 index 000000000..78cd3336d --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/WarningValidationProblem.java @@ -0,0 +1,282 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WarningValidationProblem.Builder.class) +public final class WarningValidationProblem { + private final Optional source; + + private final String title; + + private final String detail; + + private final String problemType; + + private final Optional blockMergeLink; + + private final Optional rawError; + + private final Optional errorCode; + + private final Map additionalProperties; + + private WarningValidationProblem( + Optional source, + String title, + String detail, + String problemType, + Optional blockMergeLink, + Optional rawError, + Optional errorCode, + Map additionalProperties) { + this.source = source; + this.title = title; + this.detail = detail; + this.problemType = problemType; + this.blockMergeLink = blockMergeLink; + this.rawError = rawError; + this.errorCode = errorCode; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("source") + public Optional getSource() { + return source; + } + + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + @JsonProperty("problem_type") + public String getProblemType() { + return problemType; + } + + @JsonProperty("block_merge_link") + public Optional getBlockMergeLink() { + return blockMergeLink; + } + + @JsonProperty("raw_error") + public Optional getRawError() { + return rawError; + } + + @JsonProperty("error_code") + public Optional getErrorCode() { + return errorCode; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WarningValidationProblem && equalTo((WarningValidationProblem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WarningValidationProblem other) { + return source.equals(other.source) + && title.equals(other.title) + && detail.equals(other.detail) + && problemType.equals(other.problemType) + && blockMergeLink.equals(other.blockMergeLink) + && rawError.equals(other.rawError) + && errorCode.equals(other.errorCode); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.source, + this.title, + this.detail, + this.problemType, + this.blockMergeLink, + this.rawError, + this.errorCode); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TitleStage builder() { + return new Builder(); + } + + public interface TitleStage { + DetailStage title(@NotNull String title); + + Builder from(WarningValidationProblem other); + } + + public interface DetailStage { + ProblemTypeStage detail(@NotNull String detail); + } + + public interface ProblemTypeStage { + _FinalStage problemType(@NotNull String problemType); + } + + public interface _FinalStage { + WarningValidationProblem build(); + + _FinalStage source(Optional source); + + _FinalStage source(ValidationProblemSource source); + + _FinalStage blockMergeLink(Optional blockMergeLink); + + _FinalStage blockMergeLink(Boolean blockMergeLink); + + _FinalStage rawError(Optional rawError); + + _FinalStage rawError(String rawError); + + _FinalStage errorCode(Optional errorCode); + + _FinalStage errorCode(Integer errorCode); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TitleStage, DetailStage, ProblemTypeStage, _FinalStage { + private String title; + + private String detail; + + private String problemType; + + private Optional errorCode = Optional.empty(); + + private Optional rawError = Optional.empty(); + + private Optional blockMergeLink = Optional.empty(); + + private Optional source = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WarningValidationProblem other) { + source(other.getSource()); + title(other.getTitle()); + detail(other.getDetail()); + problemType(other.getProblemType()); + blockMergeLink(other.getBlockMergeLink()); + rawError(other.getRawError()); + errorCode(other.getErrorCode()); + return this; + } + + @java.lang.Override + @JsonSetter("title") + public DetailStage title(@NotNull String title) { + this.title = title; + return this; + } + + @java.lang.Override + @JsonSetter("detail") + public ProblemTypeStage detail(@NotNull String detail) { + this.detail = detail; + return this; + } + + @java.lang.Override + @JsonSetter("problem_type") + public _FinalStage problemType(@NotNull String problemType) { + this.problemType = problemType; + return this; + } + + @java.lang.Override + public _FinalStage errorCode(Integer errorCode) { + this.errorCode = Optional.ofNullable(errorCode); + return this; + } + + @java.lang.Override + @JsonSetter(value = "error_code", nulls = Nulls.SKIP) + public _FinalStage errorCode(Optional errorCode) { + this.errorCode = errorCode; + return this; + } + + @java.lang.Override + public _FinalStage rawError(String rawError) { + this.rawError = Optional.ofNullable(rawError); + return this; + } + + @java.lang.Override + @JsonSetter(value = "raw_error", nulls = Nulls.SKIP) + public _FinalStage rawError(Optional rawError) { + this.rawError = rawError; + return this; + } + + @java.lang.Override + public _FinalStage blockMergeLink(Boolean blockMergeLink) { + this.blockMergeLink = Optional.ofNullable(blockMergeLink); + return this; + } + + @java.lang.Override + @JsonSetter(value = "block_merge_link", nulls = Nulls.SKIP) + public _FinalStage blockMergeLink(Optional blockMergeLink) { + this.blockMergeLink = blockMergeLink; + return this; + } + + @java.lang.Override + public _FinalStage source(ValidationProblemSource source) { + this.source = Optional.ofNullable(source); + return this; + } + + @java.lang.Override + @JsonSetter(value = "source", nulls = Nulls.SKIP) + public _FinalStage source(Optional source) { + this.source = source; + return this; + } + + @java.lang.Override + public WarningValidationProblem build() { + return new WarningValidationProblem( + source, title, detail, problemType, blockMergeLink, rawError, errorCode, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/WebhookReceiver.java b/src/main/java/com/merge/api/knowledgebase/types/WebhookReceiver.java new file mode 100644 index 000000000..009e12108 --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/WebhookReceiver.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiver.Builder.class) +public final class WebhookReceiver { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiver( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiver && equalTo((WebhookReceiver) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiver other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiver other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiver build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiver other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiver build() { + return new WebhookReceiver(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/knowledgebase/types/WebhookReceiverRequest.java b/src/main/java/com/merge/api/knowledgebase/types/WebhookReceiverRequest.java new file mode 100644 index 000000000..05dbf38fe --- /dev/null +++ b/src/main/java/com/merge/api/knowledgebase/types/WebhookReceiverRequest.java @@ -0,0 +1,155 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.knowledgebase.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = WebhookReceiverRequest.Builder.class) +public final class WebhookReceiverRequest { + private final String event; + + private final boolean isActive; + + private final Optional key; + + private final Map additionalProperties; + + private WebhookReceiverRequest( + String event, boolean isActive, Optional key, Map additionalProperties) { + this.event = event; + this.isActive = isActive; + this.key = key; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("event") + public String getEvent() { + return event; + } + + @JsonProperty("is_active") + public boolean getIsActive() { + return isActive; + } + + @JsonProperty("key") + public Optional getKey() { + return key; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WebhookReceiverRequest && equalTo((WebhookReceiverRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(WebhookReceiverRequest other) { + return event.equals(other.event) && isActive == other.isActive && key.equals(other.key); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.event, this.isActive, this.key); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EventStage builder() { + return new Builder(); + } + + public interface EventStage { + IsActiveStage event(@NotNull String event); + + Builder from(WebhookReceiverRequest other); + } + + public interface IsActiveStage { + _FinalStage isActive(boolean isActive); + } + + public interface _FinalStage { + WebhookReceiverRequest build(); + + _FinalStage key(Optional key); + + _FinalStage key(String key); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EventStage, IsActiveStage, _FinalStage { + private String event; + + private boolean isActive; + + private Optional key = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(WebhookReceiverRequest other) { + event(other.getEvent()); + isActive(other.getIsActive()); + key(other.getKey()); + return this; + } + + @java.lang.Override + @JsonSetter("event") + public IsActiveStage event(@NotNull String event) { + this.event = event; + return this; + } + + @java.lang.Override + @JsonSetter("is_active") + public _FinalStage isActive(boolean isActive) { + this.isActive = isActive; + return this; + } + + @java.lang.Override + public _FinalStage key(String key) { + this.key = Optional.ofNullable(key); + return this; + } + + @java.lang.Override + @JsonSetter(value = "key", nulls = Nulls.SKIP) + public _FinalStage key(Optional key) { + this.key = key; + return this; + } + + @java.lang.Override + public WebhookReceiverRequest build() { + return new WebhookReceiverRequest(event, isActive, key, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/AccountTokenClient.java b/src/main/java/com/merge/api/ticketing/AccountTokenClient.java index 05b012dc0..b9ddd3440 100644 --- a/src/main/java/com/merge/api/ticketing/AccountTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/AccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.ticketing.types.AccountToken; +import com.merge.api.ticketing.types.RegenerateAccountToken; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -37,4 +38,18 @@ public AccountToken retrieve(String publicToken) { public AccountToken retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).body(); } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate() { + return this.rawClient.regenerateCreate().body(); + } + + /** + * Exchange Linked Account account tokens. + */ + public RegenerateAccountToken regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).body(); + } } diff --git a/src/main/java/com/merge/api/ticketing/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncAccountTokenClient.java index 5ad1b4d10..3f690707a 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncAccountTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncAccountTokenClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.ticketing.types.AccountToken; +import com.merge.api.ticketing.types.RegenerateAccountToken; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -38,4 +39,18 @@ public CompletableFuture retrieve(String publicToken) { public CompletableFuture retrieve(String publicToken, RequestOptions requestOptions) { return this.rawClient.retrieve(publicToken, requestOptions).thenApply(response -> response.body()); } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate() { + return this.rawClient.regenerateCreate().thenApply(response -> response.body()); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture regenerateCreate(RequestOptions requestOptions) { + return this.rawClient.regenerateCreate(requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/merge/api/ticketing/AsyncLinkTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncLinkTokenClient.java index f360911c4..7fc8c40e4 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncLinkTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncLinkTokenClient.java @@ -27,14 +27,14 @@ public AsyncRawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request) { return this.rawClient.create(request).thenApply(response -> response.body()); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAccountDetailsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAccountDetailsClient.java index 4a87072e7..a9b4d938c 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAccountDetailsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(RequestO @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAccountTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAccountTokenClient.java index d90edf025..f21e45cc5 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAccountTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAccountTokenClient.java @@ -10,6 +10,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.ticketing.types.AccountToken; +import com.merge.api.ticketing.types.RegenerateAccountToken; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -18,6 +19,7 @@ import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; import org.jetbrains.annotations.NotNull; @@ -61,18 +63,70 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public CompletableFuture> regenerateCreate( + RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("ticketing/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response)); + return; + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java index 9a00464cd..af61b6475 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java @@ -121,9 +121,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); Optional startingAfter = parsedResponse.getNext(); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) @@ -144,12 +145,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -213,17 +211,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java index 9365dede5..20b8cc208 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java @@ -73,19 +73,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -133,19 +130,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + responseBodyString, AsyncPassthroughRetrieveResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java index 033331375..05430d458 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java @@ -24,9 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -147,9 +145,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedAttachmentList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAttachmentList.class); + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); Optional startingAfter = parsedResponse.getNext(); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) @@ -170,12 +169,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -214,12 +210,10 @@ public CompletableFuture> crea QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -239,19 +233,17 @@ public CompletableFuture> crea @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), TicketingAttachmentResponse.class), + responseBodyString, TicketingAttachmentResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -319,18 +311,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Attachment.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -398,11 +387,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -447,18 +434,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java index 59ba55c29..5a9ad0f76 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java @@ -99,9 +99,10 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAuditLogEventList.class); + responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -122,12 +123,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawAvailableActionsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawAvailableActionsClient.java index ff2864a31..91bea9ca5 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAvailableActionsClient.java @@ -59,18 +59,16 @@ public CompletableFuture> retrieve(Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java index 18805a15c..43399da29 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java @@ -152,9 +152,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedCollectionList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedCollectionList.class); + PaginatedCollectionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCollectionList.class); Optional startingAfter = parsedResponse.getNext(); CollectionsListRequest nextRequest = CollectionsListRequest.builder() .from(request) @@ -175,12 +176,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -265,9 +263,10 @@ public CompletableFuture>> viewe @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedViewerList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); Optional startingAfter = parsedResponse.getNext(); CollectionsViewersListRequest nextRequest = CollectionsViewersListRequest.builder() .from(request) @@ -288,12 +287,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -369,18 +365,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Collection.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Collection.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java index 7b06ac94e..435f8da8e 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java @@ -21,9 +21,7 @@ import com.merge.api.ticketing.types.PaginatedCommentList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -143,9 +141,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCommentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCommentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCommentList.class); Optional startingAfter = parsedResponse.getNext(); CommentsListRequest nextRequest = CommentsListRequest.builder() .from(request) @@ -166,12 +165,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -209,12 +205,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -234,18 +228,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommentResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommentResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -313,17 +305,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Comment.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Comment.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -368,18 +358,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java index 3e554c2fa..05cd3a64f 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java @@ -21,9 +21,7 @@ import com.merge.api.ticketing.types.TicketingContactResponse; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -136,9 +134,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedContactList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); Optional startingAfter = parsedResponse.getNext(); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) @@ -159,12 +158,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -203,12 +199,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -228,19 +222,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), TicketingContactResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TicketingContactResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -308,17 +299,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Contact.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -363,18 +352,15 @@ public CompletableFuture> metaPostRetrieve(Re @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawDeleteAccountClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawDeleteAccountClient.java index 2f99902ba..121c8fb7b 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawDeleteAccountClient.java @@ -63,11 +63,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO return; } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java index 9648e816d..6a11614e8 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.ticketing; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.ticketing.types.RemoteFieldApiResponse; import com.merge.api.ticketing.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import java.util.concurrent.CompletableFuture; import okhttp3.Call; import okhttp3.Callback; @@ -87,19 +84,17 @@ public CompletableFuture> @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + responseBodyString, FieldMappingApiInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -137,17 +132,17 @@ public CompletableFuture> fie request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -167,19 +162,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -227,19 +220,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -276,25 +267,31 @@ public CompletableFuture> fie */ public CompletableFuture> fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); @@ -304,19 +301,17 @@ public CompletableFuture> fie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingInstanceResponse.class), + responseBodyString, FieldMappingInstanceResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -380,19 +375,16 @@ public CompletableFuture> remoteFie @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -438,19 +430,17 @@ public CompletableFuture> t @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + responseBodyString, ExternalTargetFieldApiResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawForceResyncClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawForceResyncClient.java index dd87696eb..6baa37762 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawForceResyncClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawForceResyncClient.java @@ -63,19 +63,17 @@ public CompletableFuture>> syncStatusResyn @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawGenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawGenerateKeyClient.java index 10620d0bb..867e6cedd 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawGenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java index 806d4c43b..f173f29ec 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java @@ -145,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -167,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -218,17 +216,15 @@ public CompletableFuture> retrieve(String id, Reques @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java index 1cb2ef480..55cbfa633 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java @@ -34,14 +34,14 @@ public AsyncRawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public CompletableFuture> create( EndUserDetailsRequest request, RequestOptions requestOptions) { @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java index 1cdf01645..c7d3fd1fe 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java @@ -138,9 +138,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -162,12 +163,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawPassthroughClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawPassthroughClient.java index 8f061e1f6..b9dae3958 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawPassthroughClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawPassthroughClient.java @@ -72,18 +72,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java index aa8519c2c..d13e9bc01 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java @@ -124,9 +124,10 @@ public CompletableFuture>> list @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedProjectList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class); Optional startingAfter = parsedResponse.getNext(); ProjectsListRequest nextRequest = ProjectsListRequest.builder() .from(request) @@ -147,12 +148,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -216,17 +214,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Project.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Project.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -311,9 +307,10 @@ public CompletableFuture>> usersLi @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); ProjectsUsersListRequest nextRequest = ProjectsUsersListRequest.builder() .from(request) @@ -333,12 +330,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawRegenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawRegenerateKeyClient.java index 234ea77c8..cab816b1b 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawRegenerateKeyClient.java @@ -72,17 +72,15 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java index cc2b2c286..c2b64140d 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java @@ -121,9 +121,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRoleList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRoleList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRoleList.class); Optional startingAfter = parsedResponse.getNext(); RolesListRequest nextRequest = RolesListRequest.builder() .from(request) @@ -143,12 +144,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -212,17 +210,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Role.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Role.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawScopesClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawScopesClient.java index 677b22cfa..0d9a4a0b5 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawScopesClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawScopesClient.java @@ -64,18 +64,16 @@ public CompletableFuture> defaultScope @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -121,18 +119,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -187,18 +183,16 @@ public CompletableFuture> linkedAccoun @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java index 1bac10ee3..712880bd3 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java @@ -82,9 +82,10 @@ public CompletableFuture>> l @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { - PaginatedSyncStatusList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedSyncStatusList.class); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -105,12 +106,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java index 281cfd46d..ca7d76cb4 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java @@ -121,9 +121,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTagList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); Optional startingAfter = parsedResponse.getNext(); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) @@ -143,12 +144,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -212,17 +210,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Tag.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Tag.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java index 39609a03b..3b3c7116e 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java @@ -121,9 +121,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTeamList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); Optional startingAfter = parsedResponse.getNext(); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) @@ -143,12 +144,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -212,17 +210,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Team.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java index 58931016b..da460e926 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java @@ -11,6 +11,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; +import com.merge.api.core.ResponseBodyInputStream; import com.merge.api.core.SyncPagingIterable; import com.merge.api.ticketing.types.MetaResponse; import com.merge.api.ticketing.types.PaginatedRemoteFieldClassList; @@ -22,16 +23,16 @@ import com.merge.api.ticketing.types.TicketEndpointRequest; import com.merge.api.ticketing.types.TicketResponse; import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsLiveSearchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; import com.merge.api.ticketing.types.TicketsViewersListRequest; import com.merge.api.ticketing.types.Viewer; import java.io.IOException; +import java.io.InputStream; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -198,6 +199,10 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "remote_id", request.getRemoteId().get(), false); } + if (request.getRemoteIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_ids", request.getRemoteIds().get(), false); + } if (request.getRemoteUpdatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -251,9 +256,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTicketList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTicketList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTicketList.class); Optional startingAfter = parsedResponse.getNext(); TicketsListRequest nextRequest = TicketsListRequest.builder() .from(request) @@ -274,12 +280,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -317,12 +320,10 @@ public CompletableFuture> create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -342,18 +343,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TicketResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -436,17 +435,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Ticket.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Ticket.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -486,12 +483,10 @@ public CompletableFuture> partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -511,18 +506,16 @@ public CompletableFuture> partialUpdate( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TicketResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -607,9 +600,10 @@ public CompletableFuture>> viewe @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedViewerList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); Optional startingAfter = parsedResponse.getNext(); TicketsViewersListRequest nextRequest = TicketsViewersListRequest.builder() .from(request) @@ -630,12 +624,127 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new ApiError( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture> liveSearchRetrieve() { + return liveSearchRetrieve(TicketsLiveSearchRetrieveRequest.builder().build()); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture> liveSearchRetrieve( + TicketsLiveSearchRetrieveRequest request) { + return liveSearchRetrieve(request, null); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture> liveSearchRetrieve( + TicketsLiveSearchRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/live-search"); + if (request.getAssigneeIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "assignee_ids", request.getAssigneeIds().get(), false); + } + if (request.getAssignees().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "assignees", request.getAssignees().get(), false); + } + if (request.getCollectionIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collection_ids", request.getCollectionIds().get(), false); + } + if (request.getCollections().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collections", request.getCollections().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getRemoteCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_cursor", request.getRemoteCursor().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getTicketUrl().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_url", request.getTicketUrl().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try { + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + future.complete(new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response)); + return; + } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -682,18 +791,15 @@ public CompletableFuture> metaPatchRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -754,18 +860,15 @@ public CompletableFuture> metaPostRetrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -860,9 +963,10 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); TicketsRemoteFieldClassesListRequest nextRequest = TicketsRemoteFieldClassesListRequest.builder() @@ -885,12 +989,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java index a0f09cbef..e3f019159 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java @@ -60,6 +60,10 @@ public CompletableFuture>> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/users"); + if (request.getCollections().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collections", request.getCollections().get(), false); + } if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -110,10 +114,18 @@ public CompletableFuture>> list( QueryStringMapper.addQueryParameter( httpUrl, "remote_id", request.getRemoteId().get(), false); } + if (request.getRoles().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "roles", request.getRoles().get(), false); + } if (request.getTeam().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "team", request.getTeam().get(), false); } + if (request.getTeams().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "teams", request.getTeams().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -133,9 +145,10 @@ public CompletableFuture>> list( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -155,12 +168,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -228,17 +238,15 @@ public CompletableFuture> retrieve( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncRawWebhookReceiversClient.java b/src/main/java/com/merge/api/ticketing/AsyncRawWebhookReceiversClient.java index b7d70910e..df4e27140 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawWebhookReceiversClient.java @@ -65,19 +65,17 @@ public CompletableFuture>> list(Reque @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); @@ -131,18 +129,16 @@ public CompletableFuture> create( @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "Error with status code " + response.code(), response.code(), errorBody, response)); return; } catch (IOException e) { future.completeExceptionally(new MergeException("Network error executing HTTP request", e)); diff --git a/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java b/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java index 19f406d9e..cc6e0e58d 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java @@ -13,11 +13,13 @@ import com.merge.api.ticketing.types.TicketEndpointRequest; import com.merge.api.ticketing.types.TicketResponse; import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsLiveSearchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; import com.merge.api.ticketing.types.TicketsViewersListRequest; import com.merge.api.ticketing.types.Viewer; +import java.io.InputStream; import java.util.concurrent.CompletableFuture; public class AsyncTicketsClient { @@ -133,6 +135,28 @@ public CompletableFuture> viewersList( return this.rawClient.viewersList(ticketId, request, requestOptions).thenApply(response -> response.body()); } + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture liveSearchRetrieve() { + return this.rawClient.liveSearchRetrieve().thenApply(response -> response.body()); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture liveSearchRetrieve(TicketsLiveSearchRetrieveRequest request) { + return this.rawClient.liveSearchRetrieve(request).thenApply(response -> response.body()); + } + + /** + * Returns a list of Ticket objects. + */ + public CompletableFuture liveSearchRetrieve( + TicketsLiveSearchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.liveSearchRetrieve(request, requestOptions).thenApply(response -> response.body()); + } + /** * Returns metadata for Ticket PATCHs. */ diff --git a/src/main/java/com/merge/api/ticketing/LinkTokenClient.java b/src/main/java/com/merge/api/ticketing/LinkTokenClient.java index d9ad4b66a..e297618ab 100644 --- a/src/main/java/com/merge/api/ticketing/LinkTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/LinkTokenClient.java @@ -26,14 +26,14 @@ public RawLinkTokenClient withRawResponse() { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request) { return this.rawClient.create(request).body(); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public LinkToken create(EndUserDetailsRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); diff --git a/src/main/java/com/merge/api/ticketing/RawAccountDetailsClient.java b/src/main/java/com/merge/api/ticketing/RawAccountDetailsClient.java index f793a8cb5..4064710e1 100644 --- a/src/main/java/com/merge/api/ticketing/RawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAccountDetailsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOptio } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountDetails.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountDetails.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java b/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java index e8d4587f9..bc06ac9b8 100644 --- a/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java @@ -10,11 +10,13 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.ticketing.types.AccountToken; +import com.merge.api.ticketing.types.RegenerateAccountToken; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; +import okhttp3.RequestBody; import okhttp3.Response; import okhttp3.ResponseBody; @@ -53,16 +55,53 @@ public MergeApiHttpResponse retrieve(String publicToken, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate() { + return regenerateCreate(null); + } + + /** + * Exchange Linked Account account tokens. + */ + public MergeApiHttpResponse regenerateCreate(RequestOptions requestOptions) { + HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("ticketing/v1/account-token/regenerate") + .build(); + Request okhttpRequest = new Request.Builder() + .url(httpUrl) + .method("POST", RequestBody.create("", null)) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RegenerateAccountToken.class), + response); + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawAccountsClient.java b/src/main/java/com/merge/api/ticketing/RawAccountsClient.java index 824485bc6..d12217a96 100644 --- a/src/main/java/com/merge/api/ticketing/RawAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAccountsClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAccountList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); Optional startingAfter = parsedResponse.getNext(); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) @@ -128,12 +129,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -185,16 +182,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Account.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Account.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java b/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java index 421ecaa11..7671a06a5 100644 --- a/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java @@ -66,17 +66,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AsyncPassthroughReciept.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughReciept.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -111,18 +108,14 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), AsyncPassthroughRetrieveResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AsyncPassthroughRetrieveResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java b/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java index 0fc691a0a..9eb300810 100644 --- a/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java @@ -24,9 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -138,9 +136,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAttachmentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAttachmentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); Optional startingAfter = parsedResponse.getNext(); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) @@ -154,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -188,12 +183,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -210,17 +203,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketingAttachmentResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TicketingAttachmentResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -276,16 +266,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Attachment.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Attachment.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -339,11 +326,8 @@ public MergeApiHttpResponse downloadRetrieve( return new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -376,16 +360,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java b/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java index 55e794ff6..1b9dbb680 100644 --- a/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java @@ -90,9 +90,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAuditLogEventList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedAuditLogEventList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); Optional startingAfter = parsedResponse.getNext(); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) @@ -106,12 +107,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawAvailableActionsClient.java b/src/main/java/com/merge/api/ticketing/RawAvailableActionsClient.java index 32a17d37f..aa9c95de4 100644 --- a/src/main/java/com/merge/api/ticketing/RawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAvailableActionsClient.java @@ -52,16 +52,13 @@ public MergeApiHttpResponse retrieve(RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), AvailableActions.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AvailableActions.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java b/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java index 38810bcd4..29d36bcf5 100644 --- a/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java @@ -143,9 +143,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCollectionList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCollectionList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCollectionList.class); Optional startingAfter = parsedResponse.getNext(); CollectionsListRequest nextRequest = CollectionsListRequest.builder() .from(request) @@ -159,12 +160,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -237,9 +234,10 @@ public MergeApiHttpResponse> viewersList( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedViewerList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); Optional startingAfter = parsedResponse.getNext(); CollectionsViewersListRequest nextRequest = CollectionsViewersListRequest.builder() .from(request) @@ -253,12 +251,8 @@ public MergeApiHttpResponse> viewersList( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -322,16 +316,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Collection.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Collection.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawCommentsClient.java b/src/main/java/com/merge/api/ticketing/RawCommentsClient.java index 5c8f80c89..1bf6fbb10 100644 --- a/src/main/java/com/merge/api/ticketing/RawCommentsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawCommentsClient.java @@ -21,9 +21,7 @@ import com.merge.api.ticketing.types.PaginatedCommentList; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -135,9 +133,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedCommentList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedCommentList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCommentList.class); Optional startingAfter = parsedResponse.getNext(); CommentsListRequest nextRequest = CommentsListRequest.builder() .from(request) @@ -150,12 +149,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -183,12 +178,10 @@ public MergeApiHttpResponse create(CommentEndpointRequest reque QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -205,16 +198,13 @@ public MergeApiHttpResponse create(CommentEndpointRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommentResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommentResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -270,16 +260,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Comment.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Comment.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -312,16 +299,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawContactsClient.java b/src/main/java/com/merge/api/ticketing/RawContactsClient.java index c2da76ae6..b5af377e9 100644 --- a/src/main/java/com/merge/api/ticketing/RawContactsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawContactsClient.java @@ -21,9 +21,7 @@ import com.merge.api.ticketing.types.TicketingContactResponse; import java.io.IOException; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -128,9 +126,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedContactList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedContactList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); Optional startingAfter = parsedResponse.getNext(); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) @@ -143,12 +142,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -177,12 +172,10 @@ public MergeApiHttpResponse create( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -199,17 +192,14 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketingContactResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TicketingContactResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -265,16 +255,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Contact.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Contact.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -307,16 +294,13 @@ public MergeApiHttpResponse metaPostRetrieve(RequestOptions reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawDeleteAccountClient.java b/src/main/java/com/merge/api/ticketing/RawDeleteAccountClient.java index 43d9fff26..504d01c13 100644 --- a/src/main/java/com/merge/api/ticketing/RawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/ticketing/RawDeleteAccountClient.java @@ -55,11 +55,8 @@ public MergeApiHttpResponse delete(RequestOptions requestOptions) { return new MergeApiHttpResponse<>(null, response); } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java b/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java index cfcc99a98..cf080410d 100644 --- a/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java @@ -3,7 +3,6 @@ */ package com.merge.api.ticketing; -import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MediaTypes; @@ -21,8 +20,6 @@ import com.merge.api.ticketing.types.RemoteFieldApiResponse; import com.merge.api.ticketing.types.RemoteFieldsRetrieveRequest; import java.io.IOException; -import java.util.HashMap; -import java.util.Map; import okhttp3.Headers; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; @@ -80,18 +77,14 @@ public MergeApiHttpResponse fieldMappingsRetrie } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), FieldMappingApiInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingApiInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -119,17 +112,17 @@ public MergeApiHttpResponse fieldMappingsCreate( request.getExcludeRemoteFieldMetadata().get(), false); } - Map properties = new HashMap<>(); - properties.put("target_field_name", request.getTargetFieldName()); - properties.put("target_field_description", request.getTargetFieldDescription()); - properties.put("remote_field_traversal_path", request.getRemoteFieldTraversalPath()); - properties.put("remote_method", request.getRemoteMethod()); - properties.put("remote_url_path", request.getRemoteUrlPath()); - properties.put("common_model_name", request.getCommonModelName()); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -146,17 +139,14 @@ public MergeApiHttpResponse fieldMappingsCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,17 +181,14 @@ public MergeApiHttpResponse fieldMappingsDestroy( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -228,42 +215,45 @@ public MergeApiHttpResponse fieldMappingsPartialUp */ public MergeApiHttpResponse fieldMappingsPartialUpdate( String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { - HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/field-mappings") - .addPathSegment(fieldMappingId) - .build(); + .addPathSegment(fieldMappingId); + if (request.getRemoteDataIterationCount().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "remote_data_iteration_count", + request.getRemoteDataIterationCount().get(), + false); + } RequestBody body; try { body = RequestBody.create( ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); - } catch (JsonProcessingException e) { - throw new MergeException("Failed to serialize request", e); + } catch (Exception e) { + throw new RuntimeException(e); } - Request okhttpRequest = new Request.Builder() - .url(httpUrl) + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) .method("PATCH", body) .headers(Headers.of(clientOptions.headers(requestOptions))) .addHeader("Content-Type", "application/json") - .addHeader("Accept", "application/json") - .build(); + .addHeader("Accept", "application/json"); + Request okhttpRequest = _requestBuilder.build(); OkHttpClient client = clientOptions.httpClient(); if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), FieldMappingInstanceResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, FieldMappingInstanceResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -314,17 +304,14 @@ public MergeApiHttpResponse remoteFieldsRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -357,18 +344,14 @@ public MergeApiHttpResponse targetFieldsRetrieve } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), ExternalTargetFieldApiResponse.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, ExternalTargetFieldApiResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawForceResyncClient.java b/src/main/java/com/merge/api/ticketing/RawForceResyncClient.java index f1a9e59f7..ccb5834ac 100644 --- a/src/main/java/com/merge/api/ticketing/RawForceResyncClient.java +++ b/src/main/java/com/merge/api/ticketing/RawForceResyncClient.java @@ -55,18 +55,15 @@ public MergeApiHttpResponse> syncStatusResyncCreate(RequestOpti } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawGenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/RawGenerateKeyClient.java index b264614e2..deae19cc2 100644 --- a/src/main/java/com/merge/api/ticketing/RawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/ticketing/RawGenerateKeyClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawIssuesClient.java b/src/main/java/com/merge/api/ticketing/RawIssuesClient.java index 75e4f2080..be461a534 100644 --- a/src/main/java/com/merge/api/ticketing/RawIssuesClient.java +++ b/src/main/java/com/merge/api/ticketing/RawIssuesClient.java @@ -137,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedIssueList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedIssueList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); Optional startingAfter = parsedResponse.getNext(); IssuesListRequest nextRequest = IssuesListRequest.builder() .from(request) @@ -152,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -191,16 +188,13 @@ public MergeApiHttpResponse retrieve(String id, RequestOptions requestOpt } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Issue.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Issue.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java b/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java index f6d77aaa0..ee4c48449 100644 --- a/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java @@ -30,14 +30,14 @@ public RawLinkTokenClient(ClientOptions clientOptions) { } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request) { return create(request, null); } /** - * Creates a link token to be used when linking a new end user. + * Creates a link token to be used when linking a new end user. The link token expires after single use. */ public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(EndUserDetailsRequest request, Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), LinkToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, LinkToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java b/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java index fb5351db3..b03fb6d61 100644 --- a/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java @@ -128,9 +128,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedAccountDetailsAndActionsList parsedResponse = ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedAccountDetailsAndActionsList.class); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); Optional startingAfter = parsedResponse.getNext(); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) @@ -145,12 +146,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawPassthroughClient.java b/src/main/java/com/merge/api/ticketing/RawPassthroughClient.java index 6d58f4933..7bdd67045 100644 --- a/src/main/java/com/merge/api/ticketing/RawPassthroughClient.java +++ b/src/main/java/com/merge/api/ticketing/RawPassthroughClient.java @@ -64,16 +64,13 @@ public MergeApiHttpResponse create(DataPassthroughRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawProjectsClient.java b/src/main/java/com/merge/api/ticketing/RawProjectsClient.java index c982151d7..a85aca7f8 100644 --- a/src/main/java/com/merge/api/ticketing/RawProjectsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawProjectsClient.java @@ -116,9 +116,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedProjectList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class); Optional startingAfter = parsedResponse.getNext(); ProjectsListRequest nextRequest = ProjectsListRequest.builder() .from(request) @@ -131,12 +132,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -188,16 +185,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Project.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Project.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -269,9 +263,10 @@ public MergeApiHttpResponse> usersList( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); ProjectsUsersListRequest nextRequest = ProjectsUsersListRequest.builder() .from(request) @@ -284,12 +279,8 @@ public MergeApiHttpResponse> usersList( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawRegenerateKeyClient.java b/src/main/java/com/merge/api/ticketing/RawRegenerateKeyClient.java index 279abd171..58c9b52d7 100644 --- a/src/main/java/com/merge/api/ticketing/RawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/ticketing/RawRegenerateKeyClient.java @@ -65,16 +65,13 @@ public MergeApiHttpResponse create( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), RemoteKey.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, RemoteKey.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawRolesClient.java b/src/main/java/com/merge/api/ticketing/RawRolesClient.java index 70138aec1..1e7ea43fc 100644 --- a/src/main/java/com/merge/api/ticketing/RawRolesClient.java +++ b/src/main/java/com/merge/api/ticketing/RawRolesClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRoleList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRoleList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRoleList.class); Optional startingAfter = parsedResponse.getNext(); RolesListRequest nextRequest = RolesListRequest.builder() .from(request) @@ -128,12 +129,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -184,16 +181,13 @@ public MergeApiHttpResponse retrieve(String id, RolesRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Role.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Role.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawScopesClient.java b/src/main/java/com/merge/api/ticketing/RawScopesClient.java index 79fcb031d..0100ccac2 100644 --- a/src/main/java/com/merge/api/ticketing/RawScopesClient.java +++ b/src/main/java/com/merge/api/ticketing/RawScopesClient.java @@ -56,17 +56,13 @@ public MergeApiHttpResponse defaultScopesRetrieve(RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -99,17 +95,13 @@ public MergeApiHttpResponse linkedAccountScopesRetrieve(Req } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -152,17 +144,13 @@ public MergeApiHttpResponse linkedAccountScopesCreate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), CommonModelScopeApi.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CommonModelScopeApi.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java b/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java index 9805b9a3d..da524b789 100644 --- a/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java @@ -74,9 +74,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedSyncStatusList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); Optional startingAfter = parsedResponse.getNext(); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) @@ -90,12 +91,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawTagsClient.java b/src/main/java/com/merge/api/ticketing/RawTagsClient.java index 97e639a08..208ebe674 100644 --- a/src/main/java/com/merge/api/ticketing/RawTagsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawTagsClient.java @@ -112,9 +112,10 @@ public MergeApiHttpResponse> list(TagsListRequest reques } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTagList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTagList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); Optional startingAfter = parsedResponse.getNext(); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) @@ -127,12 +128,8 @@ public MergeApiHttpResponse> list(TagsListRequest reques .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -183,16 +180,13 @@ public MergeApiHttpResponse retrieve(String id, TagsRetrieveRequest request } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Tag.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Tag.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawTeamsClient.java b/src/main/java/com/merge/api/ticketing/RawTeamsClient.java index 0a79ef5e2..1f7bb3dae 100644 --- a/src/main/java/com/merge/api/ticketing/RawTeamsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawTeamsClient.java @@ -113,9 +113,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTeamList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTeamList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); Optional startingAfter = parsedResponse.getNext(); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) @@ -128,12 +129,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -184,16 +181,13 @@ public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Team.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Team.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawTicketsClient.java b/src/main/java/com/merge/api/ticketing/RawTicketsClient.java index e086ab951..21f7a1cd8 100644 --- a/src/main/java/com/merge/api/ticketing/RawTicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawTicketsClient.java @@ -11,6 +11,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; +import com.merge.api.core.ResponseBodyInputStream; import com.merge.api.core.SyncPagingIterable; import com.merge.api.ticketing.types.MetaResponse; import com.merge.api.ticketing.types.PaginatedRemoteFieldClassList; @@ -22,16 +23,16 @@ import com.merge.api.ticketing.types.TicketEndpointRequest; import com.merge.api.ticketing.types.TicketResponse; import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsLiveSearchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; import com.merge.api.ticketing.types.TicketsViewersListRequest; import com.merge.api.ticketing.types.Viewer; import java.io.IOException; +import java.io.InputStream; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.Optional; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -193,6 +194,10 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "remote_id", request.getRemoteId().get(), false); } + if (request.getRemoteIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_ids", request.getRemoteIds().get(), false); + } if (request.getRemoteUpdatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -243,9 +248,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedTicketList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedTicketList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTicketList.class); Optional startingAfter = parsedResponse.getNext(); TicketsListRequest nextRequest = TicketsListRequest.builder() .from(request) @@ -258,12 +264,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -291,12 +293,10 @@ public MergeApiHttpResponse create(TicketEndpointRequest request QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -313,16 +313,13 @@ public MergeApiHttpResponse create(TicketEndpointRequest request } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TicketResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -393,16 +390,13 @@ public MergeApiHttpResponse retrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), Ticket.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Ticket.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -432,12 +426,10 @@ public MergeApiHttpResponse partialUpdate( QueryStringMapper.addQueryParameter( httpUrl, "run_async", request.getRunAsync().get(), false); } - Map properties = new HashMap<>(); - properties.put("model", request.getModel()); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(properties), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); } catch (Exception e) { throw new RuntimeException(e); } @@ -454,16 +446,13 @@ public MergeApiHttpResponse partialUpdate( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), TicketResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, TicketResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -536,9 +525,10 @@ public MergeApiHttpResponse> viewersList( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedViewerList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedViewerList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); Optional startingAfter = parsedResponse.getNext(); TicketsViewersListRequest nextRequest = TicketsViewersListRequest.builder() .from(request) @@ -552,12 +542,111 @@ public MergeApiHttpResponse> viewersList( .body()), response); } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new MergeException("Network error executing HTTP request", e); + } + } + + /** + * Returns a list of Ticket objects. + */ + public MergeApiHttpResponse liveSearchRetrieve() { + return liveSearchRetrieve(TicketsLiveSearchRetrieveRequest.builder().build()); + } + + /** + * Returns a list of Ticket objects. + */ + public MergeApiHttpResponse liveSearchRetrieve(TicketsLiveSearchRetrieveRequest request) { + return liveSearchRetrieve(request, null); + } + + /** + * Returns a list of Ticket objects. + */ + public MergeApiHttpResponse liveSearchRetrieve( + TicketsLiveSearchRetrieveRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("ticketing/v1/tickets/live-search"); + if (request.getAssigneeIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "assignee_ids", request.getAssigneeIds().get(), false); + } + if (request.getAssignees().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "assignees", request.getAssignees().get(), false); + } + if (request.getCollectionIds().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collection_ids", request.getCollectionIds().get(), false); + } + if (request.getCollections().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collections", request.getCollections().get(), false); + } + if (request.getIncludeDeletedData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_deleted_data", + request.getIncludeDeletedData().get(), + false); + } + if (request.getIncludeRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "include_remote_fields", + request.getIncludeRemoteFields().get(), + false); + } + if (request.getIncludeShellData().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "include_shell_data", request.getIncludeShellData().get(), false); + } + if (request.getName().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "name", request.getName().get(), false); + } + if (request.getRemoteCursor().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_cursor", request.getRemoteCursor().get(), false); + } + if (request.getRemoteFields().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "remote_fields", request.getRemoteFields().get(), false); + } + if (request.getShowEnumOrigins().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "show_enum_origins", request.getShowEnumOrigins().get(), false); + } + if (request.getStatus().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "status", request.getStatus().get(), false); + } + if (request.getTicketUrl().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "ticket_url", request.getTicketUrl().get(), false); + } + Request.Builder _requestBuilder = new Request.Builder() + .url(httpUrl.build()) + .method("GET", null) + .headers(Headers.of(clientOptions.headers(requestOptions))); + Request okhttpRequest = _requestBuilder.build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try { + Response response = client.newCall(okhttpRequest).execute(); + ResponseBody responseBody = response.body(); + if (response.isSuccessful()) { + return new MergeApiHttpResponse<>(new ResponseBodyInputStream(response), response); + } String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -591,16 +680,13 @@ public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -648,16 +734,13 @@ public MergeApiHttpResponse metaPostRetrieve( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), MetaResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, MetaResponse.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -739,9 +822,10 @@ public MergeApiHttpResponse> remoteFieldCla } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedRemoteFieldClassList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedRemoteFieldClassList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); Optional startingAfter = parsedResponse.getNext(); TicketsRemoteFieldClassesListRequest nextRequest = TicketsRemoteFieldClassesListRequest.builder() .from(request) @@ -755,12 +839,8 @@ public MergeApiHttpResponse> remoteFieldCla .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawUsersClient.java b/src/main/java/com/merge/api/ticketing/RawUsersClient.java index 1f3a380ac..03f856f22 100644 --- a/src/main/java/com/merge/api/ticketing/RawUsersClient.java +++ b/src/main/java/com/merge/api/ticketing/RawUsersClient.java @@ -55,6 +55,10 @@ public MergeApiHttpResponse> list( HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/users"); + if (request.getCollections().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "collections", request.getCollections().get(), false); + } if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -105,10 +109,18 @@ public MergeApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "remote_id", request.getRemoteId().get(), false); } + if (request.getRoles().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "roles", request.getRoles().get(), false); + } if (request.getTeam().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "team", request.getTeam().get(), false); } + if (request.getTeams().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "teams", request.getTeams().get(), false); + } if (request.getExpand().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "expand", request.getExpand().get(), true); @@ -125,9 +137,10 @@ public MergeApiHttpResponse> list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { PaginatedUserList parsedResponse = - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedUserList.class); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); Optional startingAfter = parsedResponse.getNext(); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) @@ -140,12 +153,8 @@ public MergeApiHttpResponse> list( .body()), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -200,16 +209,13 @@ public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), User.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, User.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/RawWebhookReceiversClient.java b/src/main/java/com/merge/api/ticketing/RawWebhookReceiversClient.java index 77b889e74..2c1e29546 100644 --- a/src/main/java/com/merge/api/ticketing/RawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/ticketing/RawWebhookReceiversClient.java @@ -58,18 +58,15 @@ public MergeApiHttpResponse> list(RequestOptions requestOp } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), new TypeReference>() {}), + responseBodyString, new TypeReference>() {}), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } @@ -110,16 +107,13 @@ public MergeApiHttpResponse create(WebhookReceiverRequest reque } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), WebhookReceiver.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, WebhookReceiver.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new ApiError("Error with status code " + response.code(), response.code(), errorBody, response); } catch (IOException e) { throw new MergeException("Network error executing HTTP request", e); } diff --git a/src/main/java/com/merge/api/ticketing/TicketsClient.java b/src/main/java/com/merge/api/ticketing/TicketsClient.java index fc1dd8a2a..a61966ec2 100644 --- a/src/main/java/com/merge/api/ticketing/TicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/TicketsClient.java @@ -13,11 +13,13 @@ import com.merge.api.ticketing.types.TicketEndpointRequest; import com.merge.api.ticketing.types.TicketResponse; import com.merge.api.ticketing.types.TicketsListRequest; +import com.merge.api.ticketing.types.TicketsLiveSearchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; import com.merge.api.ticketing.types.TicketsViewersListRequest; import com.merge.api.ticketing.types.Viewer; +import java.io.InputStream; public class TicketsClient { protected final ClientOptions clientOptions; @@ -129,6 +131,27 @@ public SyncPagingIterable viewersList( return this.rawClient.viewersList(ticketId, request, requestOptions).body(); } + /** + * Returns a list of Ticket objects. + */ + public InputStream liveSearchRetrieve() { + return this.rawClient.liveSearchRetrieve().body(); + } + + /** + * Returns a list of Ticket objects. + */ + public InputStream liveSearchRetrieve(TicketsLiveSearchRetrieveRequest request) { + return this.rawClient.liveSearchRetrieve(request).body(); + } + + /** + * Returns a list of Ticket objects. + */ + public InputStream liveSearchRetrieve(TicketsLiveSearchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.liveSearchRetrieve(request, requestOptions).body(); + } + /** * Returns metadata for Ticket PATCHs. */ diff --git a/src/main/java/com/merge/api/ticketing/types/AccountDetails.java b/src/main/java/com/merge/api/ticketing/types/AccountDetails.java index 1315becd0..d0a6bead2 100644 --- a/src/main/java/com/merge/api/ticketing/types/AccountDetails.java +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetails.java @@ -45,6 +45,10 @@ public final class AccountDetails { private final Optional completedAt; + private final Optional instanceId; + + private final Optional instanceDisplayValue; + private final Map additionalProperties; private AccountDetails( @@ -60,6 +64,8 @@ private AccountDetails( Optional isDuplicate, Optional accountType, Optional completedAt, + Optional instanceId, + Optional instanceDisplayValue, Map additionalProperties) { this.id = id; this.integration = integration; @@ -73,6 +79,8 @@ private AccountDetails( this.isDuplicate = isDuplicate; this.accountType = accountType; this.completedAt = completedAt; + this.instanceId = instanceId; + this.instanceDisplayValue = instanceDisplayValue; this.additionalProperties = additionalProperties; } @@ -142,6 +150,16 @@ public Optional getCompletedAt() { return completedAt; } + @JsonProperty("instance_id") + public Optional getInstanceId() { + return instanceId; + } + + @JsonProperty("instance_display_value") + public Optional getInstanceDisplayValue() { + return instanceDisplayValue; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -165,7 +183,9 @@ private boolean equalTo(AccountDetails other) { && webhookListenerUrl.equals(other.webhookListenerUrl) && isDuplicate.equals(other.isDuplicate) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && instanceId.equals(other.instanceId) + && instanceDisplayValue.equals(other.instanceDisplayValue); } @java.lang.Override @@ -182,7 +202,9 @@ public int hashCode() { this.webhookListenerUrl, this.isDuplicate, this.accountType, - this.completedAt); + this.completedAt, + this.instanceId, + this.instanceDisplayValue); } @java.lang.Override @@ -220,6 +242,10 @@ public static final class Builder { private Optional completedAt = Optional.empty(); + private Optional instanceId = Optional.empty(); + + private Optional instanceDisplayValue = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -238,6 +264,8 @@ public Builder from(AccountDetails other) { isDuplicate(other.getIsDuplicate()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + instanceId(other.getInstanceId()); + instanceDisplayValue(other.getInstanceDisplayValue()); return this; } @@ -379,6 +407,28 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + @JsonSetter(value = "instance_id", nulls = Nulls.SKIP) + public Builder instanceId(Optional instanceId) { + this.instanceId = instanceId; + return this; + } + + public Builder instanceId(String instanceId) { + this.instanceId = Optional.ofNullable(instanceId); + return this; + } + + @JsonSetter(value = "instance_display_value", nulls = Nulls.SKIP) + public Builder instanceDisplayValue(Optional instanceDisplayValue) { + this.instanceDisplayValue = instanceDisplayValue; + return this; + } + + public Builder instanceDisplayValue(String instanceDisplayValue) { + this.instanceDisplayValue = Optional.ofNullable(instanceDisplayValue); + return this; + } + public AccountDetails build() { return new AccountDetails( id, @@ -393,6 +443,8 @@ public AccountDetails build() { isDuplicate, accountType, completedAt, + instanceId, + instanceDisplayValue, additionalProperties); } } diff --git a/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java index a1518e038..4a078cba0 100644 --- a/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java @@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; @@ -48,6 +49,8 @@ public final class AccountDetailsAndActions { private final OffsetDateTime completedAt; + private final Optional> integrationSpecificFields; + private final Map additionalProperties; private AccountDetailsAndActions( @@ -64,6 +67,7 @@ private AccountDetailsAndActions( Optional integration, String accountType, OffsetDateTime completedAt, + Optional> integrationSpecificFields, Map additionalProperties) { this.id = id; this.category = category; @@ -78,6 +82,7 @@ private AccountDetailsAndActions( this.integration = integration; this.accountType = accountType; this.completedAt = completedAt; + this.integrationSpecificFields = integrationSpecificFields; this.additionalProperties = additionalProperties; } @@ -152,6 +157,11 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonProperty("integration_specific_fields") + public Optional> getIntegrationSpecificFields() { + return integrationSpecificFields; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -176,7 +186,8 @@ private boolean equalTo(AccountDetailsAndActions other) { && isDuplicate.equals(other.isDuplicate) && integration.equals(other.integration) && accountType.equals(other.accountType) - && completedAt.equals(other.completedAt); + && completedAt.equals(other.completedAt) + && integrationSpecificFields.equals(other.integrationSpecificFields); } @java.lang.Override @@ -194,7 +205,8 @@ public int hashCode() { this.isDuplicate, this.integration, this.accountType, - this.completedAt); + this.completedAt, + this.integrationSpecificFields); } @java.lang.Override @@ -268,6 +280,10 @@ public interface _FinalStage { _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); + + _FinalStage integrationSpecificFields(Optional> integrationSpecificFields); + + _FinalStage integrationSpecificFields(Map integrationSpecificFields); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -294,6 +310,8 @@ public static final class Builder private OffsetDateTime completedAt; + private Optional> integrationSpecificFields = Optional.empty(); + private Optional integration = Optional.empty(); private Optional isDuplicate = Optional.empty(); @@ -326,6 +344,7 @@ public Builder from(AccountDetailsAndActions other) { integration(other.getIntegration()); accountType(other.getAccountType()); completedAt(other.getCompletedAt()); + integrationSpecificFields(other.getIntegrationSpecificFields()); return this; } @@ -378,6 +397,19 @@ public _FinalStage completedAt(@NotNull OffsetDateTime completedAt) { return this; } + @java.lang.Override + public _FinalStage integrationSpecificFields(Map integrationSpecificFields) { + this.integrationSpecificFields = Optional.ofNullable(integrationSpecificFields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "integration_specific_fields", nulls = Nulls.SKIP) + public _FinalStage integrationSpecificFields(Optional> integrationSpecificFields) { + this.integrationSpecificFields = integrationSpecificFields; + return this; + } + @java.lang.Override public _FinalStage integration(AccountDetailsAndActionsIntegration integration) { this.integration = Optional.ofNullable(integration); @@ -486,6 +518,7 @@ public AccountDetailsAndActions build() { integration, accountType, completedAt, + integrationSpecificFields, additionalProperties); } } diff --git a/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java b/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java index 078bba608..df2523bd3 100644 --- a/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

            Number of results to return per page.

            + *

            Number of results to return per page. The maximum limit is 100.

            */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/ActionsEnum.java b/src/main/java/com/merge/api/ticketing/types/ActionsEnum.java new file mode 100644 index 000000000..f5b360e51 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ActionsEnum.java @@ -0,0 +1,102 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ActionsEnum { + public static final ActionsEnum DELETE = new ActionsEnum(Value.DELETE, "DELETE"); + + public static final ActionsEnum VIEW = new ActionsEnum(Value.VIEW, "VIEW"); + + public static final ActionsEnum CREATE = new ActionsEnum(Value.CREATE, "CREATE"); + + public static final ActionsEnum EDIT = new ActionsEnum(Value.EDIT, "EDIT"); + + private final Value value; + + private final String string; + + ActionsEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof ActionsEnum && this.string.equals(((ActionsEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DELETE: + return visitor.visitDelete(); + case VIEW: + return visitor.visitView(); + case CREATE: + return visitor.visitCreate(); + case EDIT: + return visitor.visitEdit(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActionsEnum valueOf(String value) { + switch (value) { + case "DELETE": + return DELETE; + case "VIEW": + return VIEW; + case "CREATE": + return CREATE; + case "EDIT": + return EDIT; + default: + return new ActionsEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + VIEW, + + CREATE, + + EDIT, + + DELETE, + + UNKNOWN + } + + public interface Visitor { + T visitView(); + + T visitCreate(); + + T visitEdit(); + + T visitDelete(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java b/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java index 1a7b4358b..ec7f5c125 100644 --- a/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java @@ -91,6 +91,7 @@ public Optional getUserEmail() { *
          • API - API
          • *
          • SYSTEM - SYSTEM
          • *
          • MERGE_TEAM - MERGE_TEAM
          • + *
          • SUPPORT - SUPPORT
          • *
          */ @JsonProperty("role") @@ -220,6 +221,7 @@ public interface RoleStage { *
        • API - API
        • *
        • SYSTEM - SYSTEM
        • *
        • MERGE_TEAM - MERGE_TEAM
        • + *
        • SUPPORT - SUPPORT
        • *
        */ IpAddressStage role(@NotNull AuditLogEventRole role); @@ -359,6 +361,7 @@ public Builder from(AuditLogEvent other) { *
      • API - API
      • *
      • SYSTEM - SYSTEM
      • *
      • MERGE_TEAM - MERGE_TEAM
      • + *
      • SUPPORT - SUPPORT
      • *
      *

      Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring.

      *
        @@ -368,6 +371,7 @@ public Builder from(AuditLogEvent other) { *
      • API - API
      • *
      • SYSTEM - SYSTEM
      • *
      • MERGE_TEAM - MERGE_TEAM
      • + *
      • SUPPORT - SUPPORT
      • *
      * @return Reference to {@code this} so that method calls can be chained together. */ diff --git a/src/main/java/com/merge/api/ticketing/types/AuditTrailListRequest.java b/src/main/java/com/merge/api/ticketing/types/AuditTrailListRequest.java index 3ac99adf4..f8d265206 100644 --- a/src/main/java/com/merge/api/ticketing/types/AuditTrailListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/AuditTrailListRequest.java @@ -76,7 +76,7 @@ public Optional getEventType() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -205,7 +205,7 @@ public Builder eventType(String eventType) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/Collection.java b/src/main/java/com/merge/api/ticketing/types/Collection.java index 5b8927596..c07d5de56 100644 --- a/src/main/java/com/merge/api/ticketing/types/Collection.java +++ b/src/main/java/com/merge/api/ticketing/types/Collection.java @@ -41,6 +41,8 @@ public final class Collection { private final Optional parentCollection; + private final Optional> permissions; + private final Optional collectionUrl; private final Optional remoteCreatedAt; @@ -65,6 +67,7 @@ private Collection( Optional accessLevel, Optional collectionType, Optional parentCollection, + Optional> permissions, Optional collectionUrl, Optional remoteCreatedAt, Optional remoteUpdatedAt, @@ -81,6 +84,7 @@ private Collection( this.accessLevel = accessLevel; this.collectionType = collectionType; this.parentCollection = parentCollection; + this.permissions = permissions; this.collectionUrl = collectionUrl; this.remoteCreatedAt = remoteCreatedAt; this.remoteUpdatedAt = remoteUpdatedAt; @@ -169,6 +173,11 @@ public Optional getParentCollection() { return parentCollection; } + @JsonProperty("permissions") + public Optional> getPermissions() { + return permissions; + } + /** * @return The 3rd party url of the Collection. */ @@ -232,6 +241,7 @@ private boolean equalTo(Collection other) { && accessLevel.equals(other.accessLevel) && collectionType.equals(other.collectionType) && parentCollection.equals(other.parentCollection) + && permissions.equals(other.permissions) && collectionUrl.equals(other.collectionUrl) && remoteCreatedAt.equals(other.remoteCreatedAt) && remoteUpdatedAt.equals(other.remoteUpdatedAt) @@ -252,6 +262,7 @@ public int hashCode() { this.accessLevel, this.collectionType, this.parentCollection, + this.permissions, this.collectionUrl, this.remoteCreatedAt, this.remoteUpdatedAt, @@ -289,6 +300,8 @@ public static final class Builder { private Optional parentCollection = Optional.empty(); + private Optional> permissions = Optional.empty(); + private Optional collectionUrl = Optional.empty(); private Optional remoteCreatedAt = Optional.empty(); @@ -316,6 +329,7 @@ public Builder from(Collection other) { accessLevel(other.getAccessLevel()); collectionType(other.getCollectionType()); parentCollection(other.getParentCollection()); + permissions(other.getPermissions()); collectionUrl(other.getCollectionUrl()); remoteCreatedAt(other.getRemoteCreatedAt()); remoteUpdatedAt(other.getRemoteUpdatedAt()); @@ -458,6 +472,17 @@ public Builder parentCollection(CollectionParentCollection parentCollection) { return this; } + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional> permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(List permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + /** *

      The 3rd party url of the Collection.

      */ @@ -547,6 +572,7 @@ public Collection build() { accessLevel, collectionType, parentCollection, + permissions, collectionUrl, remoteCreatedAt, remoteUpdatedAt, diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionPermissionsItem.java b/src/main/java/com/merge/api/ticketing/types/CollectionPermissionsItem.java new file mode 100644 index 000000000..d245ccc11 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionPermissionsItem.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = CollectionPermissionsItem.Deserializer.class) +public final class CollectionPermissionsItem { + private final Object value; + + private final int type; + + private CollectionPermissionsItem(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((String) this.value); + } else if (this.type == 1) { + return visitor.visit((Permission) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CollectionPermissionsItem && equalTo((CollectionPermissionsItem) other); + } + + private boolean equalTo(CollectionPermissionsItem other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static CollectionPermissionsItem of(String value) { + return new CollectionPermissionsItem(value, 0); + } + + public static CollectionPermissionsItem of(Permission value) { + return new CollectionPermissionsItem(value, 1); + } + + public interface Visitor { + T visit(String value); + + T visit(Permission value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(CollectionPermissionsItem.class); + } + + @java.lang.Override + public CollectionPermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, Permission.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsListRequest.java b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequest.java index e30093352..b0da2fe4f 100644 --- a/src/main/java/com/merge/api/ticketing/types/CollectionsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequest.java @@ -23,7 +23,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CollectionsListRequest.Builder.class) public final class CollectionsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional collectionType; @@ -58,7 +58,7 @@ public final class CollectionsListRequest { private final Map additionalProperties; private CollectionsListRequest( - Optional> expand, + Optional> expand, Optional collectionType, Optional createdAfter, Optional createdBefore, @@ -98,7 +98,7 @@ private CollectionsListRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional> getExpand() { + public Optional> getExpand() { return expand; } @@ -183,7 +183,7 @@ public Optional getName() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -284,7 +284,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional> expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional collectionType = Optional.empty(); @@ -345,17 +345,17 @@ public Builder from(CollectionsListRequest other) { *

      Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

      */ @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional> expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(List expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } - public Builder expand(String expand) { + public Builder expand(CollectionsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -501,7 +501,7 @@ public Builder name(String name) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestExpandItem.java new file mode 100644 index 000000000..490b500fa --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestExpandItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CollectionsListRequestExpandItem { + public static final CollectionsListRequestExpandItem PERMISSIONS = + new CollectionsListRequestExpandItem(Value.PERMISSIONS, "permissions"); + + public static final CollectionsListRequestExpandItem PARENT_COLLECTION = + new CollectionsListRequestExpandItem(Value.PARENT_COLLECTION, "parent_collection"); + + private final Value value; + + private final String string; + + CollectionsListRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CollectionsListRequestExpandItem + && this.string.equals(((CollectionsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PERMISSIONS: + return visitor.visitPermissions(); + case PARENT_COLLECTION: + return visitor.visitParentCollection(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CollectionsListRequestExpandItem valueOf(String value) { + switch (value) { + case "permissions": + return PERMISSIONS; + case "parent_collection": + return PARENT_COLLECTION; + default: + return new CollectionsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_COLLECTION, + + PERMISSIONS, + + UNKNOWN + } + + public interface Visitor { + T visitParentCollection(); + + T visitPermissions(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java index 1e9f19d7e..7d51035d3 100644 --- a/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CollectionsRetrieveRequest.Builder.class) public final class CollectionsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -35,7 +35,7 @@ public final class CollectionsRetrieveRequest { private final Map additionalProperties; private CollectionsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Optional remoteFields, @@ -53,7 +53,7 @@ private CollectionsRetrieveRequest( * @return Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. */ @JsonProperty("expand") - public Optional> getExpand() { + public Optional> getExpand() { return expand; } @@ -125,7 +125,7 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional> expand = Optional.empty(); + private Optional> expand = Optional.empty(); private Optional includeRemoteData = Optional.empty(); @@ -153,17 +153,17 @@ public Builder from(CollectionsRetrieveRequest other) { *

      Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.

      */ @JsonSetter(value = "expand", nulls = Nulls.SKIP) - public Builder expand(Optional> expand) { + public Builder expand(Optional> expand) { this.expand = expand; return this; } - public Builder expand(List expand) { + public Builder expand(List expand) { this.expand = Optional.ofNullable(expand); return this; } - public Builder expand(String expand) { + public Builder expand(CollectionsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..29f892e82 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestExpandItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CollectionsRetrieveRequestExpandItem { + public static final CollectionsRetrieveRequestExpandItem PERMISSIONS = + new CollectionsRetrieveRequestExpandItem(Value.PERMISSIONS, "permissions"); + + public static final CollectionsRetrieveRequestExpandItem PARENT_COLLECTION = + new CollectionsRetrieveRequestExpandItem(Value.PARENT_COLLECTION, "parent_collection"); + + private final Value value; + + private final String string; + + CollectionsRetrieveRequestExpandItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CollectionsRetrieveRequestExpandItem + && this.string.equals(((CollectionsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PERMISSIONS: + return visitor.visitPermissions(); + case PARENT_COLLECTION: + return visitor.visitParentCollection(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CollectionsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "permissions": + return PERMISSIONS; + case "parent_collection": + return PARENT_COLLECTION; + default: + return new CollectionsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_COLLECTION, + + PERMISSIONS, + + UNKNOWN + } + + public interface Visitor { + T visitParentCollection(); + + T visitPermissions(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequest.java b/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequest.java index 60d229a61..aa05ad787 100644 --- a/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsViewersListRequest.java @@ -94,7 +94,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -246,7 +246,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java b/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java index dedb9e72f..6776a8d8c 100644 --- a/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java @@ -155,7 +155,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -422,7 +422,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java b/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java index a4c75a1ed..9ae0b4b98 100644 --- a/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java @@ -159,7 +159,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -419,7 +419,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/CreateFieldMappingRequest.java b/src/main/java/com/merge/api/ticketing/types/CreateFieldMappingRequest.java index 6671b2bf2..4b6e85dc7 100644 --- a/src/main/java/com/merge/api/ticketing/types/CreateFieldMappingRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CreateFieldMappingRequest.java @@ -26,6 +26,8 @@ public final class CreateFieldMappingRequest { private final Optional excludeRemoteFieldMetadata; + private final Optional remoteDataIterationCount; + private final String targetFieldName; private final String targetFieldDescription; @@ -38,24 +40,30 @@ public final class CreateFieldMappingRequest { private final String commonModelName; + private final Optional jmesPath; + private final Map additionalProperties; private CreateFieldMappingRequest( Optional excludeRemoteFieldMetadata, + Optional remoteDataIterationCount, String targetFieldName, String targetFieldDescription, List remoteFieldTraversalPath, String remoteMethod, String remoteUrlPath, String commonModelName, + Optional jmesPath, Map additionalProperties) { this.excludeRemoteFieldMetadata = excludeRemoteFieldMetadata; + this.remoteDataIterationCount = remoteDataIterationCount; this.targetFieldName = targetFieldName; this.targetFieldDescription = targetFieldDescription; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; this.commonModelName = commonModelName; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -67,6 +75,14 @@ public Optional getExcludeRemoteFieldMetadata() { return excludeRemoteFieldMetadata; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The name of the target field you want this remote field to map to. */ @@ -115,6 +131,14 @@ public String getCommonModelName() { return commonModelName; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -128,24 +152,28 @@ public Map getAdditionalProperties() { private boolean equalTo(CreateFieldMappingRequest other) { return excludeRemoteFieldMetadata.equals(other.excludeRemoteFieldMetadata) + && remoteDataIterationCount.equals(other.remoteDataIterationCount) && targetFieldName.equals(other.targetFieldName) && targetFieldDescription.equals(other.targetFieldDescription) && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) && remoteUrlPath.equals(other.remoteUrlPath) - && commonModelName.equals(other.commonModelName); + && commonModelName.equals(other.commonModelName) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { return Objects.hash( this.excludeRemoteFieldMetadata, + this.remoteDataIterationCount, this.targetFieldName, this.targetFieldDescription, this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath, - this.commonModelName); + this.commonModelName, + this.jmesPath); } @java.lang.Override @@ -204,6 +232,13 @@ public interface _FinalStage { _FinalStage excludeRemoteFieldMetadata(Boolean excludeRemoteFieldMetadata); + /** + *

      Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

      + */ + _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount); + + _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount); + /** *

      The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

      */ @@ -212,6 +247,13 @@ public interface _FinalStage { _FinalStage addRemoteFieldTraversalPath(JsonNode remoteFieldTraversalPath); _FinalStage addAllRemoteFieldTraversalPath(List remoteFieldTraversalPath); + + /** + *

      JMES path to specify json query expression to be used on field mapping.

      + */ + _FinalStage jmesPath(Optional jmesPath); + + _FinalStage jmesPath(String jmesPath); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -232,8 +274,12 @@ public static final class Builder private String commonModelName; + private Optional jmesPath = Optional.empty(); + private List remoteFieldTraversalPath = new ArrayList<>(); + private Optional remoteDataIterationCount = Optional.empty(); + private Optional excludeRemoteFieldMetadata = Optional.empty(); @JsonAnySetter @@ -244,12 +290,14 @@ private Builder() {} @java.lang.Override public Builder from(CreateFieldMappingRequest other) { excludeRemoteFieldMetadata(other.getExcludeRemoteFieldMetadata()); + remoteDataIterationCount(other.getRemoteDataIterationCount()); targetFieldName(other.getTargetFieldName()); targetFieldDescription(other.getTargetFieldDescription()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); commonModelName(other.getCommonModelName()); + jmesPath(other.getJmesPath()); return this; } @@ -313,6 +361,26 @@ public _FinalStage commonModelName(@NotNull String commonModelName) { return this; } + /** + *

      JMES path to specify json query expression to be used on field mapping.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + + /** + *

      JMES path to specify json query expression to be used on field mapping.

      + */ + @java.lang.Override + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public _FinalStage jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + /** *

      The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -348,6 +416,26 @@ public _FinalStage remoteFieldTraversalPath(List remoteFieldTraversalP return this; } + /** + *

      Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); + return this; + } + + /** + *

      Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

      + */ + @java.lang.Override + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public _FinalStage remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + /** *

      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.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -372,12 +460,14 @@ public _FinalStage excludeRemoteFieldMetadata(Optional excludeRemoteFie public CreateFieldMappingRequest build() { return new CreateFieldMappingRequest( excludeRemoteFieldMetadata, + remoteDataIterationCount, targetFieldName, targetFieldDescription, remoteFieldTraversalPath, remoteMethod, remoteUrlPath, commonModelName, + jmesPath, additionalProperties); } } diff --git a/src/main/java/com/merge/api/ticketing/types/EffectEnum.java b/src/main/java/com/merge/api/ticketing/types/EffectEnum.java new file mode 100644 index 000000000..411df539c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/EffectEnum.java @@ -0,0 +1,92 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class EffectEnum { + public static final EffectEnum DENIED = new EffectEnum(Value.DENIED, "DENIED"); + + public static final EffectEnum INHERITED = new EffectEnum(Value.INHERITED, "INHERITED"); + + public static final EffectEnum ALLOWED = new EffectEnum(Value.ALLOWED, "ALLOWED"); + + private final Value value; + + private final String string; + + EffectEnum(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) || (other instanceof EffectEnum && this.string.equals(((EffectEnum) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DENIED: + return visitor.visitDenied(); + case INHERITED: + return visitor.visitInherited(); + case ALLOWED: + return visitor.visitAllowed(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EffectEnum valueOf(String value) { + switch (value) { + case "DENIED": + return DENIED; + case "INHERITED": + return INHERITED; + case "ALLOWED": + return ALLOWED; + default: + return new EffectEnum(Value.UNKNOWN, value); + } + } + + public enum Value { + ALLOWED, + + DENIED, + + INHERITED, + + UNKNOWN + } + + public interface Visitor { + T visitAllowed(); + + T visitDenied(); + + T visitInherited(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java index 825fd55bc..92ca70d7c 100644 --- a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java @@ -28,6 +28,8 @@ public final class FieldMappingApiInstance { private final Optional remoteField; + private final Optional jmesPath; + private final Map additionalProperties; private FieldMappingApiInstance( @@ -35,11 +37,13 @@ private FieldMappingApiInstance( Optional isIntegrationWide, Optional targetField, Optional remoteField, + Optional jmesPath, Map additionalProperties) { this.id = id; this.isIntegrationWide = isIntegrationWide; this.targetField = targetField; this.remoteField = remoteField; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } @@ -63,6 +67,11 @@ public Optional getRemoteField() { return remoteField; } + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -78,12 +87,13 @@ private boolean equalTo(FieldMappingApiInstance other) { return id.equals(other.id) && isIntegrationWide.equals(other.isIntegrationWide) && targetField.equals(other.targetField) - && remoteField.equals(other.remoteField); + && remoteField.equals(other.remoteField) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField); + return Objects.hash(this.id, this.isIntegrationWide, this.targetField, this.remoteField, this.jmesPath); } @java.lang.Override @@ -105,6 +115,8 @@ public static final class Builder { private Optional remoteField = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -115,6 +127,7 @@ public Builder from(FieldMappingApiInstance other) { isIntegrationWide(other.getIsIntegrationWide()); targetField(other.getTargetField()); remoteField(other.getRemoteField()); + jmesPath(other.getJmesPath()); return this; } @@ -162,8 +175,20 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public FieldMappingApiInstance build() { - return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); + return new FieldMappingApiInstance( + id, isIntegrationWide, targetField, remoteField, jmesPath, additionalProperties); } } } diff --git a/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java b/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java index c5996aa92..d7f85cc8b 100644 --- a/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java @@ -164,7 +164,7 @@ public Optional getLinkedAccountId() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -446,7 +446,7 @@ public Builder linkedAccountId(String linkedAccountId) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java b/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java index 7cc39fd60..5e5e65a45 100644 --- a/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java @@ -174,7 +174,7 @@ public Optional getIsTestAccount() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -454,7 +454,7 @@ public Builder isTestAccount(String isTestAccount) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/PatchedEditFieldMappingRequest.java b/src/main/java/com/merge/api/ticketing/types/PatchedEditFieldMappingRequest.java index 4635407b8..b0e30c779 100644 --- a/src/main/java/com/merge/api/ticketing/types/PatchedEditFieldMappingRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/PatchedEditFieldMappingRequest.java @@ -22,25 +22,41 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PatchedEditFieldMappingRequest.Builder.class) public final class PatchedEditFieldMappingRequest { + private final Optional remoteDataIterationCount; + private final Optional> remoteFieldTraversalPath; private final Optional remoteMethod; private final Optional remoteUrlPath; + private final Optional jmesPath; + private final Map additionalProperties; private PatchedEditFieldMappingRequest( + Optional remoteDataIterationCount, Optional> remoteFieldTraversalPath, Optional remoteMethod, Optional remoteUrlPath, + Optional jmesPath, Map additionalProperties) { + this.remoteDataIterationCount = remoteDataIterationCount; this.remoteFieldTraversalPath = remoteFieldTraversalPath; this.remoteMethod = remoteMethod; this.remoteUrlPath = remoteUrlPath; + this.jmesPath = jmesPath; this.additionalProperties = additionalProperties; } + /** + * @return Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided. + */ + @JsonProperty("remote_data_iteration_count") + public Optional getRemoteDataIterationCount() { + return remoteDataIterationCount; + } + /** * @return The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. */ @@ -65,6 +81,14 @@ public Optional getRemoteUrlPath() { return remoteUrlPath; } + /** + * @return JMES path to specify json query expression to be used on field mapping. + */ + @JsonProperty("jmes_path") + public Optional getJmesPath() { + return jmesPath; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -77,14 +101,21 @@ public Map getAdditionalProperties() { } private boolean equalTo(PatchedEditFieldMappingRequest other) { - return remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) + return remoteDataIterationCount.equals(other.remoteDataIterationCount) + && remoteFieldTraversalPath.equals(other.remoteFieldTraversalPath) && remoteMethod.equals(other.remoteMethod) - && remoteUrlPath.equals(other.remoteUrlPath); + && remoteUrlPath.equals(other.remoteUrlPath) + && jmesPath.equals(other.jmesPath); } @java.lang.Override public int hashCode() { - return Objects.hash(this.remoteFieldTraversalPath, this.remoteMethod, this.remoteUrlPath); + return Objects.hash( + this.remoteDataIterationCount, + this.remoteFieldTraversalPath, + this.remoteMethod, + this.remoteUrlPath, + this.jmesPath); } @java.lang.Override @@ -98,21 +129,41 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { + private Optional remoteDataIterationCount = Optional.empty(); + private Optional> remoteFieldTraversalPath = Optional.empty(); private Optional remoteMethod = Optional.empty(); private Optional remoteUrlPath = Optional.empty(); + private Optional jmesPath = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} public Builder from(PatchedEditFieldMappingRequest other) { + remoteDataIterationCount(other.getRemoteDataIterationCount()); remoteFieldTraversalPath(other.getRemoteFieldTraversalPath()); remoteMethod(other.getRemoteMethod()); remoteUrlPath(other.getRemoteUrlPath()); + jmesPath(other.getJmesPath()); + return this; + } + + /** + *

      Number of common model instances to iterate through when fetching remote data for field mappings. Defaults to 250 if not provided.

      + */ + @JsonSetter(value = "remote_data_iteration_count", nulls = Nulls.SKIP) + public Builder remoteDataIterationCount(Optional remoteDataIterationCount) { + this.remoteDataIterationCount = remoteDataIterationCount; + return this; + } + + public Builder remoteDataIterationCount(Integer remoteDataIterationCount) { + this.remoteDataIterationCount = Optional.ofNullable(remoteDataIterationCount); return this; } @@ -158,9 +209,28 @@ public Builder remoteUrlPath(String remoteUrlPath) { return this; } + /** + *

      JMES path to specify json query expression to be used on field mapping.

      + */ + @JsonSetter(value = "jmes_path", nulls = Nulls.SKIP) + public Builder jmesPath(Optional jmesPath) { + this.jmesPath = jmesPath; + return this; + } + + public Builder jmesPath(String jmesPath) { + this.jmesPath = Optional.ofNullable(jmesPath); + return this; + } + public PatchedEditFieldMappingRequest build() { return new PatchedEditFieldMappingRequest( - remoteFieldTraversalPath, remoteMethod, remoteUrlPath, additionalProperties); + remoteDataIterationCount, + remoteFieldTraversalPath, + remoteMethod, + remoteUrlPath, + jmesPath, + additionalProperties); } } } diff --git a/src/main/java/com/merge/api/ticketing/types/Permission.java b/src/main/java/com/merge/api/ticketing/types/Permission.java new file mode 100644 index 000000000..c6e6e439f --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/Permission.java @@ -0,0 +1,435 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = Permission.Builder.class) +public final class Permission { + private final Optional id; + + private final Optional remoteId; + + private final Optional createdAt; + + private final Optional modifiedAt; + + private final Optional effect; + + private final Optional>> actions; + + private final Optional>> appliedToUsers; + + private final Optional>> appliedToRoles; + + private final Optional>> appliedToTeams; + + private final Optional>> appliedToCollections; + + private final Optional remoteWasDeleted; + + private final Optional> fieldMappings; + + private final Map additionalProperties; + + private Permission( + Optional id, + Optional remoteId, + Optional createdAt, + Optional modifiedAt, + Optional effect, + Optional>> actions, + Optional>> appliedToUsers, + Optional>> appliedToRoles, + Optional>> appliedToTeams, + Optional>> appliedToCollections, + Optional remoteWasDeleted, + Optional> fieldMappings, + Map additionalProperties) { + this.id = id; + this.remoteId = remoteId; + this.createdAt = createdAt; + this.modifiedAt = modifiedAt; + this.effect = effect; + this.actions = actions; + this.appliedToUsers = appliedToUsers; + this.appliedToRoles = appliedToRoles; + this.appliedToTeams = appliedToTeams; + this.appliedToCollections = appliedToCollections; + this.remoteWasDeleted = remoteWasDeleted; + this.fieldMappings = fieldMappings; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("id") + public Optional getId() { + return id; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return The datetime that this object was created by Merge. + */ + @JsonProperty("created_at") + public Optional getCreatedAt() { + return createdAt; + } + + /** + * @return The datetime that this object was modified by Merge. + */ + @JsonProperty("modified_at") + public Optional getModifiedAt() { + return modifiedAt; + } + + /** + * @return Outcome of this permission rule for matching users. + *
        + *
      • ALLOWED - ALLOWED
      • + *
      • DENIED - DENIED
      • + *
      • INHERITED - INHERITED
      • + *
      + */ + @JsonProperty("effect") + public Optional getEffect() { + return effect; + } + + /** + * @return Operations that this permission applies to. If the entity inherits permission from a parent entity, then this should be an empty array. In that case, the entity would inherit the parent entity’s actions. + */ + @JsonProperty("actions") + public Optional>> getActions() { + return actions; + } + + @JsonProperty("applied_to_users") + public Optional>> getAppliedToUsers() { + return appliedToUsers; + } + + @JsonProperty("applied_to_roles") + public Optional>> getAppliedToRoles() { + return appliedToRoles; + } + + @JsonProperty("applied_to_teams") + public Optional>> getAppliedToTeams() { + return appliedToTeams; + } + + @JsonProperty("applied_to_collections") + public Optional>> getAppliedToCollections() { + return appliedToCollections; + } + + /** + * @return 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. + */ + @JsonProperty("remote_was_deleted") + public Optional getRemoteWasDeleted() { + return remoteWasDeleted; + } + + @JsonProperty("field_mappings") + public Optional> getFieldMappings() { + return fieldMappings; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof Permission && equalTo((Permission) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(Permission other) { + return id.equals(other.id) + && remoteId.equals(other.remoteId) + && createdAt.equals(other.createdAt) + && modifiedAt.equals(other.modifiedAt) + && effect.equals(other.effect) + && actions.equals(other.actions) + && appliedToUsers.equals(other.appliedToUsers) + && appliedToRoles.equals(other.appliedToRoles) + && appliedToTeams.equals(other.appliedToTeams) + && appliedToCollections.equals(other.appliedToCollections) + && remoteWasDeleted.equals(other.remoteWasDeleted) + && fieldMappings.equals(other.fieldMappings); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.id, + this.remoteId, + this.createdAt, + this.modifiedAt, + this.effect, + this.actions, + this.appliedToUsers, + this.appliedToRoles, + this.appliedToTeams, + this.appliedToCollections, + this.remoteWasDeleted, + this.fieldMappings); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional id = Optional.empty(); + + private Optional remoteId = Optional.empty(); + + private Optional createdAt = Optional.empty(); + + private Optional modifiedAt = Optional.empty(); + + private Optional effect = Optional.empty(); + + private Optional>> actions = Optional.empty(); + + private Optional>> appliedToUsers = Optional.empty(); + + private Optional>> appliedToRoles = Optional.empty(); + + private Optional>> appliedToTeams = Optional.empty(); + + private Optional>> appliedToCollections = Optional.empty(); + + private Optional remoteWasDeleted = Optional.empty(); + + private Optional> fieldMappings = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(Permission other) { + id(other.getId()); + remoteId(other.getRemoteId()); + createdAt(other.getCreatedAt()); + modifiedAt(other.getModifiedAt()); + effect(other.getEffect()); + actions(other.getActions()); + appliedToUsers(other.getAppliedToUsers()); + appliedToRoles(other.getAppliedToRoles()); + appliedToTeams(other.getAppliedToTeams()); + appliedToCollections(other.getAppliedToCollections()); + remoteWasDeleted(other.getRemoteWasDeleted()); + fieldMappings(other.getFieldMappings()); + return this; + } + + @JsonSetter(value = "id", nulls = Nulls.SKIP) + public Builder id(Optional id) { + this.id = id; + return this; + } + + public Builder id(String id) { + this.id = Optional.ofNullable(id); + return this; + } + + /** + *

      The third-party API ID of the matching object.

      + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

      The datetime that this object was created by Merge.

      + */ + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) + public Builder createdAt(Optional createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = Optional.ofNullable(createdAt); + return this; + } + + /** + *

      The datetime that this object was modified by Merge.

      + */ + @JsonSetter(value = "modified_at", nulls = Nulls.SKIP) + public Builder modifiedAt(Optional modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + public Builder modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = Optional.ofNullable(modifiedAt); + return this; + } + + /** + *

      Outcome of this permission rule for matching users.

      + *
        + *
      • ALLOWED - ALLOWED
      • + *
      • DENIED - DENIED
      • + *
      • INHERITED - INHERITED
      • + *
      + */ + @JsonSetter(value = "effect", nulls = Nulls.SKIP) + public Builder effect(Optional effect) { + this.effect = effect; + return this; + } + + public Builder effect(PermissionEffect effect) { + this.effect = Optional.ofNullable(effect); + return this; + } + + /** + *

      Operations that this permission applies to. If the entity inherits permission from a parent entity, then this should be an empty array. In that case, the entity would inherit the parent entity’s actions.

      + */ + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public Builder actions(Optional>> actions) { + this.actions = actions; + return this; + } + + public Builder actions(List> actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + @JsonSetter(value = "applied_to_users", nulls = Nulls.SKIP) + public Builder appliedToUsers(Optional>> appliedToUsers) { + this.appliedToUsers = appliedToUsers; + return this; + } + + public Builder appliedToUsers(List> appliedToUsers) { + this.appliedToUsers = Optional.ofNullable(appliedToUsers); + return this; + } + + @JsonSetter(value = "applied_to_roles", nulls = Nulls.SKIP) + public Builder appliedToRoles(Optional>> appliedToRoles) { + this.appliedToRoles = appliedToRoles; + return this; + } + + public Builder appliedToRoles(List> appliedToRoles) { + this.appliedToRoles = Optional.ofNullable(appliedToRoles); + return this; + } + + @JsonSetter(value = "applied_to_teams", nulls = Nulls.SKIP) + public Builder appliedToTeams(Optional>> appliedToTeams) { + this.appliedToTeams = appliedToTeams; + return this; + } + + public Builder appliedToTeams(List> appliedToTeams) { + this.appliedToTeams = Optional.ofNullable(appliedToTeams); + return this; + } + + @JsonSetter(value = "applied_to_collections", nulls = Nulls.SKIP) + public Builder appliedToCollections(Optional>> appliedToCollections) { + this.appliedToCollections = appliedToCollections; + return this; + } + + public Builder appliedToCollections(List> appliedToCollections) { + this.appliedToCollections = Optional.ofNullable(appliedToCollections); + return this; + } + + /** + *

      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.

      + */ + @JsonSetter(value = "remote_was_deleted", nulls = Nulls.SKIP) + public Builder remoteWasDeleted(Optional remoteWasDeleted) { + this.remoteWasDeleted = remoteWasDeleted; + return this; + } + + public Builder remoteWasDeleted(Boolean remoteWasDeleted) { + this.remoteWasDeleted = Optional.ofNullable(remoteWasDeleted); + return this; + } + + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) + public Builder fieldMappings(Optional> fieldMappings) { + this.fieldMappings = fieldMappings; + return this; + } + + public Builder fieldMappings(Map fieldMappings) { + this.fieldMappings = Optional.ofNullable(fieldMappings); + return this; + } + + public Permission build() { + return new Permission( + id, + remoteId, + createdAt, + modifiedAt, + effect, + actions, + appliedToUsers, + appliedToRoles, + appliedToTeams, + appliedToCollections, + remoteWasDeleted, + fieldMappings, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PermissionEffect.java b/src/main/java/com/merge/api/ticketing/types/PermissionEffect.java new file mode 100644 index 000000000..9133d4f61 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PermissionEffect.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionEffect.Deserializer.class) +public final class PermissionEffect { + private final Object value; + + private final int type; + + private PermissionEffect(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EffectEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionEffect && equalTo((PermissionEffect) other); + } + + private boolean equalTo(PermissionEffect other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PermissionEffect of(EffectEnum value) { + return new PermissionEffect(value, 0); + } + + public static PermissionEffect of(String value) { + return new PermissionEffect(value, 1); + } + + public interface Visitor { + T visit(EffectEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionEffect.class); + } + + @java.lang.Override + public PermissionEffect deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EffectEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PermissionRequest.java b/src/main/java/com/merge/api/ticketing/types/PermissionRequest.java new file mode 100644 index 000000000..d808c996e --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PermissionRequest.java @@ -0,0 +1,338 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PermissionRequest.Builder.class) +public final class PermissionRequest { + private final Optional remoteId; + + private final Optional effect; + + private final Optional>> actions; + + private final Optional>> appliedToUsers; + + private final Optional>> appliedToRoles; + + private final Optional>> appliedToTeams; + + private final Optional>> appliedToCollections; + + private final Optional> integrationParams; + + private final Optional> linkedAccountParams; + + private final Map additionalProperties; + + private PermissionRequest( + Optional remoteId, + Optional effect, + Optional>> actions, + Optional>> appliedToUsers, + Optional>> appliedToRoles, + Optional>> appliedToTeams, + Optional>> appliedToCollections, + Optional> integrationParams, + Optional> linkedAccountParams, + Map additionalProperties) { + this.remoteId = remoteId; + this.effect = effect; + this.actions = actions; + this.appliedToUsers = appliedToUsers; + this.appliedToRoles = appliedToRoles; + this.appliedToTeams = appliedToTeams; + this.appliedToCollections = appliedToCollections; + this.integrationParams = integrationParams; + this.linkedAccountParams = linkedAccountParams; + this.additionalProperties = additionalProperties; + } + + /** + * @return The third-party API ID of the matching object. + */ + @JsonProperty("remote_id") + public Optional getRemoteId() { + return remoteId; + } + + /** + * @return Outcome of this permission rule for matching users. + *
        + *
      • ALLOWED - ALLOWED
      • + *
      • DENIED - DENIED
      • + *
      • INHERITED - INHERITED
      • + *
      + */ + @JsonProperty("effect") + public Optional getEffect() { + return effect; + } + + /** + * @return Operations that this permission applies to. If the entity inherits permission from a parent entity, then this should be an empty array. In that case, the entity would inherit the parent entity’s actions. + */ + @JsonProperty("actions") + public Optional>> getActions() { + return actions; + } + + @JsonProperty("applied_to_users") + public Optional>> getAppliedToUsers() { + return appliedToUsers; + } + + @JsonProperty("applied_to_roles") + public Optional>> getAppliedToRoles() { + return appliedToRoles; + } + + @JsonProperty("applied_to_teams") + public Optional>> getAppliedToTeams() { + return appliedToTeams; + } + + @JsonProperty("applied_to_collections") + public Optional>> getAppliedToCollections() { + return appliedToCollections; + } + + @JsonProperty("integration_params") + public Optional> getIntegrationParams() { + return integrationParams; + } + + @JsonProperty("linked_account_params") + public Optional> getLinkedAccountParams() { + return linkedAccountParams; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionRequest && equalTo((PermissionRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(PermissionRequest other) { + return remoteId.equals(other.remoteId) + && effect.equals(other.effect) + && actions.equals(other.actions) + && appliedToUsers.equals(other.appliedToUsers) + && appliedToRoles.equals(other.appliedToRoles) + && appliedToTeams.equals(other.appliedToTeams) + && appliedToCollections.equals(other.appliedToCollections) + && integrationParams.equals(other.integrationParams) + && linkedAccountParams.equals(other.linkedAccountParams); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.remoteId, + this.effect, + this.actions, + this.appliedToUsers, + this.appliedToRoles, + this.appliedToTeams, + this.appliedToCollections, + this.integrationParams, + this.linkedAccountParams); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional remoteId = Optional.empty(); + + private Optional effect = Optional.empty(); + + private Optional>> actions = Optional.empty(); + + private Optional>> appliedToUsers = Optional.empty(); + + private Optional>> appliedToRoles = Optional.empty(); + + private Optional>> appliedToTeams = Optional.empty(); + + private Optional>> appliedToCollections = Optional.empty(); + + private Optional> integrationParams = Optional.empty(); + + private Optional> linkedAccountParams = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PermissionRequest other) { + remoteId(other.getRemoteId()); + effect(other.getEffect()); + actions(other.getActions()); + appliedToUsers(other.getAppliedToUsers()); + appliedToRoles(other.getAppliedToRoles()); + appliedToTeams(other.getAppliedToTeams()); + appliedToCollections(other.getAppliedToCollections()); + integrationParams(other.getIntegrationParams()); + linkedAccountParams(other.getLinkedAccountParams()); + return this; + } + + /** + *

      The third-party API ID of the matching object.

      + */ + @JsonSetter(value = "remote_id", nulls = Nulls.SKIP) + public Builder remoteId(Optional remoteId) { + this.remoteId = remoteId; + return this; + } + + public Builder remoteId(String remoteId) { + this.remoteId = Optional.ofNullable(remoteId); + return this; + } + + /** + *

      Outcome of this permission rule for matching users.

      + *
        + *
      • ALLOWED - ALLOWED
      • + *
      • DENIED - DENIED
      • + *
      • INHERITED - INHERITED
      • + *
      + */ + @JsonSetter(value = "effect", nulls = Nulls.SKIP) + public Builder effect(Optional effect) { + this.effect = effect; + return this; + } + + public Builder effect(PermissionRequestEffect effect) { + this.effect = Optional.ofNullable(effect); + return this; + } + + /** + *

      Operations that this permission applies to. If the entity inherits permission from a parent entity, then this should be an empty array. In that case, the entity would inherit the parent entity’s actions.

      + */ + @JsonSetter(value = "actions", nulls = Nulls.SKIP) + public Builder actions(Optional>> actions) { + this.actions = actions; + return this; + } + + public Builder actions(List> actions) { + this.actions = Optional.ofNullable(actions); + return this; + } + + @JsonSetter(value = "applied_to_users", nulls = Nulls.SKIP) + public Builder appliedToUsers(Optional>> appliedToUsers) { + this.appliedToUsers = appliedToUsers; + return this; + } + + public Builder appliedToUsers(List> appliedToUsers) { + this.appliedToUsers = Optional.ofNullable(appliedToUsers); + return this; + } + + @JsonSetter(value = "applied_to_roles", nulls = Nulls.SKIP) + public Builder appliedToRoles(Optional>> appliedToRoles) { + this.appliedToRoles = appliedToRoles; + return this; + } + + public Builder appliedToRoles(List> appliedToRoles) { + this.appliedToRoles = Optional.ofNullable(appliedToRoles); + return this; + } + + @JsonSetter(value = "applied_to_teams", nulls = Nulls.SKIP) + public Builder appliedToTeams(Optional>> appliedToTeams) { + this.appliedToTeams = appliedToTeams; + return this; + } + + public Builder appliedToTeams(List> appliedToTeams) { + this.appliedToTeams = Optional.ofNullable(appliedToTeams); + return this; + } + + @JsonSetter(value = "applied_to_collections", nulls = Nulls.SKIP) + public Builder appliedToCollections(Optional>> appliedToCollections) { + this.appliedToCollections = appliedToCollections; + return this; + } + + public Builder appliedToCollections(List> appliedToCollections) { + this.appliedToCollections = Optional.ofNullable(appliedToCollections); + return this; + } + + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) + public Builder integrationParams(Optional> integrationParams) { + this.integrationParams = integrationParams; + return this; + } + + public Builder integrationParams(Map integrationParams) { + this.integrationParams = Optional.ofNullable(integrationParams); + return this; + } + + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) + public Builder linkedAccountParams(Optional> linkedAccountParams) { + this.linkedAccountParams = linkedAccountParams; + return this; + } + + public Builder linkedAccountParams(Map linkedAccountParams) { + this.linkedAccountParams = Optional.ofNullable(linkedAccountParams); + return this; + } + + public PermissionRequest build() { + return new PermissionRequest( + remoteId, + effect, + actions, + appliedToUsers, + appliedToRoles, + appliedToTeams, + appliedToCollections, + integrationParams, + linkedAccountParams, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/PermissionRequestEffect.java b/src/main/java/com/merge/api/ticketing/types/PermissionRequestEffect.java new file mode 100644 index 000000000..fbb5e779a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/PermissionRequestEffect.java @@ -0,0 +1,95 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.merge.api.core.ObjectMappers; +import java.io.IOException; +import java.util.Objects; + +@JsonDeserialize(using = PermissionRequestEffect.Deserializer.class) +public final class PermissionRequestEffect { + private final Object value; + + private final int type; + + private PermissionRequestEffect(Object value, int type) { + this.value = value; + this.type = type; + } + + @JsonValue + public Object get() { + return this.value; + } + + @SuppressWarnings("unchecked") + public T visit(Visitor visitor) { + if (this.type == 0) { + return visitor.visit((EffectEnum) this.value); + } else if (this.type == 1) { + return visitor.visit((String) this.value); + } + throw new IllegalStateException("Failed to visit value. This should never happen."); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PermissionRequestEffect && equalTo((PermissionRequestEffect) other); + } + + private boolean equalTo(PermissionRequestEffect other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return this.value.toString(); + } + + public static PermissionRequestEffect of(EffectEnum value) { + return new PermissionRequestEffect(value, 0); + } + + public static PermissionRequestEffect of(String value) { + return new PermissionRequestEffect(value, 1); + } + + public interface Visitor { + T visit(EffectEnum value); + + T visit(String value); + } + + static final class Deserializer extends StdDeserializer { + Deserializer() { + super(PermissionRequestEffect.class); + } + + @java.lang.Override + public PermissionRequestEffect deserialize(JsonParser p, DeserializationContext context) throws IOException { + Object value = p.readValueAs(Object.class); + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, EffectEnum.class)); + } catch (RuntimeException e) { + } + try { + return of(ObjectMappers.JSON_MAPPER.convertValue(value, String.class)); + } catch (RuntimeException e) { + } + throw new JsonParseException(p, "Failed to deserialize"); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequest.java b/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequest.java index bcd2cf096..c14bccb81 100644 --- a/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ProjectsUsersListRequest.java @@ -94,7 +94,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -246,7 +246,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/RegenerateAccountToken.java b/src/main/java/com/merge/api/ticketing/types/RegenerateAccountToken.java new file mode 100644 index 000000000..e29f8997a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/RegenerateAccountToken.java @@ -0,0 +1,125 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = RegenerateAccountToken.Builder.class) +public final class RegenerateAccountToken { + private final String linkedAccountId; + + private final String accountToken; + + private final Map additionalProperties; + + private RegenerateAccountToken( + String linkedAccountId, String accountToken, Map additionalProperties) { + this.linkedAccountId = linkedAccountId; + this.accountToken = accountToken; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("linked_account_id") + public String getLinkedAccountId() { + return linkedAccountId; + } + + @JsonProperty("account_token") + public String getAccountToken() { + return accountToken; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RegenerateAccountToken && equalTo((RegenerateAccountToken) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(RegenerateAccountToken other) { + return linkedAccountId.equals(other.linkedAccountId) && accountToken.equals(other.accountToken); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.linkedAccountId, this.accountToken); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static LinkedAccountIdStage builder() { + return new Builder(); + } + + public interface LinkedAccountIdStage { + AccountTokenStage linkedAccountId(@NotNull String linkedAccountId); + + Builder from(RegenerateAccountToken other); + } + + public interface AccountTokenStage { + _FinalStage accountToken(@NotNull String accountToken); + } + + public interface _FinalStage { + RegenerateAccountToken build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements LinkedAccountIdStage, AccountTokenStage, _FinalStage { + private String linkedAccountId; + + private String accountToken; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(RegenerateAccountToken other) { + linkedAccountId(other.getLinkedAccountId()); + accountToken(other.getAccountToken()); + return this; + } + + @java.lang.Override + @JsonSetter("linked_account_id") + public AccountTokenStage linkedAccountId(@NotNull String linkedAccountId) { + this.linkedAccountId = linkedAccountId; + return this; + } + + @java.lang.Override + @JsonSetter("account_token") + public _FinalStage accountToken(@NotNull String accountToken) { + this.accountToken = accountToken; + return this; + } + + @java.lang.Override + public RegenerateAccountToken build() { + return new RegenerateAccountToken(linkedAccountId, accountToken, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteData.java b/src/main/java/com/merge/api/ticketing/types/RemoteData.java index 5534766b0..a5d811d2d 100644 --- a/src/main/java/com/merge/api/ticketing/types/RemoteData.java +++ b/src/main/java/com/merge/api/ticketing/types/RemoteData.java @@ -42,6 +42,9 @@ public String getPath() { return path; } + /** + * @return The data returned from the third-party for this object in its original, unnormalized format. + */ @JsonProperty("data") public Optional getData() { return data; @@ -88,6 +91,9 @@ public interface PathStage { public interface _FinalStage { RemoteData build(); + /** + *

      The data returned from the third-party for this object in its original, unnormalized format.

      + */ _FinalStage data(Optional data); _FinalStage data(JsonNode data); @@ -123,12 +129,19 @@ public _FinalStage path(@NotNull String path) { return this; } + /** + *

      The data returned from the third-party for this object in its original, unnormalized format.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ @java.lang.Override public _FinalStage data(JsonNode data) { this.data = Optional.ofNullable(data); return this; } + /** + *

      The data returned from the third-party for this object in its original, unnormalized format.

      + */ @java.lang.Override @JsonSetter(value = "data", nulls = Nulls.SKIP) public _FinalStage data(Optional data) { diff --git a/src/main/java/com/merge/api/ticketing/types/RoleEnum.java b/src/main/java/com/merge/api/ticketing/types/RoleEnum.java index bef8c3d30..9b3a3e806 100644 --- a/src/main/java/com/merge/api/ticketing/types/RoleEnum.java +++ b/src/main/java/com/merge/api/ticketing/types/RoleEnum.java @@ -17,6 +17,8 @@ public final class RoleEnum { public static final RoleEnum SYSTEM = new RoleEnum(Value.SYSTEM, "SYSTEM"); + public static final RoleEnum SUPPORT = new RoleEnum(Value.SUPPORT, "SUPPORT"); + public static final RoleEnum ADMIN = new RoleEnum(Value.ADMIN, "ADMIN"); private final Value value; @@ -60,6 +62,8 @@ public T visit(Visitor visitor) { return visitor.visitMember(); case SYSTEM: return visitor.visitSystem(); + case SUPPORT: + return visitor.visitSupport(); case ADMIN: return visitor.visitAdmin(); case UNKNOWN: @@ -81,6 +85,8 @@ public static RoleEnum valueOf(String value) { return MEMBER; case "SYSTEM": return SYSTEM; + case "SUPPORT": + return SUPPORT; case "ADMIN": return ADMIN; default: @@ -101,6 +107,8 @@ public enum Value { MERGE_TEAM, + SUPPORT, + UNKNOWN } @@ -117,6 +125,8 @@ public interface Visitor { T visitMergeTeam(); + T visitSupport(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java b/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java index 0ae125024..94d216e1f 100644 --- a/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/SyncStatusListRequest.java b/src/main/java/com/merge/api/ticketing/types/SyncStatusListRequest.java index 6d058222e..819376ab6 100644 --- a/src/main/java/com/merge/api/ticketing/types/SyncStatusListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/SyncStatusListRequest.java @@ -42,7 +42,7 @@ public Optional getCursor() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -110,7 +110,7 @@ public Builder cursor(String cursor) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java b/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java index 1a40d1e87..085105911 100644 --- a/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java b/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java index 151cc4fa2..74443a7e8 100644 --- a/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java @@ -133,7 +133,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -350,7 +350,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/Ticket.java b/src/main/java/com/merge/api/ticketing/types/Ticket.java index 3a1cb6e45..235dab01f 100644 --- a/src/main/java/com/merge/api/ticketing/types/Ticket.java +++ b/src/main/java/com/merge/api/ticketing/types/Ticket.java @@ -59,6 +59,8 @@ public final class Ticket { private final Optional accessLevel; + private final Optional> permissions; + private final Optional>> tags; private final Optional>> roles; @@ -102,6 +104,7 @@ private Ticket( Optional parentTicket, Optional>> attachments, Optional accessLevel, + Optional> permissions, Optional>> tags, Optional>> roles, Optional ticketUrl, @@ -132,6 +135,7 @@ private Ticket( this.parentTicket = parentTicket; this.attachments = attachments; this.accessLevel = accessLevel; + this.permissions = permissions; this.tags = tags; this.roles = roles; this.ticketUrl = ticketUrl; @@ -296,6 +300,11 @@ public Optional getAccessLevel() { return accessLevel; } + @JsonProperty("permissions") + public Optional> getPermissions() { + return permissions; + } + @JsonProperty("tags") public Optional>> getTags() { return tags; @@ -405,6 +414,7 @@ private boolean equalTo(Ticket other) { && parentTicket.equals(other.parentTicket) && attachments.equals(other.attachments) && accessLevel.equals(other.accessLevel) + && permissions.equals(other.permissions) && tags.equals(other.tags) && roles.equals(other.roles) && ticketUrl.equals(other.ticketUrl) @@ -439,6 +449,7 @@ public int hashCode() { this.parentTicket, this.attachments, this.accessLevel, + this.permissions, this.tags, this.roles, this.ticketUrl, @@ -499,6 +510,8 @@ public static final class Builder { private Optional accessLevel = Optional.empty(); + private Optional> permissions = Optional.empty(); + private Optional>> tags = Optional.empty(); private Optional>> roles = Optional.empty(); @@ -545,6 +558,7 @@ public Builder from(Ticket other) { parentTicket(other.getParentTicket()); attachments(other.getAttachments()); accessLevel(other.getAccessLevel()); + permissions(other.getPermissions()); tags(other.getTags()); roles(other.getRoles()); ticketUrl(other.getTicketUrl()); @@ -817,6 +831,17 @@ public Builder accessLevel(TicketAccessLevel accessLevel) { return this; } + @JsonSetter(value = "permissions", nulls = Nulls.SKIP) + public Builder permissions(Optional> permissions) { + this.permissions = permissions; + return this; + } + + public Builder permissions(List permissions) { + this.permissions = Optional.ofNullable(permissions); + return this; + } + @JsonSetter(value = "tags", nulls = Nulls.SKIP) public Builder tags(Optional>> tags) { this.tags = tags; @@ -982,6 +1007,7 @@ public Ticket build() { parentTicket, attachments, accessLevel, + permissions, tags, roles, ticketUrl, diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsListRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsListRequest.java index ba2a5d10b..f2b8b767b 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsListRequest.java @@ -79,6 +79,8 @@ public final class TicketsListRequest { private final Optional remoteId; + private final Optional remoteIds; + private final Optional remoteUpdatedAfter; private final Optional remoteUpdatedBefore; @@ -124,6 +126,7 @@ private TicketsListRequest( Optional remoteCreatedBefore, Optional remoteFields, Optional remoteId, + Optional remoteIds, Optional remoteUpdatedAfter, Optional remoteUpdatedBefore, Optional showEnumOrigins, @@ -160,6 +163,7 @@ private TicketsListRequest( this.remoteCreatedBefore = remoteCreatedBefore; this.remoteFields = remoteFields; this.remoteId = remoteId; + this.remoteIds = remoteIds; this.remoteUpdatedAfter = remoteUpdatedAfter; this.remoteUpdatedBefore = remoteUpdatedBefore; this.showEnumOrigins = showEnumOrigins; @@ -339,7 +343,7 @@ public Optional getName() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -400,6 +404,14 @@ public Optional getRemoteId() { return remoteId; } + /** + * @return If provided, will only return tickets with these remote IDs (comma-separated). + */ + @JsonProperty("remote_ids") + public Optional getRemoteIds() { + return remoteIds; + } + /** * @return If provided, will only return tickets updated in the third party platform after this datetime. */ @@ -496,6 +508,7 @@ private boolean equalTo(TicketsListRequest other) { && remoteCreatedBefore.equals(other.remoteCreatedBefore) && remoteFields.equals(other.remoteFields) && remoteId.equals(other.remoteId) + && remoteIds.equals(other.remoteIds) && remoteUpdatedAfter.equals(other.remoteUpdatedAfter) && remoteUpdatedBefore.equals(other.remoteUpdatedBefore) && showEnumOrigins.equals(other.showEnumOrigins) @@ -536,6 +549,7 @@ public int hashCode() { this.remoteCreatedBefore, this.remoteFields, this.remoteId, + this.remoteIds, this.remoteUpdatedAfter, this.remoteUpdatedBefore, this.showEnumOrigins, @@ -612,6 +626,8 @@ public static final class Builder { private Optional remoteId = Optional.empty(); + private Optional remoteIds = Optional.empty(); + private Optional remoteUpdatedAfter = Optional.empty(); private Optional remoteUpdatedBefore = Optional.empty(); @@ -660,6 +676,7 @@ public Builder from(TicketsListRequest other) { remoteCreatedBefore(other.getRemoteCreatedBefore()); remoteFields(other.getRemoteFields()); remoteId(other.getRemoteId()); + remoteIds(other.getRemoteIds()); remoteUpdatedAfter(other.getRemoteUpdatedAfter()); remoteUpdatedBefore(other.getRemoteUpdatedBefore()); showEnumOrigins(other.getShowEnumOrigins()); @@ -970,7 +987,7 @@ public Builder name(String name) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -1073,6 +1090,20 @@ public Builder remoteId(String remoteId) { return this; } + /** + *

      If provided, will only return tickets with these remote IDs (comma-separated).

      + */ + @JsonSetter(value = "remote_ids", nulls = Nulls.SKIP) + public Builder remoteIds(Optional remoteIds) { + this.remoteIds = remoteIds; + return this; + } + + public Builder remoteIds(String remoteIds) { + this.remoteIds = Optional.ofNullable(remoteIds); + return this; + } + /** *

      If provided, will only return tickets updated in the third party platform after this datetime.

      */ @@ -1201,6 +1232,7 @@ public TicketsListRequest build() { remoteCreatedBefore, remoteFields, remoteId, + remoteIds, remoteUpdatedAfter, remoteUpdatedBefore, showEnumOrigins, diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestExpandItem.java index cc730875d..cf4803ced 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketsListRequestExpandItem.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsListRequestExpandItem.java @@ -16,6 +16,9 @@ public final class TicketsListRequestExpandItem { public static final TicketsListRequestExpandItem ACCOUNT = new TicketsListRequestExpandItem(Value.ACCOUNT, "account"); + public static final TicketsListRequestExpandItem PERMISSIONS = + new TicketsListRequestExpandItem(Value.PERMISSIONS, "permissions"); + public static final TicketsListRequestExpandItem ASSIGNED_TEAMS = new TicketsListRequestExpandItem(Value.ASSIGNED_TEAMS, "assigned_teams"); @@ -70,6 +73,8 @@ public T visit(Visitor visitor) { return visitor.visitAttachments(); case ACCOUNT: return visitor.visitAccount(); + case PERMISSIONS: + return visitor.visitPermissions(); case ASSIGNED_TEAMS: return visitor.visitAssignedTeams(); case COLLECTIONS: @@ -95,6 +100,8 @@ public static TicketsListRequestExpandItem valueOf(String value) { return ATTACHMENTS; case "account": return ACCOUNT; + case "permissions": + return PERMISSIONS; case "assigned_teams": return ASSIGNED_TEAMS; case "collections": @@ -127,6 +134,8 @@ public enum Value { PARENT_TICKET, + PERMISSIONS, + UNKNOWN } @@ -147,6 +156,8 @@ public interface Visitor { T visitParentTicket(); + T visitPermissions(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequest.java new file mode 100644 index 000000000..dc13d45cd --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequest.java @@ -0,0 +1,490 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TicketsLiveSearchRetrieveRequest.Builder.class) +public final class TicketsLiveSearchRetrieveRequest { + private final Optional assigneeIds; + + private final Optional assignees; + + private final Optional collectionIds; + + private final Optional collections; + + private final Optional includeDeletedData; + + private final Optional includeRemoteFields; + + private final Optional includeShellData; + + private final Optional name; + + private final Optional remoteCursor; + + private final Optional remoteFields; + + private final Optional showEnumOrigins; + + private final Optional status; + + private final Optional ticketUrl; + + private final Map additionalProperties; + + private TicketsLiveSearchRetrieveRequest( + Optional assigneeIds, + Optional assignees, + Optional collectionIds, + Optional collections, + Optional includeDeletedData, + Optional includeRemoteFields, + Optional includeShellData, + Optional name, + Optional remoteCursor, + Optional remoteFields, + Optional showEnumOrigins, + Optional status, + Optional ticketUrl, + Map additionalProperties) { + this.assigneeIds = assigneeIds; + this.assignees = assignees; + this.collectionIds = collectionIds; + this.collections = collections; + this.includeDeletedData = includeDeletedData; + this.includeRemoteFields = includeRemoteFields; + this.includeShellData = includeShellData; + this.name = name; + this.remoteCursor = remoteCursor; + this.remoteFields = remoteFields; + this.showEnumOrigins = showEnumOrigins; + this.status = status; + this.ticketUrl = ticketUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return Filter tickets by assignee IDs (comma-separated) + */ + @JsonProperty("assignee_ids") + public Optional getAssigneeIds() { + return assigneeIds; + } + + /** + * @return Filter tickets by assignee names (comma-separated) + */ + @JsonProperty("assignees") + public Optional getAssignees() { + return assignees; + } + + /** + * @return Filter tickets by collection IDs (comma-separated) + */ + @JsonProperty("collection_ids") + public Optional getCollectionIds() { + return collectionIds; + } + + /** + * @return Filter tickets by collection names (comma-separated) + */ + @JsonProperty("collections") + public Optional getCollections() { + return collections; + } + + /** + * @return 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. + */ + @JsonProperty("include_deleted_data") + public Optional getIncludeDeletedData() { + return includeDeletedData; + } + + /** + * @return Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + */ + @JsonProperty("include_remote_fields") + public Optional getIncludeRemoteFields() { + return includeRemoteFields; + } + + /** + * @return Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + */ + @JsonProperty("include_shell_data") + public Optional getIncludeShellData() { + return includeShellData; + } + + /** + * @return Filter tickets by name/title + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Pagination cursor for remote data + */ + @JsonProperty("remote_cursor") + public Optional getRemoteCursor() { + return remoteCursor; + } + + /** + * @return Deprecated. Use show_enum_origins. + */ + @JsonProperty("remote_fields") + public Optional getRemoteFields() { + return remoteFields; + } + + /** + * @return 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 + */ + @JsonProperty("show_enum_origins") + public Optional getShowEnumOrigins() { + return showEnumOrigins; + } + + /** + * @return Filter tickets by status + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return Filter tickets by URL + */ + @JsonProperty("ticket_url") + public Optional getTicketUrl() { + return ticketUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketsLiveSearchRetrieveRequest && equalTo((TicketsLiveSearchRetrieveRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(TicketsLiveSearchRetrieveRequest other) { + return assigneeIds.equals(other.assigneeIds) + && assignees.equals(other.assignees) + && collectionIds.equals(other.collectionIds) + && collections.equals(other.collections) + && includeDeletedData.equals(other.includeDeletedData) + && includeRemoteFields.equals(other.includeRemoteFields) + && includeShellData.equals(other.includeShellData) + && name.equals(other.name) + && remoteCursor.equals(other.remoteCursor) + && remoteFields.equals(other.remoteFields) + && showEnumOrigins.equals(other.showEnumOrigins) + && status.equals(other.status) + && ticketUrl.equals(other.ticketUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.assigneeIds, + this.assignees, + this.collectionIds, + this.collections, + this.includeDeletedData, + this.includeRemoteFields, + this.includeShellData, + this.name, + this.remoteCursor, + this.remoteFields, + this.showEnumOrigins, + this.status, + this.ticketUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional assigneeIds = Optional.empty(); + + private Optional assignees = Optional.empty(); + + private Optional collectionIds = Optional.empty(); + + private Optional collections = Optional.empty(); + + private Optional includeDeletedData = Optional.empty(); + + private Optional includeRemoteFields = Optional.empty(); + + private Optional includeShellData = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional remoteCursor = Optional.empty(); + + private Optional remoteFields = Optional.empty(); + + private Optional showEnumOrigins = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional ticketUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TicketsLiveSearchRetrieveRequest other) { + assigneeIds(other.getAssigneeIds()); + assignees(other.getAssignees()); + collectionIds(other.getCollectionIds()); + collections(other.getCollections()); + includeDeletedData(other.getIncludeDeletedData()); + includeRemoteFields(other.getIncludeRemoteFields()); + includeShellData(other.getIncludeShellData()); + name(other.getName()); + remoteCursor(other.getRemoteCursor()); + remoteFields(other.getRemoteFields()); + showEnumOrigins(other.getShowEnumOrigins()); + status(other.getStatus()); + ticketUrl(other.getTicketUrl()); + return this; + } + + /** + *

      Filter tickets by assignee IDs (comma-separated)

      + */ + @JsonSetter(value = "assignee_ids", nulls = Nulls.SKIP) + public Builder assigneeIds(Optional assigneeIds) { + this.assigneeIds = assigneeIds; + return this; + } + + public Builder assigneeIds(String assigneeIds) { + this.assigneeIds = Optional.ofNullable(assigneeIds); + return this; + } + + /** + *

      Filter tickets by assignee names (comma-separated)

      + */ + @JsonSetter(value = "assignees", nulls = Nulls.SKIP) + public Builder assignees(Optional assignees) { + this.assignees = assignees; + return this; + } + + public Builder assignees(String assignees) { + this.assignees = Optional.ofNullable(assignees); + return this; + } + + /** + *

      Filter tickets by collection IDs (comma-separated)

      + */ + @JsonSetter(value = "collection_ids", nulls = Nulls.SKIP) + public Builder collectionIds(Optional collectionIds) { + this.collectionIds = collectionIds; + return this; + } + + public Builder collectionIds(String collectionIds) { + this.collectionIds = Optional.ofNullable(collectionIds); + return this; + } + + /** + *

      Filter tickets by collection names (comma-separated)

      + */ + @JsonSetter(value = "collections", nulls = Nulls.SKIP) + public Builder collections(Optional collections) { + this.collections = collections; + return this; + } + + public Builder collections(String collections) { + this.collections = Optional.ofNullable(collections); + return this; + } + + /** + *

      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.

      + */ + @JsonSetter(value = "include_deleted_data", nulls = Nulls.SKIP) + public Builder includeDeletedData(Optional includeDeletedData) { + this.includeDeletedData = includeDeletedData; + return this; + } + + public Builder includeDeletedData(Boolean includeDeletedData) { + this.includeDeletedData = Optional.ofNullable(includeDeletedData); + return this; + } + + /** + *

      Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.

      + */ + @JsonSetter(value = "include_remote_fields", nulls = Nulls.SKIP) + public Builder includeRemoteFields(Optional includeRemoteFields) { + this.includeRemoteFields = includeRemoteFields; + return this; + } + + public Builder includeRemoteFields(Boolean includeRemoteFields) { + this.includeRemoteFields = Optional.ofNullable(includeRemoteFields); + return this; + } + + /** + *

      Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null).

      + */ + @JsonSetter(value = "include_shell_data", nulls = Nulls.SKIP) + public Builder includeShellData(Optional includeShellData) { + this.includeShellData = includeShellData; + return this; + } + + public Builder includeShellData(Boolean includeShellData) { + this.includeShellData = Optional.ofNullable(includeShellData); + return this; + } + + /** + *

      Filter tickets by name/title

      + */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

      Pagination cursor for remote data

      + */ + @JsonSetter(value = "remote_cursor", nulls = Nulls.SKIP) + public Builder remoteCursor(Optional remoteCursor) { + this.remoteCursor = remoteCursor; + return this; + } + + public Builder remoteCursor(String remoteCursor) { + this.remoteCursor = Optional.ofNullable(remoteCursor); + return this; + } + + /** + *

      Deprecated. Use show_enum_origins.

      + */ + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) + public Builder remoteFields(Optional remoteFields) { + this.remoteFields = remoteFields; + return this; + } + + public Builder remoteFields(TicketsLiveSearchRetrieveRequestRemoteFields remoteFields) { + this.remoteFields = Optional.ofNullable(remoteFields); + return this; + } + + /** + *

      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

      + */ + @JsonSetter(value = "show_enum_origins", nulls = Nulls.SKIP) + public Builder showEnumOrigins(Optional showEnumOrigins) { + this.showEnumOrigins = showEnumOrigins; + return this; + } + + public Builder showEnumOrigins(TicketsLiveSearchRetrieveRequestShowEnumOrigins showEnumOrigins) { + this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); + return this; + } + + /** + *

      Filter tickets by status

      + */ + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public Builder status(Optional status) { + this.status = status; + return this; + } + + public Builder status(String status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

      Filter tickets by URL

      + */ + @JsonSetter(value = "ticket_url", nulls = Nulls.SKIP) + public Builder ticketUrl(Optional ticketUrl) { + this.ticketUrl = ticketUrl; + return this; + } + + public Builder ticketUrl(String ticketUrl) { + this.ticketUrl = Optional.ofNullable(ticketUrl); + return this; + } + + public TicketsLiveSearchRetrieveRequest build() { + return new TicketsLiveSearchRetrieveRequest( + assigneeIds, + assignees, + collectionIds, + collections, + includeDeletedData, + includeRemoteFields, + includeShellData, + name, + remoteCursor, + remoteFields, + showEnumOrigins, + status, + ticketUrl, + additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..779c162a5 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequestRemoteFields.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TicketsLiveSearchRetrieveRequestRemoteFields { + public static final TicketsLiveSearchRetrieveRequestRemoteFields PRIORITY_TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestRemoteFields(Value.PRIORITY_TICKET_TYPE, "priority,ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestRemoteFields TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestRemoteFields(Value.TICKET_TYPE, "ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestRemoteFields PRIORITY_STATUS_TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestRemoteFields( + Value.PRIORITY_STATUS_TICKET_TYPE, "priority,status,ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestRemoteFields STATUS = + new TicketsLiveSearchRetrieveRequestRemoteFields(Value.STATUS, "status"); + + public static final TicketsLiveSearchRetrieveRequestRemoteFields PRIORITY = + new TicketsLiveSearchRetrieveRequestRemoteFields(Value.PRIORITY, "priority"); + + public static final TicketsLiveSearchRetrieveRequestRemoteFields STATUS_TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestRemoteFields(Value.STATUS_TICKET_TYPE, "status,ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestRemoteFields PRIORITY_STATUS = + new TicketsLiveSearchRetrieveRequestRemoteFields(Value.PRIORITY_STATUS, "priority,status"); + + private final Value value; + + private final String string; + + TicketsLiveSearchRetrieveRequestRemoteFields(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof TicketsLiveSearchRetrieveRequestRemoteFields + && this.string.equals(((TicketsLiveSearchRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PRIORITY_TICKET_TYPE: + return visitor.visitPriorityTicketType(); + case TICKET_TYPE: + return visitor.visitTicketType(); + case PRIORITY_STATUS_TICKET_TYPE: + return visitor.visitPriorityStatusTicketType(); + case STATUS: + return visitor.visitStatus(); + case PRIORITY: + return visitor.visitPriority(); + case STATUS_TICKET_TYPE: + return visitor.visitStatusTicketType(); + case PRIORITY_STATUS: + return visitor.visitPriorityStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TicketsLiveSearchRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "priority,ticket_type": + return PRIORITY_TICKET_TYPE; + case "ticket_type": + return TICKET_TYPE; + case "priority,status,ticket_type": + return PRIORITY_STATUS_TICKET_TYPE; + case "status": + return STATUS; + case "priority": + return PRIORITY; + case "status,ticket_type": + return STATUS_TICKET_TYPE; + case "priority,status": + return PRIORITY_STATUS; + default: + return new TicketsLiveSearchRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + PRIORITY, + + PRIORITY_STATUS, + + PRIORITY_STATUS_TICKET_TYPE, + + PRIORITY_TICKET_TYPE, + + STATUS, + + STATUS_TICKET_TYPE, + + TICKET_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitPriority(); + + T visitPriorityStatus(); + + T visitPriorityStatusTicketType(); + + T visitPriorityTicketType(); + + T visitStatus(); + + T visitStatusTicketType(); + + T visitTicketType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..3de0bfd71 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TicketsLiveSearchRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,142 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.ticketing.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TicketsLiveSearchRetrieveRequestShowEnumOrigins { + public static final TicketsLiveSearchRetrieveRequestShowEnumOrigins PRIORITY_TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value.PRIORITY_TICKET_TYPE, "priority,ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestShowEnumOrigins TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value.TICKET_TYPE, "ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestShowEnumOrigins PRIORITY_STATUS_TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestShowEnumOrigins( + Value.PRIORITY_STATUS_TICKET_TYPE, "priority,status,ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestShowEnumOrigins STATUS = + new TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + public static final TicketsLiveSearchRetrieveRequestShowEnumOrigins PRIORITY = + new TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value.PRIORITY, "priority"); + + public static final TicketsLiveSearchRetrieveRequestShowEnumOrigins STATUS_TICKET_TYPE = + new TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value.STATUS_TICKET_TYPE, "status,ticket_type"); + + public static final TicketsLiveSearchRetrieveRequestShowEnumOrigins PRIORITY_STATUS = + new TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value.PRIORITY_STATUS, "priority,status"); + + private final Value value; + + private final String string; + + TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof TicketsLiveSearchRetrieveRequestShowEnumOrigins + && this.string.equals(((TicketsLiveSearchRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PRIORITY_TICKET_TYPE: + return visitor.visitPriorityTicketType(); + case TICKET_TYPE: + return visitor.visitTicketType(); + case PRIORITY_STATUS_TICKET_TYPE: + return visitor.visitPriorityStatusTicketType(); + case STATUS: + return visitor.visitStatus(); + case PRIORITY: + return visitor.visitPriority(); + case STATUS_TICKET_TYPE: + return visitor.visitStatusTicketType(); + case PRIORITY_STATUS: + return visitor.visitPriorityStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TicketsLiveSearchRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "priority,ticket_type": + return PRIORITY_TICKET_TYPE; + case "ticket_type": + return TICKET_TYPE; + case "priority,status,ticket_type": + return PRIORITY_STATUS_TICKET_TYPE; + case "status": + return STATUS; + case "priority": + return PRIORITY; + case "status,ticket_type": + return STATUS_TICKET_TYPE; + case "priority,status": + return PRIORITY_STATUS; + default: + return new TicketsLiveSearchRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + PRIORITY, + + PRIORITY_STATUS, + + PRIORITY_STATUS_TICKET_TYPE, + + PRIORITY_TICKET_TYPE, + + STATUS, + + STATUS_TICKET_TYPE, + + TICKET_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitPriority(); + + T visitPriorityStatus(); + + T visitPriorityStatusTicketType(); + + T visitPriorityTicketType(); + + T visitStatus(); + + T visitStatusTicketType(); + + T visitTicketType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java index 5ebc344df..cd953c123 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java @@ -116,7 +116,7 @@ public Optional getIsCustom() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -302,7 +302,7 @@ public Builder isCustom(Boolean isCustom) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestExpandItem.java index 83d1d8f0a..742fbbb5c 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestExpandItem.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRetrieveRequestExpandItem.java @@ -16,6 +16,9 @@ public final class TicketsRetrieveRequestExpandItem { public static final TicketsRetrieveRequestExpandItem ACCOUNT = new TicketsRetrieveRequestExpandItem(Value.ACCOUNT, "account"); + public static final TicketsRetrieveRequestExpandItem PERMISSIONS = + new TicketsRetrieveRequestExpandItem(Value.PERMISSIONS, "permissions"); + public static final TicketsRetrieveRequestExpandItem ASSIGNED_TEAMS = new TicketsRetrieveRequestExpandItem(Value.ASSIGNED_TEAMS, "assigned_teams"); @@ -70,6 +73,8 @@ public T visit(Visitor visitor) { return visitor.visitAttachments(); case ACCOUNT: return visitor.visitAccount(); + case PERMISSIONS: + return visitor.visitPermissions(); case ASSIGNED_TEAMS: return visitor.visitAssignedTeams(); case COLLECTIONS: @@ -95,6 +100,8 @@ public static TicketsRetrieveRequestExpandItem valueOf(String value) { return ATTACHMENTS; case "account": return ACCOUNT; + case "permissions": + return PERMISSIONS; case "assigned_teams": return ASSIGNED_TEAMS; case "collections": @@ -127,6 +134,8 @@ public enum Value { PARENT_TICKET, + PERMISSIONS, + UNKNOWN } @@ -147,6 +156,8 @@ public interface Visitor { T visitParentTicket(); + T visitPermissions(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequest.java index 953808403..6d21a57f7 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsViewersListRequest.java @@ -94,7 +94,7 @@ public Optional getIncludeShellData() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -246,7 +246,7 @@ public Builder includeShellData(Boolean includeShellData) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { diff --git a/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java b/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java index 041b63a62..26af4a991 100644 --- a/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java @@ -25,6 +25,8 @@ public final class UsersListRequest { private final Optional> expand; + private final Optional collections; + private final Optional createdAfter; private final Optional createdBefore; @@ -47,12 +49,17 @@ public final class UsersListRequest { private final Optional remoteId; + private final Optional roles; + private final Optional team; + private final Optional teams; + private final Map additionalProperties; private UsersListRequest( Optional> expand, + Optional collections, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -64,9 +71,12 @@ private UsersListRequest( Optional modifiedBefore, Optional pageSize, Optional remoteId, + Optional roles, Optional team, + Optional teams, Map additionalProperties) { this.expand = expand; + this.collections = collections; this.createdAfter = createdAfter; this.createdBefore = createdBefore; this.cursor = cursor; @@ -78,7 +88,9 @@ private UsersListRequest( this.modifiedBefore = modifiedBefore; this.pageSize = pageSize; this.remoteId = remoteId; + this.roles = roles; this.team = team; + this.teams = teams; this.additionalProperties = additionalProperties; } @@ -90,6 +102,14 @@ public Optional> getExpand() { return expand; } + /** + * @return If provided, will only return users involved with at least one of these collections. + */ + @JsonProperty("collections") + public Optional getCollections() { + return collections; + } + /** * @return If provided, will only return objects created after this datetime. */ @@ -163,7 +183,7 @@ public Optional getModifiedBefore() { } /** - * @return Number of results to return per page. + * @return Number of results to return per page. The maximum limit is 100. */ @JsonProperty("page_size") public Optional getPageSize() { @@ -178,6 +198,14 @@ public Optional getRemoteId() { return remoteId; } + /** + * @return If provided, will only return users with at least one of these roles. + */ + @JsonProperty("roles") + public Optional getRoles() { + return roles; + } + /** * @return If provided, will only return users matching in this team. */ @@ -186,6 +214,14 @@ public Optional getTeam() { return team; } + /** + * @return If provided, will only return users with at least one of these teams. + */ + @JsonProperty("teams") + public Optional getTeams() { + return teams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -199,6 +235,7 @@ public Map getAdditionalProperties() { private boolean equalTo(UsersListRequest other) { return expand.equals(other.expand) + && collections.equals(other.collections) && createdAfter.equals(other.createdAfter) && createdBefore.equals(other.createdBefore) && cursor.equals(other.cursor) @@ -210,13 +247,16 @@ private boolean equalTo(UsersListRequest other) { && modifiedBefore.equals(other.modifiedBefore) && pageSize.equals(other.pageSize) && remoteId.equals(other.remoteId) - && team.equals(other.team); + && roles.equals(other.roles) + && team.equals(other.team) + && teams.equals(other.teams); } @java.lang.Override public int hashCode() { return Objects.hash( this.expand, + this.collections, this.createdAfter, this.createdBefore, this.cursor, @@ -228,7 +268,9 @@ public int hashCode() { this.modifiedBefore, this.pageSize, this.remoteId, - this.team); + this.roles, + this.team, + this.teams); } @java.lang.Override @@ -244,6 +286,8 @@ public static Builder builder() { public static final class Builder { private Optional> expand = Optional.empty(); + private Optional collections = Optional.empty(); + private Optional createdAfter = Optional.empty(); private Optional createdBefore = Optional.empty(); @@ -266,8 +310,12 @@ public static final class Builder { private Optional remoteId = Optional.empty(); + private Optional roles = Optional.empty(); + private Optional team = Optional.empty(); + private Optional teams = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -275,6 +323,7 @@ private Builder() {} public Builder from(UsersListRequest other) { expand(other.getExpand()); + collections(other.getCollections()); createdAfter(other.getCreatedAfter()); createdBefore(other.getCreatedBefore()); cursor(other.getCursor()); @@ -286,7 +335,9 @@ public Builder from(UsersListRequest other) { modifiedBefore(other.getModifiedBefore()); pageSize(other.getPageSize()); remoteId(other.getRemoteId()); + roles(other.getRoles()); team(other.getTeam()); + teams(other.getTeams()); return this; } @@ -309,6 +360,20 @@ public Builder expand(UsersListRequestExpandItem expand) { return this; } + /** + *

      If provided, will only return users involved with at least one of these collections.

      + */ + @JsonSetter(value = "collections", nulls = Nulls.SKIP) + public Builder collections(Optional collections) { + this.collections = collections; + return this; + } + + public Builder collections(String collections) { + this.collections = Optional.ofNullable(collections); + return this; + } + /** *

      If provided, will only return objects created after this datetime.

      */ @@ -436,7 +501,7 @@ public Builder modifiedBefore(OffsetDateTime modifiedBefore) { } /** - *

      Number of results to return per page.

      + *

      Number of results to return per page. The maximum limit is 100.

      */ @JsonSetter(value = "page_size", nulls = Nulls.SKIP) public Builder pageSize(Optional pageSize) { @@ -463,6 +528,20 @@ public Builder remoteId(String remoteId) { return this; } + /** + *

      If provided, will only return users with at least one of these roles.

      + */ + @JsonSetter(value = "roles", nulls = Nulls.SKIP) + public Builder roles(Optional roles) { + this.roles = roles; + return this; + } + + public Builder roles(String roles) { + this.roles = Optional.ofNullable(roles); + return this; + } + /** *

      If provided, will only return users matching in this team.

      */ @@ -477,9 +556,24 @@ public Builder team(String team) { return this; } + /** + *

      If provided, will only return users with at least one of these teams.

      + */ + @JsonSetter(value = "teams", nulls = Nulls.SKIP) + public Builder teams(Optional teams) { + this.teams = teams; + return this; + } + + public Builder teams(String teams) { + this.teams = Optional.ofNullable(teams); + return this; + } + public UsersListRequest build() { return new UsersListRequest( expand, + collections, createdAfter, createdBefore, cursor, @@ -491,7 +585,9 @@ public UsersListRequest build() { modifiedBefore, pageSize, remoteId, + roles, team, + teams, additionalProperties); } } diff --git a/src/main/java/com/merge/legacy/api/core/InputStreamRequestBody.java b/src/main/java/com/merge/legacy/api/core/InputStreamRequestBody.java index 3751c4327..ba30a6f3c 100644 --- a/src/main/java/com/merge/legacy/api/core/InputStreamRequestBody.java +++ b/src/main/java/com/merge/legacy/api/core/InputStreamRequestBody.java @@ -8,7 +8,6 @@ import java.util.Objects; import okhttp3.MediaType; import okhttp3.RequestBody; -import okhttp3.internal.Util; import okio.BufferedSink; import okio.Okio; import okio.Source; @@ -68,12 +67,8 @@ public long contentLength() throws IOException { */ @Override public void writeTo(BufferedSink sink) throws IOException { - Source source = null; - try { - source = Okio.source(inputStream); + try (Source source = Okio.source(inputStream)) { sink.writeAll(source); - } finally { - Util.closeQuietly(Objects.requireNonNull(source)); } } }